Skip to content

Commit

Permalink
fix: setFeeRebate
Browse files Browse the repository at this point in the history
  • Loading branch information
Picodes committed May 3, 2024
1 parent 33a7e24 commit 5addf9e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 15 deletions.
3 changes: 3 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,14 @@ const config: HardhatUserConfig = {
gas: 'auto',
gasMultiplier: 1.3,
chainId: 324,
ethNetwork: nodeUrl('mainnet'),
verifyURL: 'https://zksync2-mainnet-explorer.zksync.io/contract_verification',
verify: {
etherscan: {
apiKey: etherscanKey('zksync'),
},
},
zksync: true,
},
mantle: {
live: true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"deploy:fork": "FORK=true hardhat node --tags distributionCreator",
"deploy:agla": "hardhat deploy --tags aglaMerkl --network",
"deploy": "hardhat deploy --tags mtw --network",
"hardhat etherscan-verify --network",
"etherscan": "hardhat etherscan-verify --network",
"foundry:compile": "forge build --optimize --optimizer-runs 1000",
"foundry:coverage": "forge coverage --ir-minimum --report lcov && yarn lcov:clean && yarn lcov:generate-html",
"foundry:deploy": "forge script --broadcast --verify -vvvv",
Expand Down Expand Up @@ -45,7 +45,7 @@
"url": "https://github.com/AngleProtocol/merkl-contracts/issues"
},
"devDependencies": {
"@angleprotocol/sdk": "0.34.4",
"@angleprotocol/sdk": "2.0.0",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/providers": "^5.7.1",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
Expand Down
40 changes: 40 additions & 0 deletions scripts/setFeeRebate.ts
Original file line number Diff line number Diff line change
@@ -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 = '0xa535f2C53f530eB953299702A8851a07674fbe46';

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).div(3))
).wait();

console.log(res);
}

main().catch(error => {
console.error(error);
process.exit(1);
});
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==

"@angleprotocol/sdk@0.34.4":
version "0.34.4"
resolved "https://npm.pkg.github.com/download/@angleprotocol/sdk/0.34.4/423d2a54e1cd7c6116cd2b95825f4d1572f4a497#423d2a54e1cd7c6116cd2b95825f4d1572f4a497"
integrity sha512-iHsOQtdqj15qVbGJ8RtkHy6qAqLM6Bsm9FaPvf+msBSENaHcoIpQnzxl1pt+pUyF1YKyj0gxsev4NHF5lO0pcA==
"@angleprotocol/sdk@2.0.0":
version "2.0.0"
resolved "https://npm.pkg.github.com/download/@angleprotocol/sdk/2.0.0/ad9abe640e359f4411575f0e8ca4e20f52b1d51c#ad9abe640e359f4411575f0e8ca4e20f52b1d51c"
integrity sha512-RTDYV2EyoWFBgTPdFd6mMdrFT7PuC9gyMKkOXgnutCBdrW+S4h2kLsTQzxcjli8eIw9LqYO9HVNFPQNfJbmd4Q==
dependencies:
"@apollo/client" "^3.7.17"
"@typechain/ethers-v5" "^10.0.0"
Expand All @@ -23,7 +23,7 @@
lodash "^4.17.21"
merkletreejs "^0.3.10"
tiny-invariant "^1.1.0"
typechain "^8.0.0"
typechain "^8.3.2"

"@apollo/client@^3.7.17":
version "3.9.0"
Expand Down Expand Up @@ -10007,10 +10007,10 @@ type@^2.5.0:
resolved "https://registry.npmjs.org/type/-/type-2.6.0.tgz"
integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==

typechain@^8.0.0:
version "8.0.0"
resolved "https://registry.npmjs.org/typechain/-/typechain-8.0.0.tgz"
integrity sha512-rqDfDYc9voVAhmfVfAwzg3VYFvhvs5ck1X9T/iWkX745Cul4t+V/smjnyqrbDzWDbzD93xfld1epg7Y/uFAesQ==
typechain@^8.1.0:
version "8.1.0"
resolved "https://registry.npmjs.org/typechain/-/typechain-8.1.0.tgz"
integrity sha512-5jToLgKTjHdI1VKqs/K8BLYy42Sr3o8bV5ojh4MnR9ExHO83cyyUdw+7+vMJCpKXUiVUvARM4qmHTFuyaCMAZQ==
dependencies:
"@types/prettier" "^2.1.1"
debug "^4.3.1"
Expand All @@ -10023,10 +10023,10 @@ typechain@^8.0.0:
ts-command-line-args "^2.2.0"
ts-essentials "^7.0.1"

typechain@^8.1.0:
version "8.1.0"
resolved "https://registry.npmjs.org/typechain/-/typechain-8.1.0.tgz"
integrity sha512-5jToLgKTjHdI1VKqs/K8BLYy42Sr3o8bV5ojh4MnR9ExHO83cyyUdw+7+vMJCpKXUiVUvARM4qmHTFuyaCMAZQ==
typechain@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.3.2.tgz#1090dd8d9c57b6ef2aed3640a516bdbf01b00d73"
integrity sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==
dependencies:
"@types/prettier" "^2.1.1"
debug "^4.3.1"
Expand Down

0 comments on commit 5addf9e

Please sign in to comment.