This commit is contained in:
cebgcontract 2022-04-20 15:01:54 +08:00
parent bf87c8521f
commit a068fda5da
24 changed files with 119840 additions and 43129 deletions

File diff suppressed because one or more lines are too long

View File

@ -24405,8 +24405,8 @@
}
},
"links": {},
"address": "0x9b1f7F645351AF3631a656421eD2e40f2802E6c0",
"transactionHash": "0x6b1a17cfbdcf2966b3c42ad8e6e16f26c0c73fc392bc04890ca9e051d43c1ddb"
"address": "0xB383305FAd84A18A097056223e3186ab082ec9B7",
"transactionHash": "0x7e6c1450d9177161eb429e1b4986116d4a329df78e8a74ae4aeeec8753baaa2c"
},
"1644989050832": {
"events": {
@ -24586,7 +24586,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.757Z",
"updatedAt": "2022-04-20T01:26:08.588Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

View File

@ -9935,8 +9935,8 @@
}
},
"links": {},
"address": "0xCfEB869F69431e42cdB54A4F4f105C19C080A601",
"transactionHash": "0xbb200430c4f73223707054cbf0b7b884ae923dd74a59c352e9d7fdfc819f74d5"
"address": "0xAf8aE75834cF919D94B0a319d6A4Aa125E99Ff31",
"transactionHash": "0xf46be17a08ea69a28e8a57d8565f0ac68c0bb27673b24fc9f729d06f1a46a3c7"
},
"1644989050832": {
"events": {},
@ -9946,7 +9946,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.697Z",
"updatedAt": "2022-04-20T01:26:08.537Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

View File

@ -24405,8 +24405,8 @@
}
},
"links": {},
"address": "0x59d3631c86BbE35EF041872d502F218A39FBa150",
"transactionHash": "0x710887c5995123a55a33d37a4e451df2d0c5312fb11ff12f9c76a005fcecd441"
"address": "0x2d487738d3eaDB2B69df125851150e7F37c117B8",
"transactionHash": "0xa94215030d26f0e6d525717ecb771d9d7a4e37a754cf981bef2226cc17eef662"
},
"1644989050832": {
"events": {
@ -24586,7 +24586,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.735Z",
"updatedAt": "2022-04-20T01:26:08.572Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

View File

@ -13468,12 +13468,12 @@
}
},
"links": {},
"address": "0xC89Ce4735882C9F0f0FE26686c53074E09B0D550",
"transactionHash": "0x590823a341e07cece4c97e2cc0eb9045b2fee4ab94944ea0dd3de4e470146e84"
"address": "0xFC9Efd8740D942c2096aA2823924FEF4c89871EB",
"transactionHash": "0x2fbdce58344f57a7c5f4b96ffbacf6e06edc11219577ae8f2a0c0e193dd65844"
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.705Z",
"updatedAt": "2022-04-20T01:26:08.544Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

View File

@ -24411,8 +24411,8 @@
}
},
"links": {},
"address": "0x9561C133DD8580860B6b7E504bC5Aa500f0f06a7",
"transactionHash": "0x07b7fd17c110a1ce26872e66dbb1bb7ef5907f33f94404e01464b81db65f2365"
"address": "0x053F651ef63C0A18dFd7152b502D1D91F798441D",
"transactionHash": "0x6aa62710fc751ca6c347f3bd15c83766bb9993cd4202d85def3339bc2c0f4d27"
},
"1644989050832": {
"events": {
@ -24592,7 +24592,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.721Z",
"updatedAt": "2022-04-20T01:26:08.556Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -24836,8 +24836,8 @@
}
},
"links": {},
"address": "0x4bf3A7dFB3b76b5B3E169ACE65f888A4b4FCa5Ee",
"transactionHash": "0x0ed7fda7132cc0f47ca24a45b2ee8bdc2a92d3b51558bcfcc157d4677924af02"
"address": "0x6626C2CeB990399d70d2f5D706DcDE5eB57E8AFe",
"transactionHash": "0xe57e7e3dd87c0156914830339530fd5c2acdec87a93fdd24b8bcf3318b51dd5d"
},
"1644989050832": {
"events": {},
@ -24847,7 +24847,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.659Z",
"updatedAt": "2022-04-20T01:26:08.501Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

View File

@ -27667,8 +27667,8 @@
}
},
"links": {},
"address": "0x0E696947A06550DEf604e82C26fd9E493e576337",
"transactionHash": "0x9dbdcc5e04b78c4142fed513a3e06fd05cc69fc56ec8c0ac0c1d0174d49fe9af"
"address": "0x40c71a60fE61b1cA3a39f6eC7C8b3efc160ed5A7",
"transactionHash": "0xfb421c06d2f0ea33b52b6bbf86f45ee2d6c433d0d19ca009b5bec7fbd1dddcc8"
},
"1644989050832": {
"events": {},
@ -27678,7 +27678,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.798Z",
"updatedAt": "2022-04-20T01:26:08.624Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33792,8 +33792,8 @@
}
},
"links": {},
"address": "0x2612Af3A521c2df9EAF28422Ca335b04AdF3ac66",
"transactionHash": "0x620998d11a263ab98a53047b39f03a1c48648fd6aed1b56c3bbdf286ac6039c2"
"address": "0x5Bf06144cDf295a1774C3F3A2bC65c687E539AD7",
"transactionHash": "0x463fec83b90c33765e75702e3ecf3cac1ab0dcff9f3bcc60d7b35bbd3a98a7c9"
},
"1644989050832": {
"events": {
@ -33872,7 +33872,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.775Z",
"updatedAt": "2022-04-20T01:26:08.603Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

View File

@ -3164,8 +3164,8 @@
"1338": {
"events": {},
"links": {},
"address": "0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab",
"transactionHash": "0xd609e4dfdc5ef642b3192d2f90ee390eacb6863bf145da078ffca2a0aa1ba67e"
"address": "0x60ccD3190756015162a37921DC25C4031A4022c8",
"transactionHash": "0x67b97373496f22d1c9ac1b83daf82f46c3d1a648299ec870d5e38d3f20b08877"
},
"1644989050832": {
"events": {},
@ -3175,7 +3175,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.853Z",
"updatedAt": "2022-04-20T01:26:08.664Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

View File

@ -8961,8 +8961,8 @@
}
},
"links": {},
"address": "0x26b4AFb60d6C903165150C6F0AA14F8016bE4aec",
"transactionHash": "0xbc275985bc9d7fff915768099e8dcd6b1589d930dd1e024e89bdb33bee9b8506"
"address": "0xD96686f5e68114684a1b9cD6B5ff0E8a9768a89d",
"transactionHash": "0xd79360eb2ea88b69c5d49a4b3ae0492a824227454521d8f3b55c11191c60bff9"
},
"1644989050832": {
"events": {},
@ -8972,7 +8972,7 @@
}
},
"schemaVersion": "3.4.3",
"updatedAt": "2022-04-19T01:08:20.788Z",
"updatedAt": "2022-04-20T01:26:08.614Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

File diff suppressed because one or more lines are too long

View File

@ -4,8 +4,8 @@ import "../BEBase.sol";
// this contract will transfer ownership to BETimelockController after deployed
// all onlyowner method would add timelock
contract BELuckyBox is BEBase{
constructor() ERC721("CRYPTO ELITE'S LUCKYBOX KEY", "KEY") {}
contract BEMysteryBox is BEBase{
constructor() ERC721("CRYPTO ELITE'S MYSTERYBOX KEY", "KEY") {}
function userTokens(address user, uint256 start, uint256 page)
external view returns (uint256 [] memory){

View File

@ -11,7 +11,7 @@ interface IMintableERC721 is IERC721 {
function burn(address owner, uint256 tokenId) external;
}
contract LuckyBoxProxy is Ownable, Initializable, HasSignature {
contract MysteryBoxProxy is Ownable, Initializable, HasSignature {
IMintableERC721 public box;
IMintableERC721 public hero;
IMintableERC721 public equip;
@ -40,7 +40,7 @@ contract LuckyBoxProxy is Ownable, Initializable, HasSignature {
uint8[3] types
);
constructor() HasSignature("LuckyBoxProxy", "1") {}
constructor() HasSignature("MysteryBoxProxy", "1") {}
function init(address[4] calldata _erc721s)
external
@ -75,7 +75,7 @@ contract LuckyBoxProxy is Ownable, Initializable, HasSignature {
) external {
require(
!usedSignatures[signature],
"LuckyBoxProxy: signature used. please send another transaction with new signature"
"MysteryBoxProxy: signature used. please send another transaction with new signature"
);
address owner = msg.sender;
bytes32 criteriaMessageHash = getMessageHash(
@ -86,9 +86,9 @@ contract LuckyBoxProxy is Ownable, Initializable, HasSignature {
saltNonce
);
checkSigner(executor, criteriaMessageHash, signature);
usedSignatures[signature] = true;
// open box
box.burn(owner, boxId);
usedSignatures[signature] = true;
uint256[3] memory results = [ids[0], 0, 0];
uint8[3] memory types = [TYPE_HERO, TYPE_NONE, TYPE_NONE];

View File

@ -1,5 +1,5 @@
const LuckyBox = artifacts.require('luckybox/BELuckyBox');
const BoxProxy = artifacts.require('luckybox/LuckyBoxProxy');
const LuckyBox = artifacts.require('mysterybox/BEMysteryBox');
const BoxProxy = artifacts.require('mysterybox/MysteryBoxProxy');
const Hero = artifacts.require('BEHero');
const Equip = artifacts.require('BEEquipment');
const Chip = artifacts.require('BEChip');

View File

@ -1,5 +1,5 @@
const LuckyBox = artifacts.require('luckybox/BELuckyBox');
const BoxProxy = artifacts.require('luckybox/LuckyBoxProxy');
const LuckyBox = artifacts.require('mysterybox/BEMysteryBox');
const BoxProxy = artifacts.require('mysterybox/MysteryBoxProxy');
const Hero = artifacts.require('BEHero');
const Equip = artifacts.require('BEEquipment');
const Chip = artifacts.require('BEChip');
@ -13,26 +13,23 @@ module.exports = async function (deployer, network, accounts) {
const equipInstance = await Equip.deployed();
const chipInstance = await Chip.deployed();
// await boxProxyInstance.init(
// [
// heroInstance.address,
// equipInstance.address,
// chipInstance.address,
// luckyBoxInstance.address
// ]
// )
// console.log('boxProxyInstance inited')
// await boxProxyInstance.updateExecutor(accounts[0]);
// console.log('boxProxyInstance updateExecutor')
// await heroInstance.setMintFactory(boxProxyInstance.address);
// await equipInstance.setMintFactory(boxProxyInstance.address);
// await chipInstance.setMintFactory(boxProxyInstance.address);
// await luckyBoxInstance.setMintFactory(boxProxyInstance.address);
// console.log('nft mint factory updated')
await boxProxyInstance.init(
[
heroInstance.address,
equipInstance.address,
chipInstance.address,
luckyBoxInstance.address
]
)
console.log('boxProxyInstance inited')
await boxProxyInstance.updateExecutor(accounts[0]);
console.log('boxProxyInstance updateExecutor')
await heroInstance.setMintFactory(boxProxyInstance.address);
await equipInstance.setMintFactory(boxProxyInstance.address);
await chipInstance.setMintFactory(boxProxyInstance.address);
await luckyBoxInstance.setMintFactory(boxProxyInstance.address);
console.log('nft mint factory updated')
await heroInstance.setBurnProxy(boxProxyInstance.address);
await equipInstance.setBurnProxy(boxProxyInstance.address);
await chipInstance.setBurnProxy(boxProxyInstance.address);
await luckyBoxInstance.setBurnProxy(boxProxyInstance.address);
console.log('nft burn proxy updated')
}

View File

@ -8,8 +8,8 @@ const Chip = artifacts.require('BEChip');
const MarketPlace = artifacts.require('MarketPlace');
const Factory = artifacts.require('MinterFactory');
const EvolveProxy = artifacts.require('EvolveProxy');
const LuckyBox = artifacts.require('luckybox/BELuckyBox');
const BoxProxy = artifacts.require('luckybox/LuckyBoxProxy');
const LuckyBox = artifacts.require('mysterybox/BEMysteryBox');
const BoxProxy = artifacts.require('mysterybox/MysteryBoxProxy');
const config = require("../config/config");
@ -38,7 +38,7 @@ module.exports = async function (deployer, network, accounts) {
const boxInstance = await Box.deployed();
const luckyBoxInstance = await LuckyBox.deployed();
const boxProxyInstance = await BoxProxy.deployed();
const goldInstance = await Gold.deployed;
const goldInstance = await Gold.deployed();
let jsons = []
jsons.push({name: 'coin', json: 'assets/contracts/BECoin.json', address: coinInstance.address})
jsons.push({name: 'gold', json: 'assets/contracts/BEGold.json', address: goldInstance.address})
@ -50,8 +50,8 @@ module.exports = async function (deployer, network, accounts) {
jsons.push({name: 'mall', json: 'assets/contracts/BEBoxMall.json', address: boxInstance.address})
jsons.push({name: 'proxy', json: 'assets/contracts/EvolveProxy.json', address: proxyInstance.address})
jsons.push({name: 'timelock', json: 'assets/contracts/BETimelockController.json', address: timelockInstance.address})
jsons.push({name: 'luckbox', json: 'assets/contracts/BELuckyBox.json', address: luckyBoxInstance.address})
jsons.push({name: 'boxproxy', json: 'assets/contracts/LuckyBoxProxy.json', address: boxProxyInstance.address})
jsons.push({name: 'luckbox', json: 'assets/contracts/BEMysteryBox.json', address: luckyBoxInstance.address})
jsons.push({name: 'boxproxy', json: 'assets/contracts/MysteryBoxProxy.json', address: boxProxyInstance.address})
console.log(JSON.stringify(jsons));
console.log(`export const userAddress = '${accounts[0]}';`)
console.log(`export const privateKey = '';`)