aave-protocol-v2/test-suites/test-amm/helpers/scenarios/withdraw-negatives.json
2021-02-22 15:59:51 -05:00

165 lines
3.8 KiB
JSON

{
"title": "LendingPool: Redeem negative test cases",
"description": "Redeem function.",
"stories": [
{
"description": "Users 0 Deposits 1000 DAI and tries to redeem 0 DAI (revert expected)",
"actions": [
{
"name": "mint",
"args": {
"reserve": "DAI",
"amount": "1000",
"user": "0"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "DAI",
"user": "0"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "DAI",
"amount": "1000",
"user": "0"
},
"expected": "success"
},
{
"name": "withdraw",
"args": {
"reserve": "DAI",
"amount": "0",
"user": "0"
},
"expected": "revert",
"revertMessage": "Amount to redeem needs to be > 0"
}
]
},
{
"description": "Users 0 tries to redeem 1100 DAI from the 1000 DAI deposited (revert expected)",
"actions": [
{
"name": "withdraw",
"args": {
"reserve": "DAI",
"amount": "1100",
"user": "0"
},
"expected": "revert",
"revertMessage": "User cannot redeem more than the available balance"
}
]
},
{
"description": "Users 1 deposits 1 WETH, borrows 100 DAI stable (revert expected), redeems the 1 WETH deposited",
"actions": [
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "1"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "1"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "1"
},
"expected": "success"
},
{
"name": "borrow",
"args": {
"reserve": "DAI",
"amount": "100",
"user": "1",
"borrowRateMode": "stable"
},
"expected": "revert"
},
{
"name": "withdraw",
"args": {
"reserve": "WETH",
"amount": "-1",
"user": "1"
},
"expected": "success"
}
]
},
{
"description": "Users 1 deposits 1 WETH, borrows 100 DAI at variable rate, tries to redeem the 1 WETH deposited (revert expected)",
"actions": [
{
"name": "mint",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "1"
},
"expected": "success"
},
{
"name": "approve",
"args": {
"reserve": "WETH",
"user": "1"
},
"expected": "success"
},
{
"name": "deposit",
"args": {
"reserve": "WETH",
"amount": "1",
"user": "1"
},
"expected": "success"
},
{
"name": "borrow",
"args": {
"reserve": "DAI",
"amount": "100",
"user": "1",
"borrowRateMode": "variable"
},
"expected": "success"
},
{
"name": "withdraw",
"args": {
"reserve": "WETH",
"amount": "-1",
"user": "1"
},
"expected": "revert",
"revertMessage": "Transfer cannot be allowed."
}
]
}
]
}