- Oracles allowed to submit the data are set by the admin.
- The number of the required confirmatios is set by the admin.
- The contract holds the Links.
- The oracles receives the reward to their virtual balance after submission.
- The reward can be withdrawn any time.
- The admin can withdraw unalocated Links any time.
- The oracle's payment can be configured by the admin.
- The mint and burnt requests are confirmed only after requered amount of confirmations are received.
Scope: Test the configurations of the contract.
Action: Invoke the setMinConfirmations
, setPayment
, addOracle
, removeOracle
methods.
Verification Steps: Verify the operation only from authorized actors are permitted and the changes take effect.
Scenario 1: Update configs by:
- admin
- one without admin permissions
Scenario 2: Withdraw unalocated Links:
- admin
- one without admin permissions
Scope: Test the withdrawing rewards of the contract.
Action: Invoke the withdrawPayment
.
Verification Steps: Verify the operation only from authorized actors are permitted and the changes take effect.
Scenario 1: Withdraw by:
- admin
- one without admin permissions
Scenario 2: Withdraw amount:
- less then total reward
- higher then total reward
Scope: Test the oracles-related functions of the contract.
Action: Invoke the submit
, submit
methods.
Verification Steps: Verify the operation only from authorized actors are permitted and the changes take effect.
Scenario 1: Test call by:
- oracle
- one without oracle permissions
Scenario 2: Test confirmation:
- once
- twice
Scenario 3: Test number of confirmation by different oracles:
- 1 confirmations out of 3 (2 is required)
- 2 confirmations out of 3 (2 is required)
- 2 confirmations out of 3 (2 is required)
- Implements ERC20 and ERC2612.
- Only admin can set minters.
- Only minters can create new tokens.
- Only minters can burn tokens.
Scope: Test the minter functions of the contract.
Action: Invoke the grantRole
methods.
Verification Steps: Verify the operation only from authorized actors are permitted and the changes take effect.
Scenario 1: Call grantRole
by:
- admin
- one without admin permissions
Scope: Test the minter functions of the contract.
Action: Invoke the mint
, burn
methods.
Verification Steps: Verify the operation only from authorized actors are permitted and the changes take effect.
Scenario 1: Call mint
by:
- minter
- one without minter permissions
Scenario 2: Call burn
by:
- minter
- one without minter permissions
Scope: Test the off-chain permit of the contract.
Action: Invoke the permit
methods.
Verification Steps: Verify the operation only with the correct signature are permitted and the changes take effect.
Scenario 1: Call permit
:
- with correct signature
- without correct signature
- Admin can add the support for the assets.
- Both native chain's token and ERC20 tokens can be added.
- If the asset isn't from the current chain the new wrapped asset (ERC20) is created.
- To succeed the token transfer should be supported on both chains.
- The transfer fee is charged when the transfer from original chain is started and/or returned back to the original chain.
- The collected fees can be swapped to Link token and used to fund the CL aggregator.
- Part of the fee can be withdrawn.
- The aggregator can be replaced.
- The part of locked tokens can be used in DEFI protocol.
- The transfers must be confirmed by the oracles to be compleated.
Scope: Test configurations.
Action: Invoke the setAggregator
, setFeeProxy
, setDefiController
, setWeth
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call each of the methods by:
- admin
- not admin
Scope: Test adding/removing assets.
Action: Invoke the setChainIdSupport
, addNativeAsset
, addExternalAsset
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Add asset by:
- admin
- not admin
Scenario 2: Add asset:
- new
- added before
Scope: Test fee managemnet.
Action: Invoke the fundAggregator
, withdrawFee
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Calle methods by:
- admin
- not admin
Scenario 2: Try to withdraw fee:
- more than collected fee
- less than collected fee
Scenario 3: Try to fund the aggregator:
- more than collected fee
- less than collected fee
Scenario 4: Try to use fees:
- collected from the asset on the current chain
- collected from the asset on the other chain
Scope: Test send.
Action: Invoke the send
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call send with different chains when:
- the current chain's asset
- the outside asset
Scenario 2: Call send with different target chains when:
- the target chain is supported
- the target chain isn't supported
Scenario 3: Call send with different amounts:
- the amount is enough
- to few tokens
Scenario 4: Call send with different assets:
- the ERC20
- native token
Scope: Test mint.
Action: Invoke the mint
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call mint with different approvals when:
- the mint is approved
- the mint isn't approved
Scenario 2: Call mint few times:
- first time
- second time
Scenario 3: Call mint with different chains:
- supported chain
- prohibited chain
Scope: Test burn.
Action: Invoke the burn
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call burn with different chains when:
- with the current chain
- with the different chain
Scenario 2: Call burn with diffrent amounts when:
- enough tokens are transfered
- too few tokens are sent
Scope: Test claim.
Action: Invoke the claim
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call claim with different chains when:
- the current chain's asset
- the outside asset
Scenario 2: Call claim with different confirmations when:
- the burnt is confiremd
- the burnt isn't confirmed
Scenario 3: Call claim few times:
- in the first time
- in the second time
Scenario 4: Call claim with different assets:
- the ERC20
- native token
Scope: Test fee withdrawal.
Action: Invoke the withdrawFee
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call withdrawFee
by :
- admin
- non-admin
Scenario 2: Call withdrawFees
with different chains when:
- the current chain's asset
- the outside asset
Scenario 3: Call withdrawFee
with different assets:
- the ERC20
- native token
Scope: Test fund aggregator.
Action: Invoke the fundAggregator
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call fundAggregator
by :
- admin
- non-admin
Scenario 2: Call fundAggregator
with different chains when:
- the current chain's asset
- the outside asset
Scenario 3: Call fundAggregator
with different assets:
- the ERC20
- native token
- Should swap any tokens on the balance to Link.
Scope: Test swap.
Action: Invoke the swapToLink
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call permit
:
- swap native asset
- swap token
- Admin can add the support for the assets.
- Both native chain's token and ERC20 tokens can be added.
- If the asset isn't from the current chain the new wrapped asset (ERC20) is created.
- To succeed the token transfer should be supported on both chains.
- The transfer fee is charged when the transfer from original chain is started and/or returned back to the original chain.
- Part of the fee can be withdrawn.
- The aggregator can be replaced.
- The part of locked tokens can be used in DEFI protocol.
- The transfers must be confirmed by the oracles to be compleated.
Scope: Test configurations.
Action: Invoke the setAggregator
, setDefiController
, setWeth
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call each of the methods by:
- admin
- not admin
Scope: Test adding/removing assets.
Action: Invoke the setChainIdSupport
, addNativeAsset
, addExternalAsset
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Add asset by:
- admin
- not admin
Scenario 2: Add asset:
- new
- added before
Scope: Test fee managemnet.
Action: Invoke the fundAggregator
, withdrawFee
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Calle methods by:
- admin
- not admin
Scenario 2: Try to withdraw fee:
- more than collected fee
- less than collected fee
Scope: Test send.
Action: Invoke the send
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call send with different chains when:
- the current chain's asset
- the outside asset
Scenario 2: Call send with different target chains when:
- the target chain is supported
- the target chain isn't supported
Scenario 3: Call send with different amounts:
- the amount is enough
- to few tokens
Scenario 4: Call send with different assets:
- the ERC20
- native token
Scope: Test mint.
Action: Invoke the mint
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call mint with different approvals when:
- the mint is approved
- the mint isn't approved
Scenario 2: Call mint few times:
- first time
- second time
Scenario 3: Call mint with different chains:
- supported chain
- prohibited chain
Scope: Test burn.
Action: Invoke the burn
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call burn with different chains when:
- with the current chain
- with the different chain
Scenario 2: Call burn with diffrent amounts when:
- enough tokens are transfered
- too few tokens are sent
Scope: Test claim.
Action: Invoke the claim
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call claim with different chains when:
- the current chain's asset
- the outside asset
Scenario 2: Call claim with different confirmations when:
- the burnt is confiremd
- the burnt isn't confirmed
Scenario 3: Call claim few times:
- in the first time
- in the second time
Scenario 4: Call claim with different assets:
- the ERC20
- native token
Scope: Test fee withdrawal.
Action: Invoke the withdrawFee
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call withdrawFee
by :
- admin
- non-admin
Scenario 2: Call withdrawFees
with different chains when:
- the current chain's asset
- the outside asset
Scenario 3: Call withdrawFee
with different assets:
- the ERC20
- native token
- Oracle can stake any amount of gov token.
- Oracle can request unstake any amount of gov token.
- Oracle can execute unstake after timelock.
- Owner can liquidate the part of stake.
- Owner can withdraw liquidated stake.
Scope: Test staking different amounts.
Action: Invoke the stake
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call stake
:
- 0 tokens
- normal amount of tokens
- too many tokens
Scope: Test staking different amount of times.
Action: Invoke the stake
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call stake
:
- first time
- other times
Scope: Test unstaking permissions.
Action: Invoke the requestUnstake
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call requestUnstake
:
- by admin
- by non-admin
Scope: Test unstaking different amounts.
Action: Invoke the requestUnstake
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call requestUnstake
:
- 0 tokens
- normal amount of tokens
- too many tokens
Scope: Test unstaking different amount of times.
Action: Invoke the requestUnstake
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call requestUnstake
:
- first time
- twice
Scope: Test unstaking different amounts.
Action: Invoke the executeUnstake
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call executeUnstake
:
- noraml withdrawal id
- withdrawal id from future
Scope: Test unstaking at the different time.
Action: Invoke the executeUnstake
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call executeUnstake
:
- before timelock passed
- after timelock passed
Scope: Test unstaking different amount of times.
Action: Invoke the executeUnstake
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call executeUnstake
:
- first time
- twice
Scope: Test liquidate permissions.
Action: Invoke the liquidate
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call liquidate
:
- by admin
- by non-admin
Scenario 2: Call liquidate
:
- 0 tokens
- normal amount of tokens
- too many tokens
Scope: Test liquidate permissions.
Action: Invoke the withdrawFunds
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call withdrawFunds
:
- by admin
- by non-admin
Scope: Test liquidate different amounts.
Action: Invoke the withdrawFunds
methods.
Verification Steps: Verify the operation works fine.
Scenario 1: Call withdrawFunds
:
- 0 tokens
- normal amount of tokens
- too many tokens