Skip to content

Commit

Permalink
feat(cfg): usdc, treasury
Browse files Browse the repository at this point in the history
  • Loading branch information
softwareultron committed Nov 14, 2024
1 parent b0c300d commit 9ca7264
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 49 deletions.
23 changes: 17 additions & 6 deletions deploy/changeFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ task("fee-ultron", "Changing fee for ultron tokens")
// new Token("DAI", "0x045F0f2DE758743c84b756B1Fca735a0dDf0b8f4"),
// new Token("LINK", "0xc8Fb7999d62072E12fE8f3EDcd7821204FCa0344"),
new Token("uUSDT", "0x97FDd294024f50c388e39e73F1705a35cfE87656"),
// new Token("uUSDC", "0x3c4E0FdeD74876295Ca36F62da289F69E3929cc4"),
new Token("uUSDC", "0x3c4E0FdeD74876295Ca36F62da289F69E3929cc4"),

// new Token("bep_uUSDT", "0xB8160f15D44604E892Ac52eC4CCBfDA3cafbFDbd"),
// new Token("bep_uUSDC", "0x06d522b2118d535978382d9533a68B0b110f9BC2"),
Expand Down Expand Up @@ -284,6 +284,9 @@ task("fee-ultron", "Changing fee for ultron tokens")
// await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "uUSDC"), fantomDomainId, Helpers.parseDecimals(1.9, 6), Helpers.parseDecimals(12, 6), Helpers.parseDecimals(2000000, 6));
// await Helpers.delay(4000);

// await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "uUSDC"), baseDomainId, Helpers.parseDecimals(0.9, 6), Helpers.parseDecimals(12, 6), Helpers.parseDecimals(2000000, 6));
// await Helpers.delay(4000);

// // DOGE
// await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "DOGE"), domainId, Helpers.parseDecimals(2.32, 8), Helpers.parseDecimals(120, 8), Helpers.parseDecimals(500000000, 8));
// await Helpers.delay(4000);
Expand Down Expand Up @@ -1516,6 +1519,7 @@ task("fee-base", "Changing fee for base tokens")
new Token("ULX", "0x598E5dBC2f6513E6cb1bA253b255A5b73A2a720b"),
new Token("USDT", "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"),
new Token("AK1111", "0x54b659832f59c24ceC0E4A2Cd193377F1BCEfc3c"),
new Token("USDC", "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
];

const iterator = +(await DAO.getChangeFeeRequestCount()) + 1;
Expand All @@ -1541,12 +1545,19 @@ task("fee-base", "Changing fee for base tokens")
// await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "USDT"), ultronDomainId, Helpers.parseDecimals(0.9, 6), Helpers.parseDecimals(12, 6), Helpers.parseDecimals(2000000, 6));
// await Helpers.delay(8000);

// AK1111
await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "AK1111"), domainId, Helpers.parseDecimals(2, 18), Helpers.parseDecimals(5, 18), Helpers.parseDecimals(50000000, 18));
await Helpers.delay(4000);
// // AK1111
// await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "AK1111"), domainId, Helpers.parseDecimals(2, 18), Helpers.parseDecimals(5, 18), Helpers.parseDecimals(50000000, 18));
// await Helpers.delay(4000);

await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "AK1111"), ultronDomainId, Helpers.parseDecimals(2, 18), Helpers.parseDecimals(5, 18), Helpers.parseDecimals(50000000, 18));
await Helpers.delay(4000);
// await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "AK1111"), ultronDomainId, Helpers.parseDecimals(2, 18), Helpers.parseDecimals(5, 18), Helpers.parseDecimals(50000000, 18));
// await Helpers.delay(4000);

// // USDC
// await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "USDC"), domainId, Helpers.parseDecimals(0.9, 6), Helpers.parseDecimals(12, 6), Helpers.parseDecimals(2000000, 6));
// await Helpers.delay(8000);

// await DAO.newChangeFeeRequest(Helpers.findToken(tokenAddresses, "USDC"), ultronDomainId, Helpers.parseDecimals(0.9, 6), Helpers.parseDecimals(12, 6), Helpers.parseDecimals(2000000, 6));
// await Helpers.delay(8000);

// for(let i:number = iterator; i <= (await DAO.getChangeFeeRequestCount()); i++) {
// await bridge.adminChangeFee(i);
Expand Down
101 changes: 68 additions & 33 deletions deploy/changeTreasury.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ task("treasury-ultron", "Sets treasury for ultron")
const DAO = await ethers.getContractAt("DAO", daoAddress, signer);
const erc20Handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);

const treasuryAddress = "0x2c9bd37460430538F52263054261AB5081364497"

const treasuryAddress = "0xf0c623A9cE01Bace0984e2B24E8A4DB2A799D6e6"
console.log(await erc20Handler.getTreasuryAddress())

console.info(await DAO.getSetTreasuryRequestCount());
await DAO.newSetTreasuryRequest(treasuryAddress);
await Helpers.delay(4000);

let iterator = +(await DAO.getSetTreasuryRequestCount());
console.info(iterator);
await erc20Handler.setTreasuryAddress(iterator);
// let iterator = +(await DAO.getSetTreasuryRequestCount());
// console.info(iterator);
// await erc20Handler.setTreasuryAddress(iterator);
});

task("treasury-ethereum", "Sets treasury for ethereum")
Expand All @@ -50,16 +51,17 @@ task("treasury-ethereum", "Sets treasury for ethereum")
const DAO = await ethers.getContractAt("DAO", daoAddress, signer);
const erc20Handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);

const treasuryAddress = "0x2c9bd37460430538F52263054261AB5081364497"
const treasuryAddress = "0xf0c623A9cE01Bace0984e2B24E8A4DB2A799D6e6"
console.log(await erc20Handler.getTreasuryAddress())

console.info(await DAO.getSetTreasuryRequestCount());
await DAO.newSetTreasuryRequest(treasuryAddress);
await Helpers.delay(4000);

const iterator = +(await DAO.getSetTreasuryRequestCount());
console.info(iterator);
await erc20Handler.setTreasuryAddress(iterator);
await Helpers.delay(4000);
// const iterator = +(await DAO.getSetTreasuryRequestCount());
// console.info(iterator);
// await erc20Handler.setTreasuryAddress(iterator);
// await Helpers.delay(4000);
});

task("treasury-bsc", "Sets treasury for bsc")
Expand All @@ -78,16 +80,17 @@ task("treasury-bsc", "Sets treasury for bsc")
const DAO = await ethers.getContractAt("DAO", daoAddress, signer);
const erc20Handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);

const treasuryAddress = "0x2c9bd37460430538F52263054261AB5081364497"

const treasuryAddress = "0xf0c623A9cE01Bace0984e2B24E8A4DB2A799D6e6"
console.log(await erc20Handler.getTreasuryAddress())

console.info(await DAO.getSetTreasuryRequestCount());
await DAO.newSetTreasuryRequest(treasuryAddress);
await Helpers.delay(8000);

const iterator = +(await DAO.getSetTreasuryRequestCount());
console.info(iterator);
await erc20Handler.setTreasuryAddress(iterator);
await Helpers.delay(8000);
// const iterator = +(await DAO.getSetTreasuryRequestCount());
// console.info(iterator);
// await erc20Handler.setTreasuryAddress(iterator);
// await Helpers.delay(8000);
});

task("treasury-avalanche", "Sets treasury for avalanche")
Expand All @@ -106,16 +109,17 @@ task("treasury-avalanche", "Sets treasury for avalanche")
const DAO = await ethers.getContractAt("DAO", daoAddress, signer);
const erc20Handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);

const treasuryAddress = "0x2c9bd37460430538F52263054261AB5081364497"

const treasuryAddress = "0xf0c623A9cE01Bace0984e2B24E8A4DB2A799D6e6"
console.log(await erc20Handler.getTreasuryAddress())

console.info(await DAO.getSetTreasuryRequestCount());
await DAO.newSetTreasuryRequest(treasuryAddress);
await Helpers.delay(4000);

const iterator = +(await DAO.getSetTreasuryRequestCount());
console.info(iterator);
await erc20Handler.setTreasuryAddress(iterator);
await Helpers.delay(4000);
// const iterator = +(await DAO.getSetTreasuryRequestCount());
// console.info(iterator);
// await erc20Handler.setTreasuryAddress(iterator);
// await Helpers.delay(4000);
});

task("treasury-polygon", "Sets treasury for polygon")
Expand All @@ -134,16 +138,17 @@ task("treasury-polygon", "Sets treasury for polygon")
const DAO = await ethers.getContractAt("DAO", daoAddress, signer);
const erc20Handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);

const treasuryAddress = "0x2c9bd37460430538F52263054261AB5081364497"

const treasuryAddress = "0xf0c623A9cE01Bace0984e2B24E8A4DB2A799D6e6"
console.log(await erc20Handler.getTreasuryAddress())

console.info(await DAO.getSetTreasuryRequestCount());
await DAO.newSetTreasuryRequest(treasuryAddress);
await Helpers.delay(4000);

const iterator = +(await DAO.getSetTreasuryRequestCount());
console.info(iterator);
await erc20Handler.setTreasuryAddress(iterator);
await Helpers.delay(4000);
// const iterator = +(await DAO.getSetTreasuryRequestCount());
// console.info(iterator);
// await erc20Handler.setTreasuryAddress(iterator);
// await Helpers.delay(4000);
});

task("treasury-fantom", "Sets treasury for fantom")
Expand All @@ -162,14 +167,44 @@ task("treasury-fantom", "Sets treasury for fantom")
const DAO = await ethers.getContractAt("DAO", daoAddress, signer);
const erc20Handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);

const treasuryAddress = "0x2c9bd37460430538F52263054261AB5081364497"

const treasuryAddress = "0xf0c623A9cE01Bace0984e2B24E8A4DB2A799D6e6"
console.log(await erc20Handler.getTreasuryAddress())

console.info(await DAO.getSetTreasuryRequestCount());
await DAO.newSetTreasuryRequest(treasuryAddress);
await Helpers.delay(4000);

const iterator = +(await DAO.getSetTreasuryRequestCount());
console.info(iterator);
await erc20Handler.setTreasuryAddress(iterator);
// const iterator = +(await DAO.getSetTreasuryRequestCount());
// console.info(iterator);
// await erc20Handler.setTreasuryAddress(iterator);
// await Helpers.delay(4000);
});

task("treasury-base", "Sets treasury for base")
.setAction(async (_, { ethers, network }) => {
if(network.name != "base") {
console.error("Should be base network!");
return;
}
const signer = (await ethers.getSigners())[0];

const bridgeAddress = "0x6Ab2A602d1018987Cdcb29aE6fB6E3Ebe44b1412";
const daoAddress = "0x9DcD76b4A7357249d6160D456670bAcC53292e27";
const erc20HandlerAddress = "0xFe21Dd0eC80e744A473770827E1aD6393A5A94F0";

const bridge = await ethers.getContractAt("Bridge", bridgeAddress, signer);
const DAO = await ethers.getContractAt("DAO", daoAddress, signer);
const erc20Handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);

const treasuryAddress = "0xf0c623A9cE01Bace0984e2B24E8A4DB2A799D6e6"
console.log(await erc20Handler.getTreasuryAddress())

console.info(await DAO.getSetTreasuryRequestCount());
await DAO.newSetTreasuryRequest(treasuryAddress);
await Helpers.delay(4000);

// const iterator = +(await DAO.getSetTreasuryRequestCount());
// console.info(iterator);
// await erc20Handler.setTreasuryAddress(iterator);
// await Helpers.delay(4000);
});
2 changes: 1 addition & 1 deletion deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ subtask("ERC20Handler", "contract ERC20Handler is deployed")
.setAction(async (taskArgs, { ethers }) => {
const signer = (await ethers.getSigners())[0];

const treasuryAddress = "0x976B649bacA4CB2af970e091B45d862965520276";
const treasuryAddress = "0xf0c623A9cE01Bace0984e2B24E8A4DB2A799D6e6";

const ERC20HandlerFactory = await ethers.getContractFactory("ERC20Handler", signer);
const ERC20Handler = await (await ERC20HandlerFactory.deploy(taskArgs.bridge, treasuryAddress)).deployed();
Expand Down
20 changes: 11 additions & 9 deletions deploy/setResourceIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,12 +794,14 @@ task("set-resource-ids-burnable-base", "Setting resource Ids for tokens")
new Token("ULX", "0x598E5dBC2f6513E6cb1bA253b255A5b73A2a720b"),
new Token("USDT", "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"),
new Token("AK1111", "0x54b659832f59c24ceC0E4A2Cd193377F1BCEfc3c"),
new Token("USDC", "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
];

const resourceIds = [
new TokenResourceId("ULX", "0x00000000000000000000003a4F06431457de873B588846d139EC0d86275d5401"),
new TokenResourceId("USDT", "0x0000000000000000000000b7fe74c0c957534400d2ff0612d3f59af79eba4901"),
new TokenResourceId("AK1111", "0x000000000000000000000052b502e0c7986A3c705DCf411E768e5cE90c87ec01"),
new TokenResourceId("USDC", "0x0000000000000000000000026d9a638b8981ed47aa1580f79533cea7c1fc4801"),
];

// for(let i:number = 1; i <= tokenAddresses.length; i++) {
Expand All @@ -810,16 +812,16 @@ task("set-resource-ids-burnable-base", "Setting resource Ids for tokens")
// console.info(`${tokenAddresses[i - 1].tokenName} ${await token.hasRole(role, erc20HandlerAddress)}`);
// }

const handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);
for(let i:number = 1; i <= tokenAddresses.length; i++) {
let tokenAddress = await handler._resourceIDToTokenContractAddress(resourceIds[i - 1].resourceId);
console.info(`${tokenAddresses[i - 1].tokenName} - ${tokenAddress.toLowerCase() == tokenAddresses[i - 1].tokenAddress.toLowerCase()}`);
}
// const handler = await ethers.getContractAt("ERC20Handler", erc20HandlerAddress, signer);
// for(let i:number = 1; i <= tokenAddresses.length; i++) {
// let tokenAddress = await handler._resourceIDToTokenContractAddress(resourceIds[i - 1].resourceId);
// console.info(`${tokenAddresses[i - 1].tokenName} - ${tokenAddress.toLowerCase() == tokenAddresses[i - 1].tokenAddress.toLowerCase()}`);
// }

for(let i:number = 1; i <= tokenAddresses.length; i++) {
let isBurnable = await handler._burnList(tokenAddresses[i - 1].tokenAddress);
console.info(`Burnable ${tokenAddresses[i - 1].tokenName} - ${isBurnable}`);
}
// for(let i:number = 1; i <= tokenAddresses.length; i++) {
// let isBurnable = await handler._burnList(tokenAddresses[i - 1].tokenAddress);
// console.info(`Burnable ${tokenAddresses[i - 1].tokenName} - ${isBurnable}`);
// }

const iteratorResource = +(await DAO.getSetResourceRequestCount());
console.info(iteratorResource);
Expand Down

0 comments on commit 9ca7264

Please sign in to comment.