Skip to content

Commit

Permalink
[ecosystem claim] add abis (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-diamond authored Jul 24, 2024
1 parent 22b7719 commit ca9359c
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 1 deletion.
67 changes: 67 additions & 0 deletions src/contracts/abis/MerkleDistributorAbi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "address[]",
"name": "tokens",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
},
{
"internalType": "bytes32[]",
"name": "merkleProof",
"type": "bytes32[]"
}
],
"name": "claim",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "isClaimed",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
]
15 changes: 15 additions & 0 deletions src/contracts/abis/OraclesAbi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"inputs": [],
"name": "isMerkleRootVoting",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
]
4 changes: 4 additions & 0 deletions src/contracts/abis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import MintTokenControllerAbi from './MintTokenControllerAbi.json'
import DepositDataRegistryAbi from './DepositDataRegistryAbi.json'
import BlocklistVaultDiffAbi from './BlocklistVaultDiffAbi.json'
import RestakingVaultDiffAbi from './RestakingVaultDiffAbi.json'
import MerkleDistributorAbi from './MerkleDistributorAbi.json'
import MintTokenConfigV1Abi from './MintTokenConfigV1Abi.json'
import MintTokenConfigV2Abi from './MintTokenConfigV2Abi.json'
import PrivateVaultDiffAbi from './PrivateVaultDiffAbi.json'
Expand All @@ -20,6 +21,7 @@ import PriceOracleAbi from './PriceOracleAbi.json'
import UniswapPoolAbi from './UniswapPoolAbi.json'
import MulticallAbi from './MulticallAbi.json'
import UsdRateAbi from './UsdRateAbi.json'
import OraclesAbi from './OraclesAbi.json'
import KeeperAbi from './KeeperAbi.json'
import Erc20Abi from './Erc20Abi.json'
import InitialVaultAbi from './VaultAbi.json'
Expand All @@ -38,6 +40,7 @@ export {
VestingEscrowFactoryAbi,
MintTokenControllerAbi,
DepositDataRegistryAbi,
MerkleDistributorAbi,
MintTokenConfigV1Abi,
MintTokenConfigV2Abi,
OtherTokenVaultAbi,
Expand All @@ -53,6 +56,7 @@ export {
PriceOracleAbi,
UniswapPoolAbi,
MulticallAbi,
OraclesAbi,
UsdRateAbi,
KeeperAbi,
VaultAbi,
Expand Down
18 changes: 17 additions & 1 deletion src/contracts/createContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Erc20Abi,
VaultAbi,
KeeperAbi,
OraclesAbi,
UsdRateAbi,
MulticallAbi,
UniswapPoolAbi,
Expand All @@ -21,6 +22,7 @@ import {
OtherTokenVaultAbi,
MintTokenConfigV1Abi,
MintTokenConfigV2Abi,
MerkleDistributorAbi,
DepositDataRegistryAbi,
MintTokenControllerAbi,
VestingEscrowFactoryAbi,
Expand Down Expand Up @@ -116,6 +118,18 @@ const getDepositDataRegistry = (provider: Provider, config: StakeWise.Config) =>
provider
)

const getMerkleDistributor = (provider: Provider, config: StakeWise.Config) => createContract<StakeWise.ABI.MerkleDistributor>(
config.addresses.base.merkleDistributor,
MerkleDistributorAbi,
provider
)

const getOracles = (provider: Provider, config: StakeWise.Config) => createContract<StakeWise.ABI.Oracles>(
config.addresses.base.oracles,
OraclesAbi,
provider
)

type CreateContractsInput = {
provider: Provider
config: StakeWise.Config
Expand Down Expand Up @@ -145,12 +159,14 @@ export const createContracts = (input: CreateContractsInput) => {
},
base: {
keeper: getKeeper(provider, config),
oracles: getOracles(provider, config),
priceOracle: getPriceOracle(provider, config),
vaultsRegistry: getVaultsRegistry(provider, config),
mintTokenConfig: {
v1: getMintTokenConfigV1(provider, config),
v2: getMintTokenConfigV2(provider, config)
v2: getMintTokenConfigV2(provider, config),
},
merkleDistributor: getMerkleDistributor(provider, config),
depositDataRegistry: getDepositDataRegistry(provider, config),
mintTokenController: getMintTokenController(provider, config),
rewardSplitterFactory: getRewardSplitterFactory(provider, config),
Expand Down
4 changes: 4 additions & 0 deletions src/types/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {
VaultAbi as InitialVaultAbi,
Erc20Abi,
KeeperAbi,
OraclesAbi,
UsdRateAbi,
MulticallAbi,
PriceOracleAbi,
Expand All @@ -21,6 +22,7 @@ import type {
GnosisVaultDiffAbi,
OtherTokenVaultAbi,
PrivateVaultDiffAbi,
MerkleDistributorAbi,
MintTokenConfigV1Abi,
MintTokenConfigV2Abi,
RestakingVaultDiffAbi,
Expand Down Expand Up @@ -79,6 +81,7 @@ declare global {
namespace ABI {
type Vault = VaultAbi
type Keeper = KeeperAbi
type Oracles = OraclesAbi
type UsdRate = UsdRateAbi
type MintToken = Erc20Abi
type Erc20Token = Erc20Abi
Expand All @@ -92,6 +95,7 @@ declare global {
type RewardSplitter = RewardSplitterAbi
type VaultsRegistry = VaultsRegistryAbi
type OtherTokenVault = OtherTokenVaultAbi
type MerkleDistributor = MerkleDistributorAbi
type MintTokenConfigV1 = MintTokenConfigV1Abi
type MintTokenConfigV2 = MintTokenConfigV2Abi
type DepositDataRegistry = DepositDataRegistryAbi
Expand Down
2 changes: 2 additions & 0 deletions src/utils/configs/chiado.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ export default {
},
base: {
keeper: '0x5f31eD13eBF81B67a9f9498F3d1D2Da553058988',
oracles: ZeroAddress,
multicall: '0xcA11bde05977b3631167028862bE2a173976CA11',
priceOracle: '0x3CC131e6f6b975423151E5aaE8C466f4f81A8A4c',
vaultsRegistry: '0x8750594B33516232e751C8B9C350a660cD5f1BB8',
sharedMevEscrow: '0x453056f0bc4631abB15eEC656139f88067668E3E',
mintTokenConfigV1: ZeroAddress,
mintTokenConfigV2: '0x6D5957e075fd93b3B9F36Da93d7462F14387706d',
merkleDistributor: ZeroAddress,
depositDataRegistry: '0xFAce8504462AEb9BB6ae7Ecb206BD7B1EdF7956D',
mintTokenController: '0x5518052f2d898f062ee59964004A560F24E2eE7d',
rewardSplitterFactory: '0x6EE912596DCC3a8b7308164A65Af529a4276737C',
Expand Down
2 changes: 2 additions & 0 deletions src/utils/configs/gnosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ export default {
},
base: {
keeper: '0xcAC0e3E35d3BA271cd2aaBE688ac9DB1898C26aa',
oracles: '0xa6D123620Ea004cc5158b0ec260E934bd45C78c1',
multicall: '0xb5b692a88BDFc81ca69dcB1d924f59f0413A602a',
priceOracle: '0x9B1b13afA6a57e54C03AD0428a4766C39707D272',
vaultsRegistry: '0x7d014B3C6ee446563d4e0cB6fBD8C3D0419867cB',
sharedMevEscrow: '0x30db0d10d3774e78f8cB214b9e8B72D4B402488a',
mintTokenConfigV1: ZeroAddress,
mintTokenConfigV2: '0xd6672fbE1D28877db598DC0ac2559A15745FC3ec',
merkleDistributor: '0x7dc30953CE236665d032329F6a922d67F0a33a2B',
depositDataRegistry: '0x58e16621B5c0786D6667D2d54E28A20940269E16',
mintTokenController: '0x60B2053d7f2a0bBa70fe6CDd88FB47b579B9179a',
rewardSplitterFactory: '0x4c6306BA1821D88803e27A115433520F2d6276Fb',
Expand Down
2 changes: 2 additions & 0 deletions src/utils/configs/holesky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ export default {
},
base: {
keeper: '0xB580799Bf7d62721D1a523f0FDF2f5Ed7BA4e259',
oracles: ZeroAddress,
multicall: '0xcA11bde05977b3631167028862bE2a173976CA11',
priceOracle: '0xe31FAf135A6047Cbe595F91B4b6802cDB9B46E2b',
vaultsRegistry: '0xAa773c035Af95721C518eCd8250CadAC0AAB7ed0',
sharedMevEscrow: '0xc98F25BcAA6B812a07460f18da77AF8385be7b56',
mintTokenConfigV1: '0x4483965Ed85cd5e67f2a7a0EB462aCcC37b23D72',
mintTokenConfigV2: '0x124C33d07F94B31aDF87C12F7cA3a586d3510928',
merkleDistributor: ZeroAddress,
depositDataRegistry: '0xAC0F906E433d58FA868F936E8A43230473652885',
mintTokenController: '0x7BbC1733ee018f103A9a9052a18fA9273255Cf36',
rewardSplitterFactory: '0x2Ed24638b3aB48cF0076f19199c78A62bfEb5889',
Expand Down
2 changes: 2 additions & 0 deletions src/utils/configs/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ export default {
},
base: {
keeper: '0x6B5815467da09DaA7DC83Db21c9239d98Bb487b5',
oracles: '0x2f1C5E86B13a74f5A6E7B4b35DD77fe29Aa47514',
multicall: '0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441',
priceOracle: '0x8023518b2192FB5384DAdc596765B3dD1cdFe471',
vaultsRegistry: '0x3a0008a588772446f6e656133C2D5029CC4FC20E',
sharedMevEscrow: '0x48319f97E5Da1233c21c48b80097c0FB7a20Ff86',
mintTokenConfigV1: '0xE8822246F8864DA92015813A39ae776087Fb1Cd5',
mintTokenConfigV2: '0x287d1e2A8dE183A8bf8f2b09Fa1340fBd766eb59',
merkleDistributor: '0xA3F21010e8b9a3930996C8849Df38f9Ca3647c20',
depositDataRegistry: ZeroAddress,
mintTokenController: '0x2A261e60FB14586B474C208b1B7AC6D0f5000306',
rewardSplitterFactory: '0x90a9428b8c58cA80B28aAF46B936D42e87797449',
Expand Down

0 comments on commit ca9359c

Please sign in to comment.