Skip to content

Commit

Permalink
Merge pull request #125 from MoonSHRD/network/rinkeby
Browse files Browse the repository at this point in the history
Network/rinkeby
  • Loading branch information
hokugava committed Feb 8, 2022
2 parents b062186 + e12b93f commit 14da187
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 126 deletions.
1 change: 0 additions & 1 deletion contracts/721/singleton/CurrenciesERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ contract CurrenciesERC20 is ReentrancyGuard, Ownable {
mapping (string => CurrencyERC20_Custom) public _currencies_custom_user;


// @TODO: Investigate how to add different types of ERC20. Old type have name as public string and no getter, new type have name as private sting and getter for it.
function AddCustomCurrency(address _token_contract) public {

IERC20Metadata _currency_contract = IERC20Metadata(_token_contract);
Expand Down
1 change: 0 additions & 1 deletion contracts/721/singleton/IMSNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ interface IMSNFT {
* also, it may be useful if we would need to upgrade tokensale contract (which include upgrade of a factory contract), so it can be used when rollup new versions of factory and sale
*/
/*
@TODO:check this in tests
Interfaces do not support function modifiers, so the onlyOwner modifier was deleted in the function below. Check if it's still may be used only by owner.
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/721/singleton/MSNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ contract MSNFT is ERC721Enumerable, Ownable {



// Ticket lifecycle @TODO: Maybe useful for migration in future
// Ticket lifecycle: Maybe useful for migration in future
//enum TicketState {Non_Existed, Paid, Fulfilled, Cancelled}

// Rarity type
Expand Down
5 changes: 1 addition & 4 deletions contracts/721/singleton/MetaMarketplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,6 @@ contract MetaMarketplace {
if (metainfo.activeSellOffers[tokenId].minPrice[currency_] != 0) {
require((bid_price_ > metainfo.activeSellOffers[tokenId].minPrice[currency_]),
"Sell order at this price or lower exists");
// @TODO: execute purchase if price is lower instead of revert

}

// Only process the offer if it is higher than the previous one or the
Expand All @@ -305,8 +303,7 @@ contract MetaMarketplace {
"Previous buy offer higher or not expired");

address previousBuyOfferOwner = metainfo.activeBuyOffers[tokenId][currency_].buyer;
uint256 refundBuyOfferAmount = metainfo.buyOffersEscrow[previousBuyOfferOwner]
[tokenId][currency_];
uint256 refundBuyOfferAmount = metainfo.buyOffersEscrow[previousBuyOfferOwner][tokenId][currency_];
// Refund the owner of the previous buy offer
if (refundBuyOfferAmount > 0) {
_sendRefund(currency_, previousBuyOfferOwner, refundBuyOfferAmount);
Expand Down
2 changes: 1 addition & 1 deletion contracts/721/singleton/TokenSaleSingleton.sol
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ contract TokenSaleSingleton is Context, ReentrancyGuard {
SaleInfo storage metasale = MSaleInfo[master_id_];

uint sc = metasale._sold_count;
uint limit = sc++; // @todo: check this in tests
uint limit = ++sc;

// Check sale_limit (including rarity check)
require(check_sale_limit(limit,master_id_) == true, "tokens amount should not exceed sale_limit");
Expand Down
43 changes: 1 addition & 42 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//var KNS = artifacts.require("./KNS.sol");
var MasterFactory = artifacts.require("./721/singleton/MasterFactory721.sol");
// //var Deposit = artifacts.require("./Deposit.sol")
var Master = artifacts.require("./721/singleton/MSNFT.sol");
// var limitGas = web3.eth.getBlock("latest").gasLimit;
var SVC = artifacts.require("./SVC.sol");
var NFTTemplate = artifacts.require("./721/singleton/NftTemplate.sol");
var ERC1155Item = artifacts.require("./1155/ERC1155Item.sol");
Expand All @@ -28,63 +25,37 @@ var dai_address = web3.utils.toChecksumAddress('0xad6d458402f60fd3bd25163575031a
var weth_address = web3.utils.toChecksumAddress('0xc778417e063141139fce010982780140aa0cd5ab');
var wbtc_address = web3.utils.toChecksumAddress('0x65058d7081fcdc3cd8727dbb7f8f9d52cefdd291');

// @todo: remove next two lines
//var deposit_value = '50000'; // deposit INITIAL exchange market cup (turn capital)
//var deposit_value_wei = web3.utils.toWei(deposit_value,'ether');

//var custom_gas_price = '9'; // for ropsten
//var wei_gas_price = web3.utils.toWei(custom_gas_price, 'gwei');
//var string_gas_price = wei_gas_price.toString;

module.exports = function (deployer, network, accounts) {
process.env.NETWORK = deployer.network;
if (network == "rinkeby") {
console.log(accounts);
// console.log(wei_gas_price);

console.log("block gas price:");
var limitGas = web3.eth.getBlock("latest").gasLimit;
console.log(limitGas);
// console.log(string_gas_price);

deployer.then(async () => {
/*
await deployer.deploy(USDT,"USDT","USDT");
await deployer.deploy(USDC,"USDC","USDC");
USDC = await USDC.deployed();
await deployer.deploy(DAI,"DAI","DAI");
DAI = await DAI.deployed();
await deployer.deploy(WETH,"WETH","WETH");
WETH = await WETH.deployed();
await deployer.deploy(WBTC,"WBTC","WBTC");
WBTC = await WBTC.deployed();
*/
await deployer.deploy(MST, "SONM", "MST");
MST = await MST.deployed();
await deployer.deploy(SVC, "v0.0.0");
console.log("MST dummy address:");
console.log(MST.address);
//...
}).then(function () {
console.log("usdt address:");
console.log(usdt_address);
console.log("weth address:");
console.log(weth_address);
return deployer.deploy(Currencies, usdt_address, usdc_address, dai_address, weth_address, MST.address, wbtc_address, {
// gasPrice: wei_gas_price,
from: accounts[0]
});

}).then(function () {
return deployer.deploy(Master, "MoonShardNFT", "MSNFT", {
// gasPrice: wei_gas_price,
from: accounts[0]
});
}).then(function () {
console.log("Master token address:");
console.log(Master.address);
return deployer.deploy(MasterFactory, Master.address, accounts[0], Currencies.address, {
// gasPrice: wei_gas_price,
from: accounts[0]
});

Expand All @@ -101,7 +72,6 @@ module.exports = function (deployer, network, accounts) {
}).then(async () => {

return deployer.deploy(InterfaceR, {
// gasPrice: wei_gas_price,
from: accounts[0]
});
}).then(async () => {
Expand All @@ -120,7 +90,6 @@ module.exports = function (deployer, network, accounts) {
}).then(async () => {

return deployer.deploy(MetaMarket, Currencies.address, Master.address, accounts[0], {
// gasPrice: wei_gas_price,
from: accounts[0]
});
}).then(async () => {
Expand All @@ -136,12 +105,9 @@ module.exports = function (deployer, network, accounts) {

if (network == "development") {
console.log(accounts);
console.log(wei_gas_price);

console.log("block gas price:");
var limitGasDev = web3.eth.getBlock("latest").gasLimit;
console.log(limitGasDev);
// console.log(string_gas_price);

deployer.then(async () => {
await deployer.deploy(ERC1155Item);
Expand All @@ -154,29 +120,24 @@ module.exports = function (deployer, network, accounts) {
DAI = await DAI.deployed();
await deployer.deploy(WETH, "Wrapped_Ethereum", "WETH");
WETH = await WETH.deployed();
await deployer.deploy(WBTC,"Wrapped_Bitcoin", "WBTC");
await deployer.deploy(WBTC, "Wrapped_Bitcoin", "WBTC");

await deployer.deploy(MST, "SONM", "MST");
MST = await MST.deployed();

//...
}).then(function () {

return deployer.deploy(Currencies, USDT.address, USDC.address, DAI.address, WETH.address, MST.address, WBTC.address, {
// gasPrice: wei_gas_price,
from: accounts[0]
});

}).then(function () {
return deployer.deploy(Master, "MoonShardNFT", "MSNFT", {
// gasPrice: wei_gas_price,
from: accounts[0]
});
}).then(function () {
console.log("Master token address:");
console.log(Master.address);
return deployer.deploy(MasterFactory, Master.address, accounts[1], Currencies.address, {
// gasPrice: wei_gas_price,
from: accounts[0]
});

Expand All @@ -193,7 +154,6 @@ module.exports = function (deployer, network, accounts) {
}).then(async () => {

return deployer.deploy(InterfaceR, {
// gasPrice: wei_gas_price,
from: accounts[0]
});
}).then(async () => {
Expand All @@ -212,7 +172,6 @@ module.exports = function (deployer, network, accounts) {
}).then(async () => {

return deployer.deploy(MetaMarket, Currencies.address, Master.address, accounts[1], {
// gasPrice: wei_gas_price,
from: accounts[0]
});
}).then(async () => {
Expand Down
24 changes: 13 additions & 11 deletions rinkeby_addresses.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
v 0.0.8
v 0.0.9

MST - 0xe512fd935C11d42b62719B03b6B9536B5E8EE90a
MST - 0x2Edb76D8c88fBfcd7171150cb337c7dbE77a3D97

SVC - 0x971E376cb75Cf1425f5e4Fd19A6E58B04C10FF69
SVC - 0x4F0B28f5514cEB9Da3db0BE49522344Ce6e7778C

CurrenciesERC20 - 0x1430c6f06c39E5699d9F64ee5C7546C75A4C855c
CurrenciesERC20 - 0xD98c54F4c69E2b93211d7AaB0637D596C5089A6A

MSNFT - 0xFfb45e785FbfDEB115397a0a00d47cb4062F23aa
MSNFT - 0xE7d8cB0b1E7d1879F6F98BcCCac6a2501F2DD574

MasterFactory721 - 0x379e9888736b70908Fe412808A7dAA382F454463
MasterFactory721 - 0x39e4231A73DEEb3746Ed4203C8d2ED3C0a539Ed7

InterfaceRegister - 0x24f90DF018b7292c455fc198D3e52B0caBFcC1F7
InterfaceRegister - 0xD48eAE5E78F71367f0B6D8b10238FF5ECc84870c

MetaMarketplace - 0x2acfE067A8738d4e653f9c284Bbbe74a003C29b6
MetaMarketplace - 0x62cd7aD59de1328625D3831A92540797F1946c97

TokenSaleSingleton - 0x40273d55c287267F0A58bfe30a260Dc477c639A3

Rinkeby-0.0.8

Eighth deployment in public testnet! 🎉
Rinkeby-0.0.9

contracts ABI for eighth rinkeby release are in attach archive
Ninth deployment in public testnet! 🎉

contracts ABI for ninth rinkeby release are in attach archive

addresses for deployed contracts are in rinkeby_addresses.txt

0 comments on commit 14da187

Please sign in to comment.