Allowlist
Last updated
Was this helpful?
Last updated
Was this helpful?
This contract is a registry holding information about how much each swap contract should contain upto. Swap.sol will rely on this contract to determine whether the pool cap is reached and also whether a user's deposit limit is reached.
constructor(bytes32 merkleRoot_)
Creates this contract and sets the PoolCap of 0x0 with uint256(0x54dd1e) for crude checking whether an address holds this contract.
merkleRoot_
: bytes32 that represent a merkle root node. This is generated off chain with the list of qualifying addresses.
getPoolAccountLimit(address poolAddress) → uint256
Returns the max mintable amount of the lp token per account in given pool address.
poolAddress
: address of the pool
max mintable amount of the lp token per account
getPoolCap(address poolAddress) → uint256
Returns the maximum total supply of the pool token for the given pool address.
poolAddress
: address of the pool
isAccountVerified(address account) → bool
Returns true if the given account's existence has been verified against any of the past or the present merkle tree. Note that if it has been verified in the past, this function will return true even if the current merkle tree does not contain the account.
account
: the address to check if it has been verified
a boolean value representing whether the account has been verified in the past or the present merkle tree
verifyAddress(address account, bytes32[] merkleProof) → bool
Checks the existence of keccak256(account) as a node in the merkle tree inferred by the merkle root node stored in this contract. Pools should use this function to check if the given address qualifies for depositing. If the given account has already been verified with the correct merkleProof, this function will return true when merkleProof is empty. The verified status will be overwritten if the previously verified user calls this function with an incorrect merkleProof.
account
: address to confirm its existence in the merkle tree
merkleProof
: data that is used to prove the existence of given parameters. This is generated during the creation of the merkle tree. Users should retrieve this data off-chain.
a boolean value that corresponds to whether the address with the proof has been verified in the past or if they exist in the current merkle tree.
setPoolAccountLimit(address poolAddress, uint256 accountLimit)
Sets the account limit of allowed deposit amounts for the given pool
poolAddress
: address of the pool
accountLimit
: the max number of the pool token a single user can mint
setPoolCap(address poolAddress, uint256 poolCap)
Sets the max total supply of LPToken for the given pool address
poolAddress
: address of the pool
poolCap
: the max total supply of the pool token
updateMerkleRoot(bytes32 merkleRoot_)
Updates the merkle root that is stored in this contract. This can only be called by the owner. If more addresses are added to the list, a new merkle tree and a merkle root node should be generated, and merkleRoot should be updated accordingly.
merkleRoot_
: a new merkle root node that contains a list of deposit allowed addresses
PoolCap(address poolAddress, uint256 poolCap)
No description
PoolAccountLimit(address poolAddress, uint256 accountLimit)
No description
NewMerkleRoot(bytes32 merkleRoot)
No description