-
Notifications
You must be signed in to change notification settings - Fork 262
/
Copy pathsetup_router_fee.js
30 lines (25 loc) · 1.01 KB
/
setup_router_fee.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import deploymentAddresses from './deployment';
try {
(async () => {
console.log('Make sure 0x161b29D1919D4E06b53eE449376181B5082b30B9 is used and nonce is 6-7');
const Router = await ethers.getContractFactory('Router');
const chainIdHex = await hre.network.provider.request({ method: 'eth_chainId' });
const chainId = parseInt(chainIdHex.toString(), 16).toString();
const router = await Router.attach(deploymentAddresses.router[chainId]);
console.log(`Working with chainId ${chainId}`);
const feeSignerTx = await router.functions.setProtocolFeeSigner(
'0x1e126951a7CB895543E4E4c7B2D1398b3C3d09fC',
);
console.log(`Setting fee signer tx hash: ${feeSignerTx.hash}`);
const feeDefaultTx = await router.functions.setProtocolFeeDefault(
[
'8000000000000000',
deploymentAddresses.feeBeneficiaries[chainId],
],
);
console.log(`Setting fee defaults tx hash: ${feeDefaultTx.hash}`);
})();
} catch (error) {
console.error(error);
process.exit(1);
}