Skip to content

Commit

Permalink
add fee-collector deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Dec 20, 2024
1 parent 41b89e9 commit 2849d1a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions deploy/deploy-new-fee-collector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const hre = require('hardhat');
const { getChainId, ethers } = hre;

const FEE_COLLECTOR_FACTORY = {
1: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Mainnet
56: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // BSC
137: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Matic
42161: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Arbitrum
10: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Optimistic
43114: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Avalanche
100: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // xDAI
250: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // FTM
1313161554: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Aurora
8217: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Klaytn
8453: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Base
59144: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Linea
324: '0x0a479E2ac6d90e15d3c1Fae861b84260D7D4fadb', // zksync
31337: '0xD25c6f0293d41758552b0B27d6F69353a1134d51', // Hardhat
};

module.exports = async () => {
console.log('running deploy script');
const chainId = await getChainId();
console.log('network id ', chainId);

const salt = ethers.keccak256(ethers.toUtf8Bytes(''));

const feeCollectorFactory = await ethers.getContractAt('FeeCollectorFactory', FEE_COLLECTOR_FACTORY[chainId]);
await feeCollectorFactory.deployFeeCollector(salt);
console.log('FeeCollector deployed at', await feeCollectorFactory.getFeeCollectorAddress(salt));

if (await getChainId() !== '31337') {
await hre.run('verify:verify', {
address: await feeCollectorFactory.getFeeCollectorAddress(salt),
constructorArguments: [FEE_COLLECTOR_FACTORY[chainId], '0x'],
});
}
};

module.exports.skip = async () => true;

0 comments on commit 2849d1a

Please sign in to comment.