Skip to content

Commit

Permalink
feat: checks on top
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec committed Jan 31, 2024
1 parent ebca692 commit 8a0a3b8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion contracts/Distributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct Claim {
}

/// @title Distributor
/// @notice Allows LPs on AMMs with concentrated liquidity to claim the rewards that were distributed to them
/// @notice Allows to claim rewards distributed to them through Merkl
/// @author Angle Labs. Inc
contract Distributor is UUPSHelper {
using SafeERC20 for IERC20;
Expand Down
2 changes: 1 addition & 1 deletion contracts/deprecated/OldDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct Claim {
/// @title Distributor
/// @notice Allows LPs on AMMs with concentrated liquidity to claim the rewards that were distributed to them
/// @author Angle Labs. Inc
contract Distributor is UUPSHelper {
contract OldDistributor is UUPSHelper {
using SafeERC20 for IERC20;

/// @notice Epoch duration
Expand Down
8 changes: 4 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ const config: HardhatUserConfig = {
hardfork: 'london',
forking: {
enabled: argv.fork || false,
/*
// Mainnet
url: nodeUrl('fork'),
blockNumber: 16671190,
*/
blockNumber: 19127150,
// Polygon
/*
url: nodeUrl('forkpolygon'),
Expand All @@ -116,8 +114,10 @@ const config: HardhatUserConfig = {
url: nodeUrl('polygonzkevm'),
blockNumber: 3214816,
*/
/*
url: nodeUrl('linea'),
// blockNumber: 14188687,
blockNumber: 14188687,
*/
},
mining: argv.disableAutoMining
? {
Expand Down
35 changes: 19 additions & 16 deletions scripts/mainnet-fork/upgradeDistributionCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@ import { deployUpgradeableUUPS, increaseTime, ZERO_ADDRESS } from '../../test/ha
import {
DistributionCreator,
DistributionCreator__factory,
Distributor,
Distributor__factory,
ERC20,
ERC20__factory,
MockMerklGaugeMiddleman,
MockMerklGaugeMiddleman__factory,
ProxyAdmin,
ProxyAdmin__factory,
} from '../../typechain';
import { formatAmount, parseAmount } from '../../utils/bignumber';

const argv = yargs.env('').boolean('ci').parseSync();

async function main() {
let manager: DistributionCreator;
let middleman: MockMerklGaugeMiddleman;
let angle: ERC20;
let distributor: Distributor;
let params: any;

const { deploy } = deployments;
Expand All @@ -35,30 +31,37 @@ async function main() {
await network.provider.send('hardhat_setBalance', [governor, '0x10000000000000000000000000000']);
const governorSigner = await ethers.provider.getSigner(governor);

const distributorAddress = registry(ChainId.MAINNET)?.Merkl?.DistributionCreator!;
const distributionAddress = registry(ChainId.MAINNET)?.Merkl?.DistributionCreator!;
const distributorAddress = registry(ChainId.MAINNET)?.Merkl?.Distributor!;

manager = new ethers.Contract(
distributorAddress,
distributionAddress,
DistributionCreator__factory.createInterface(),
governorSigner,
) as DistributionCreator;

distributor = new ethers.Contract(
distributorAddress,
Distributor__factory.createInterface(),
governorSigner,
) as Distributor;

const newImplementation = await new DistributionCreator__factory(deployer).deploy();
await manager.connect(governorSigner).upgradeTo(newImplementation.address);

console.log(await manager.core());
console.log(await manager.distributor());
console.log(await manager.feeRecipient());
console.log(await manager.defaultFees());
console.log((await manager.defaultFees()).toString());
console.log(await manager.message());
console.log(await manager.distributionList(10));
console.log(await manager.feeRebate(governor));
console.log(await manager.isWhitelistedToken(registry(ChainId.MAINNET)?.agEUR?.AgToken!));
console.log(await manager._nonces('0xfda462548ce04282f4b6d6619823a7c64fdc0185'));
console.log(await manager.userSignatureWhitelist('0xfda462548ce04282f4b6d6619823a7c64fdc0185'));
console.log((await manager.feeRebate(governor)).toString());
console.log((await manager.isWhitelistedToken(registry(ChainId.MAINNET)?.agEUR?.AgToken!)).toString());
console.log((await manager._nonces('0xfda462548ce04282f4b6d6619823a7c64fdc0185')).toString());
console.log((await manager.userSignatureWhitelist('0xfda462548ce04282f4b6d6619823a7c64fdc0185')).toString());
console.log(await manager.rewardTokens(0));
console.log(await manager.campaignList(0));
console.log(await manager.campaignSpecificFees(0));
// console.log(await manager.campaignList(0));
console.log((await manager.campaignSpecificFees(0)).toString());
}

main().catch(error => {
Expand Down

0 comments on commit 8a0a3b8

Please sign in to comment.