deploy Explorer SBT NFT

This commit is contained in:
yuexin 2023-11-09 17:11:58 +08:00
parent 5c32aae3e7
commit c6fb8fcbd0
8 changed files with 28323 additions and 75 deletions

View File

@ -52,7 +52,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [],
@ -65,7 +66,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [],
@ -109,7 +111,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -10167,7 +10170,8 @@
}
},
"schemaVersion": "3.4.14",
"updatedAt": "2023-09-05T06:06:15.699Z",
"updatedAt": "2023-11-09T08:27:08.318Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",
"methods": {

View File

@ -2603,7 +2603,7 @@
}
},
"schemaVersion": "3.4.14",
"updatedAt": "2023-09-05T07:41:50.380Z",
"updatedAt": "2023-11-09T08:27:08.323Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",

View File

@ -183,7 +183,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [],
@ -196,7 +197,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [],
@ -209,7 +211,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -246,7 +249,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -265,7 +269,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -284,7 +289,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -326,7 +332,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -350,7 +357,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [],
@ -363,7 +371,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [],
@ -376,7 +385,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -395,7 +405,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -513,7 +524,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [],
@ -526,7 +538,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -545,7 +558,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -569,7 +583,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [],
@ -582,7 +597,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -624,7 +640,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -656,7 +673,8 @@
}
],
"stateMutability": "view",
"type": "function"
"type": "function",
"constant": true
},
{
"inputs": [
@ -27798,9 +27816,168 @@
"name": "solc",
"version": "0.8.10+commit.fc410830.Emscripten.clang"
},
"networks": {},
"networks": {
"42161": {
"events": {
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": {
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "approved",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31": {
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "ApprovalForAll",
"type": "event"
},
"0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff": {
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "previousAdminRole",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "newAdminRole",
"type": "bytes32"
}
],
"name": "RoleAdminChanged",
"type": "event"
},
"0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d": {
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "RoleGranted",
"type": "event"
},
"0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b": {
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "RoleRevoked",
"type": "event"
},
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": {
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
}
},
"links": {},
"address": "0x0cee888fA25810ca648D697099bc17a2c9E1dfBF",
"transactionHash": "0xf489a18dd23ed797cedb660c14ea92118fc27c33c91a17b5f93bb944f14bcb14"
}
},
"schemaVersion": "3.4.14",
"updatedAt": "2023-11-03T11:11:46.942Z",
"updatedAt": "2023-11-09T08:27:08.304Z",
"networkType": "ethereum",
"devdoc": {
"kind": "dev",
"methods": {

File diff suppressed because one or more lines are too long

View File

@ -1,33 +1,46 @@
const Box = artifacts.require("tokens/erc721/BEBadge");
const Box = artifacts.require("tokens/erc721/NFTSbt");
const Metadata = artifacts.require("core/JSONMetadata");
const base = require("../scripts/base");
const config = require("../config/config");
const Distributor = artifacts.require("logic/NftDistributor");
module.exports = async function (deployer, network, accounts) {
const name = "Candy";
const symbol = "CANDY";
// await deployer.deploy(Box, name, symbol, 0);
const dpaddr = accounts[0]
console.log('[deployer address]', dpaddr)
let cfgs = base.loadData({ network });
const metadataInstance = await Metadata.at(
cfgs.find((c) => c.name === "JSONMetadata").address
);
if (metadataInstance) {
console.log("[metadataInstance]", metadataInstance.address);
}else{
return
}
const name = "Explorer";
const symbol = "EXPLORER";
await deployer.deploy(Box, name, symbol, 0);
const gachaInstance = await Box.deployed();
if (gachaInstance) {
console.log("Candy successfully deployed.");
console.log("Explorer successfully deployed.");
}
// base.updateArray({
// name: "Candy",
// type: "erc721",
// json: "assets/contracts/BEBadge.json",
// address: gachaInstance.address,
// network,
// });
base.updateArray({
name: "Explorer",
type: "erc721",
json: "assets/contracts/NFTSbt.json",
address: gachaInstance.address,
network,
});
let metaaddr = '0xfba1F2861718993B94edd5DCe1D06b3Cbe19353d'
let metaaddr = ''
if(network == 'arbitrum_one'){
// await deployer.deploy(Metadata);
const metadataInstance = await Metadata.deployed();
if (metadataInstance) {
console.log("metadataInstance successfully deployed.");
}
// const metadataInstance = await Metadata.deployed();
// if (metadataInstance) {
// console.log("metadataInstance successfully deployed.");
// }
// base.updateArray({
// name: "JSONMetadata",
// type: "logic",
@ -37,10 +50,9 @@ module.exports = async function (deployer, network, accounts) {
// });
const mtname = name
const mtdesc = "Candy Badge are exclusive to new friends entering the world of CiunterFire,\\n\
it will have airdrop attributes and in-game benefits."
const mtimg = "https://gateway.pinata.cloud/ipfs/QmWuHBFGirZS7uyGDyEJNBnMjGLsP9Ke4QZaoL2MxYWtat"
const mtex = ',"animation_url": "https://gateway.pinata.cloud/ipfs/QmRJAN58RaFZUeor9VhdiqCziujwvwD98zq7xHUnmbzMXW"'
const mtdesc = "Explorer badge as a special recognition and gratitude to our dedicated early CounterFire testers. It's an SBT (Special Badge Token) and will play a pivotal role in forthcoming reward distributions."
const mtimg = "https://gateway.pinata.cloud/ipfs/QmRtJ6MpKm58KV8wBZcNwcVRRZDFCnqqCbqFspKZYQNGb5"
const mtex = ',"animation_url": "https://gateway.pinata.cloud/ipfs/QmR5dbEN95SBdaDp72Pc9aA4wU5DcyDXXWSihxkNUMHUbF"'
await metadataInstance.setMetaData(
gachaInstance.address,
@ -59,34 +71,12 @@ module.exports = async function (deployer, network, accounts) {
await gachaInstance.updateMetaAddress(metaaddr);
console.log(`success update meta address for: ${gachaInstance.address}`);
const testexec = ['0x1cC73CE74BA0BC080e7C0a37cb3a68f435Ab333A']
let exec = network == 'arbitrum_one'? config.admins.executors: testexec
await gachaInstance.setMintRole(config.admins.executors[0])
await gachaInstance.setMintRole(dpaddr)
console.log('exec addrs:', exec)
await deployer.deploy(
Distributor,
gachaInstance.address,
exec
);
const distributorInstance = await Distributor.deployed();
if (distributorInstance) {
console.log("NftDistributor successfully deployed.");
console.log("address: " + distributorInstance.address);
}
base.updateArray({
name: "NftDistributor",
type: "logic",
json: "assets/contracts/NftDistributor.json",
address: distributorInstance.address,
network,
});
await gachaInstance.setMintRole(distributorInstance.address);
console.log(
`success set mint role to: ${distributorInstance.address} claim box `
);
await gachaInstance.batchMint(dpaddr, 1)
console.log('deploy and mint complete')
};

View File

@ -40,5 +40,11 @@
"type": "logic",
"json": "assets/contracts/ERC721Staking.json",
"address": "0x2d8D530941d6Cbe92Cf0654671522e425b9882A2"
},
{
"name": "Explorer",
"type": "erc721",
"json": "assets/contracts/NFTSbt.json",
"address": "0x0cee888fA25810ca648D697099bc17a2c9E1dfBF"
}
]
]

View File

@ -29,6 +29,7 @@
"stake_deploy:one": "truffle migrate --network arbitrum_one -f 9 --to 9 --compile-none",
"update:stake": "npx truffle exec --network arbitrum_one ./init_scripts/update_stake.js",
"update:candy": "npx truffle exec --network arbitrum_one ./init_scripts/generate_candy.js",
"explorer_deploy:one": "truffle migrate --network arbitrum_one -f 18 --to 18 --compile-none",
"size": "truffle run contract-size"
},
"author": "",

View File

@ -163,7 +163,7 @@ module.exports = {
production: true,
disableConfirmationListener: true,
from: arbOneAddr,
gas: 20000000, // Gas sent with each transaction (default: ~6700000)
gas: 30000000, // Gas sent with each transaction (default: ~6700000)
gasPrice: 100000000, // 20 gwei (in wei) (default: 100 gwei)
},
arbitrum_one_self: {