添加测试链staking相关地址
This commit is contained in:
parent
7dd08188ba
commit
a59dc4771b
459
build/contracts/EsToken.json
Normal file
459
build/contracts/EsToken.json
Normal file
File diff suppressed because one or more lines are too long
237
build/contracts/RewardDistributor.json
Normal file
237
build/contracts/RewardDistributor.json
Normal file
File diff suppressed because one or more lines are too long
318
build/contracts/RewardRouter.json
Normal file
318
build/contracts/RewardRouter.json
Normal file
File diff suppressed because one or more lines are too long
920
build/contracts/RewardTracker.json
Normal file
920
build/contracts/RewardTracker.json
Normal file
File diff suppressed because one or more lines are too long
946
build/contracts/Vester.json
Normal file
946
build/contracts/Vester.json
Normal file
File diff suppressed because one or more lines are too long
@ -48,12 +48,19 @@ const mint = {
|
||||
airdropCount: 500,
|
||||
}
|
||||
|
||||
const staking = {
|
||||
cec: '0xe34c5ea0c3083d11a735dc0609533b92130319f5',
|
||||
// stake cec时, 每质押一个cec, 每年可获得的收益
|
||||
rewardPerSecond: BigInt(1.5 * 10 ** 18) / BigInt(365 * 24 * 60 * 60)
|
||||
}
|
||||
|
||||
var config = {
|
||||
market,
|
||||
admins,
|
||||
token,
|
||||
imtbl,
|
||||
mint
|
||||
mint,
|
||||
staking
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
125
deploy/8_deploy_staking.ts
Normal file
125
deploy/8_deploy_staking.ts
Normal file
@ -0,0 +1,125 @@
|
||||
import {HardhatRuntimeEnvironment} from "hardhat/types";
|
||||
import {DeployFunction} from "hardhat-deploy/types";
|
||||
import {updateArray} from "../scripts/utils";
|
||||
import {ZeroAddress} from "ethers";
|
||||
|
||||
const secondsPerYear = 365 * 24 * 60 * 60;
|
||||
|
||||
const deployNFTClaim: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
||||
const provider = hre.ethers.provider;
|
||||
const from = await (await provider.getSigner()).getAddress();
|
||||
const config = require(`../config/config_${hre.network.name}`);
|
||||
const {mallFeeAddress, paymentTokens, verifier} = config.market;
|
||||
const {cec, rewardPerSecond} = config.staking;
|
||||
const tokenName = "Escrowed CEC";
|
||||
const tokenSymbol = "esCEC";
|
||||
const esCEC = await hre.deployments.deploy("EsToken", {
|
||||
from,
|
||||
args: [tokenName, tokenSymbol],
|
||||
log: true,
|
||||
});
|
||||
console.log("==EsToken addr=", esCEC.address);
|
||||
updateArray({
|
||||
name: "esCEC",
|
||||
type: "erc20",
|
||||
json: "assets/contracts/EsToken.json",
|
||||
address: esCEC.address,
|
||||
network: hre.network.name,
|
||||
});
|
||||
// verify the contract
|
||||
try {
|
||||
await hre.run("verify:verify", {
|
||||
address: esCEC.address,
|
||||
constructorArguments: [tokenName, tokenSymbol],
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("==verify failed", e);
|
||||
}
|
||||
|
||||
const stakedCecTracker = await hre.deployments.deploy("RewardTracker", {
|
||||
from,
|
||||
args: ["Staked CEC", "sCEC"],
|
||||
log: true,
|
||||
});
|
||||
console.log("==RewardTracker addr=", stakedCecTracker.address);
|
||||
updateArray({
|
||||
name: "stakedCecTracker",
|
||||
type: "logic",
|
||||
json: "assets/contracts/RewardTracker.json",
|
||||
address: stakedCecTracker.address,
|
||||
network: hre.network.name,
|
||||
});
|
||||
const stakedCecDistributor = await hre.deployments.deploy("RewardDistributor", {
|
||||
from,
|
||||
args: [esCEC.address, stakedCecTracker.address],
|
||||
log: true,
|
||||
});
|
||||
|
||||
console.log("==RewardDistributor addr=", stakedCecDistributor.address);
|
||||
updateArray({
|
||||
name: "stakedCecDistributor",
|
||||
type: "logic",
|
||||
json: "assets/contracts/RewardDistributor.json",
|
||||
address: stakedCecDistributor.address,
|
||||
network: hre.network.name,
|
||||
});
|
||||
|
||||
const vester = await hre.deployments.deploy("Vester", {
|
||||
from,
|
||||
args: ["Vested CEC", "veCEC", secondsPerYear, esCEC.address, ZeroAddress, cec, ZeroAddress, false],
|
||||
log: true,
|
||||
});
|
||||
|
||||
console.log("==Vester addr=", vester.address);
|
||||
updateArray({
|
||||
name: "vester",
|
||||
type: "logic",
|
||||
json: "assets/contracts/Vester.json",
|
||||
address: vester.address,
|
||||
network: hre.network.name,
|
||||
});
|
||||
|
||||
|
||||
const rewardRouter = await hre.deployments.deploy("RewardRouter", {
|
||||
from,
|
||||
args: [cec,
|
||||
esCEC.address,
|
||||
stakedCecTracker.address,
|
||||
vester.address,],
|
||||
log: true,
|
||||
});
|
||||
console.log("==RewardRouter addr=", rewardRouter.address);
|
||||
updateArray({
|
||||
name: "rewardRouter",
|
||||
type: "logic",
|
||||
json: "assets/contracts/RewardRouter.json",
|
||||
address: rewardRouter.address,
|
||||
network: hre.network.name,
|
||||
});
|
||||
|
||||
const stakedCecTrackerContract = await hre.ethers.getContractAt("RewardTracker", stakedCecTracker.address);
|
||||
const stakedCecDistributorContract = await hre.ethers.getContractAt("RewardDistributor", stakedCecDistributor.address);
|
||||
const esCECContract = await hre.ethers.getContractAt("EsToken", esCEC.address);
|
||||
|
||||
await stakedCecTrackerContract.initialize([cec, esCEC.address], stakedCecDistributor.address);
|
||||
|
||||
await stakedCecTrackerContract.setInPrivateTransferMode(true)
|
||||
|
||||
await stakedCecTrackerContract.setInPrivateStakingMode(true)
|
||||
|
||||
await stakedCecDistributorContract.updateLastDistributionTime();
|
||||
|
||||
await stakedCecDistributorContract.setTokensPerInterval(rewardPerSecond);
|
||||
|
||||
await stakedCecTrackerContract.setHandler(rewardRouter.address, true)
|
||||
// 为了能调用burn方法
|
||||
await esCECContract.setMinter(vester.address, true)
|
||||
// 设定esCEC不能公开转账
|
||||
await esCECContract.setInPrivateTransferMode(true)
|
||||
// 添加转账白名单
|
||||
await esCECContract.setHandler(stakedCecTracker.address, true)
|
||||
};
|
||||
|
||||
deployNFTClaim.tags = ["Staking"];
|
||||
|
||||
export default deployNFTClaim;
|
646
deployments/bsc_test/EsToken.json
Normal file
646
deployments/bsc_test/EsToken.json
Normal file
File diff suppressed because one or more lines are too long
338
deployments/bsc_test/RewardDistributor.json
Normal file
338
deployments/bsc_test/RewardDistributor.json
Normal file
File diff suppressed because one or more lines are too long
413
deployments/bsc_test/RewardRouter.json
Normal file
413
deployments/bsc_test/RewardRouter.json
Normal file
File diff suppressed because one or more lines are too long
1198
deployments/bsc_test/RewardTracker.json
Normal file
1198
deployments/bsc_test/RewardTracker.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1207
deployments/bsc_test/Vester.json
Normal file
1207
deployments/bsc_test/Vester.json
Normal file
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
File diff suppressed because one or more lines are too long
@ -28,5 +28,41 @@
|
||||
"type": "logic",
|
||||
"json": "assets/contracts/TokenClaim.json",
|
||||
"address": "0xC95bDFAaFBf79b435e4d2bF8d77842fc19e6fE56"
|
||||
},
|
||||
{
|
||||
"name": "rewardTracker",
|
||||
"type": "logic",
|
||||
"json": "assets/contracts/RewardTracker.json",
|
||||
"address": "0x5aB49C4b7e21e35fD4fd05affB019320a95cb03D"
|
||||
},
|
||||
{
|
||||
"name": "esCEC",
|
||||
"type": "erc20",
|
||||
"json": "assets/contracts/EsToken.json",
|
||||
"address": "0x68Db28B700B2AC2A5034A5c8bD70c1Ffc3E587DD"
|
||||
},
|
||||
{
|
||||
"name": "stakedCecTracker",
|
||||
"type": "logic",
|
||||
"json": "assets/contracts/RewardTracker.json",
|
||||
"address": "0xC28165d2db25De1B258Db835d3557Dee044b1C3a"
|
||||
},
|
||||
{
|
||||
"name": "stakedCecDistributor",
|
||||
"type": "logic",
|
||||
"json": "assets/contracts/RewardDistributor.json",
|
||||
"address": "0x96d38E8e6470871F756F1a2e9dF614BCebd57AE8"
|
||||
},
|
||||
{
|
||||
"name": "vester",
|
||||
"type": "logic",
|
||||
"json": "assets/contracts/Vester.json",
|
||||
"address": "0x10F883D6e26fBb56Ab20466502BFD9017a1ea144"
|
||||
},
|
||||
{
|
||||
"name": "rewardRouter",
|
||||
"type": "logic",
|
||||
"json": "assets/contracts/RewardRouter.json",
|
||||
"address": "0x932956063849FceE07d60D9daee94eC0651810bc"
|
||||
}
|
||||
]
|
@ -18,6 +18,7 @@
|
||||
"deploy:airdrop": "hardhat deploy --tags AirdropToken --network imtbl_test --reset",
|
||||
"deploy:tokenclaim": "hardhat deploy --tags TokenClaim --network bsc_test --reset",
|
||||
"deploy:gameitemmall": "hardhat deploy --tags GameItemMall --network imtbl_test --reset",
|
||||
"deploy:staking": "hardhat deploy --tags Staking --network bsc_test --reset",
|
||||
"solhint": "solhint --config ./.solhint.json",
|
||||
"show_verify_list": "npx hardhat verify --list-networks",
|
||||
"convert-abi": "npx hardhat run scripts/convert-abi.js",
|
||||
|
Loading…
x
Reference in New Issue
Block a user