mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
435 lines
9.5 KiB
JSON
435 lines
9.5 KiB
JSON
{
|
|
"title": "LendingPool: withdraw",
|
|
"description": "withdraw function.",
|
|
"stories": [
|
|
{
|
|
"description": "User 0 Deposits 1000 DAI in an empty reserve",
|
|
"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"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "User 0 withdraws half of the deposited DAI",
|
|
"actions": [
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "500",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "User 0 withdraws remaining half of the deposited DAI",
|
|
"actions": [
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "-1",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "User 0 Deposits 1000 USDC in an empty reserve",
|
|
"actions": [
|
|
{
|
|
"name": "mint",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"amount": "1000",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "approve",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "deposit",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"amount": "1000",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "User 0 withdraws half of the deposited USDC",
|
|
"actions": [
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"amount": "500",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "User 0 withdraws remaining half of the deposited USDC",
|
|
"actions": [
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"amount": "-1",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "User 0 Deposits 1 WETH in an empty reserve",
|
|
"actions": [
|
|
{
|
|
"name": "mint",
|
|
"args": {
|
|
"reserve": "WETH",
|
|
"amount": "1",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "approve",
|
|
"args": {
|
|
"reserve": "WETH",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "deposit",
|
|
"args": {
|
|
"reserve": "WETH",
|
|
"amount": "1",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "User 0 withdraws half of the deposited WETH",
|
|
"actions": [
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "WETH",
|
|
"amount": "0.5",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "User 0 withdraws remaining half of the deposited WETH",
|
|
"actions": [
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "WETH",
|
|
"amount": "-1",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "Users 0 and 1 Deposit 1000 DAI, both withdraw",
|
|
"actions": [
|
|
{
|
|
"name": "mint",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "1000",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "approve",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "deposit",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "1000",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "deposit",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "1000",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "-1",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "-1",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "Users 0 deposits 1000 DAI, user 1 Deposit 1000 USDC and 1 WETH, borrows 100 DAI at stable rate (revert expected). User 1 tries to withdraw all the USDC",
|
|
"actions": [
|
|
{
|
|
"name": "deposit",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "1000",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "mint",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"amount": "1000",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "approve",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "deposit",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"amount": "1000",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"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": "USDC",
|
|
"amount": "-1",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "Users 0 deposits 1000 DAI, user 1 Deposit 1000 USDC and 1 WETH, borrows 100 DAI at variable rate. User 1 tries to withdraw all the USDC",
|
|
"actions": [
|
|
{
|
|
"name": "mint",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "1000",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "deposit",
|
|
"args": {
|
|
"reserve": "DAI",
|
|
"amount": "1000",
|
|
"user": "0"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "mint",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"amount": "10000",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "approve",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"name": "deposit",
|
|
"args": {
|
|
"reserve": "USDC",
|
|
"amount": "1000",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
},
|
|
{
|
|
"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": "USDC",
|
|
"amount": "-1",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "Users 1 tries to withdraw 0.05 WETH, which does not bring the HF below 1",
|
|
"actions": [
|
|
{
|
|
"name": "withdraw",
|
|
"args": {
|
|
"reserve": "WETH",
|
|
"amount": "0.05",
|
|
"user": "1"
|
|
},
|
|
"expected": "success"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|