diff --git a/.env.example b/.env.example index 958487e..259f6f2 100644 --- a/.env.example +++ b/.env.example @@ -15,7 +15,7 @@ # DEPLOYER_PRIVATE_KEY="" -# ETH_NODE_URI_MODE=https://mainnet.mode.network/ +# ETH_NODE_URI_MODE= # ETHERSCAN_API_KEY_MODE="" # MODE_ETHERSCAN_API_KEY="" diff --git a/contracts/tokenWrappers/RadiantTokenWrapper.sol b/contracts/tokenWrappers/RadiantTokenWrapper.sol index 7a96b06..5f2c0e6 100644 --- a/contracts/tokenWrappers/RadiantTokenWrapper.sol +++ b/contracts/tokenWrappers/RadiantTokenWrapper.sol @@ -10,7 +10,7 @@ import { BaseMerklTokenWrapper } from "./BaseTokenWrapper.sol"; interface IVesting { function rdntToken() external view returns (address); - function vestTokens(address, uint256, bool) external returns (address); + function vestTokens(address, uint256, bool) external; } /// @title Radiant MTW diff --git a/scripts/buildDisputeResolution.ts b/scripts/buildDisputeResolution.ts new file mode 100644 index 0000000..10bd96c --- /dev/null +++ b/scripts/buildDisputeResolution.ts @@ -0,0 +1,50 @@ +import { deployments, ethers } from 'hardhat'; + +import { DistributionCreator, DistributionCreator__factory, Distributor, Distributor__factory } from '../typechain'; +import { parseEther, parseUnits, getAddress } from 'ethers/lib/utils'; +import { registry } from '@angleprotocol/sdk'; +import { BigNumber } from 'ethers'; +import { BASE_PARAMS } from '../test/hardhat/utils/helpers'; +import fs from 'fs'; + +async function main() { + let distributionCreator: DistributionCreator; + let distributor: Distributor; + const { deployer } = await ethers.getNamedSigners(); + const chainId = (await deployer.provider?.getNetwork())?.chainId; + console.log('chainId', chainId); + const distributionCreatorAddress = registry(chainId as unknown as number)?.Merkl?.DistributionCreator; // (await deployments.get('DistributionCreator')).address; + const distributorAddress = registry(chainId as unknown as number)?.Merkl?.Distributor; // (await deployments.get('DistributionCreator')).address; + + if (!distributionCreatorAddress) { + throw new Error('Distribution Creator address not found'); + } + if (!distributorAddress) { + throw new Error('Distributor address not found'); + } + + distributionCreator = new ethers.Contract( + distributionCreatorAddress, + DistributionCreator__factory.createInterface(), + deployer, + ) as DistributionCreator; + + distributor = new ethers.Contract( + distributorAddress, + Distributor__factory.createInterface(), + deployer, + ) as Distributor; + + const disputeToken = await distributor.disputeToken() + const disputer = await distributor.disputer() + + fs.writeFileSync( + `${(await deployer?.provider?.getNetwork())?.name}_dispute.json`, + `{"version":"1.0","chainId":"${chainId}","createdAt":1693483753967,"meta":{"name":"Transactions Batch","description":"","txBuilderVersion":"1.16.2","createdFromSafeAddress":"0xe4BB74804edf5280c9203f034036f7CB15196078","createdFromOwnerAddress":"","checksum":"0xb9377def98483d3d19bd3e1f34d7e2ca1055a92ed09d35bd90bb4892f60c2d2e"},"transactions":[{"to":"0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae","value":"0","data":null,"contractMethod":{"inputs":[{"internalType":"bool","name":"valid","type":"bool"}],"name":"resolveDispute","payable":false},"contractInputsValues":{"valid":"false"}},{"to":"${disputeToken}","value":"0","data":null,"contractMethod":{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","payable":false},"contractInputsValues":{"to":"${disputer}","amount":"100000000000000000000"}}]}`, + ); +} + +main().catch(error => { + console.error(error); + process.exit(1); +}); diff --git a/scripts/set0Fee.ts b/scripts/set0Fee.ts new file mode 100644 index 0000000..402b324 --- /dev/null +++ b/scripts/set0Fee.ts @@ -0,0 +1,40 @@ +import { deployments, ethers } from 'hardhat'; + +import { DistributionCreator, DistributionCreator__factory } from '../typechain'; +import { parseEther,parseUnits, getAddress } from 'ethers/lib/utils'; +import { registry } from '@angleprotocol/sdk'; +import { BigNumber } from 'ethers'; +import { BASE_PARAMS } from '../test/hardhat/utils/helpers'; + +const USER = '0xFC85C07C3e0D497d97F287a70C6b2fA5CD5fdBE0'; + +async function main() { + let manager: DistributionCreator; + const { deployer } = await ethers.getNamedSigners(); + const chainId = (await deployer.provider?.getNetwork())?.chainId; + console.log('chainId', chainId) + const distributionCreator = registry(chainId as unknown as number)?.Merkl?.DistributionCreator // (await deployments.get('DistributionCreator')).address; + + if (!distributionCreator) { + throw new Error('Distribution Creator address not found'); + } + + manager = new ethers.Contract( + distributionCreator, + DistributionCreator__factory.createInterface(), + deployer, + ) as DistributionCreator; + + const res = await ( + await manager + .connect(deployer) + .setUserFeeRebate(getAddress(USER), BigNumber.from(BASE_PARAMS)) + ).wait(); + + console.log(res); +} + +main().catch(error => { + console.error(error); + process.exit(1); +});