2020-06-08 12:03:40 +00:00
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"title": "LendingPool: withdraw",
|
|
|
|
"description": "withdraw function.",
|
2020-06-08 12:03:40 +00:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"description": "User 0 withdraws half of the deposited DAI",
|
2020-06-08 12:03:40 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "500",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"description": "User 0 withdraws remaining half of the deposited DAI",
|
2020-06-08 12:03:40 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"description": "User 0 withdraws half of the deposited USDC",
|
2020-06-08 12:03:40 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"amount": "500",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"description": "User 0 withdraws remaining half of the deposited USDC",
|
2020-06-08 12:03:40 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"amount": "-1",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-13 12:58:44 +00:00
|
|
|
"description": "User 0 Deposits 1 WETH in an empty reserve",
|
2020-06-08 12:03:40 +00:00
|
|
|
"actions": [
|
2020-08-13 12:58:44 +00:00
|
|
|
{
|
|
|
|
"name": "mint",
|
|
|
|
"args": {
|
|
|
|
"reserve": "WETH",
|
|
|
|
"amount": "1",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "approve",
|
|
|
|
"args": {
|
|
|
|
"reserve": "WETH",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
2020-06-08 12:03:40 +00:00
|
|
|
{
|
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
|
2020-06-08 12:03:40 +00:00
|
|
|
"amount": "1",
|
2020-08-13 12:58:44 +00:00
|
|
|
"user": "0"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"description": "User 0 withdraws half of the deposited ETH",
|
2020-06-08 12:03:40 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
|
2020-06-08 12:03:40 +00:00
|
|
|
"amount": "0.5",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"description": "User 0 withdraws remaining half of the deposited ETH",
|
2020-06-08 12:03:40 +00:00
|
|
|
"actions": [
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
|
2020-06-08 12:03:40 +00:00
|
|
|
"amount": "-1",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"description": "Users 0 and 1 Deposit 1000 DAI, both withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"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"
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "-1",
|
|
|
|
"user": "0"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "-1",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"description": "Users 0 deposits 1000 DAI, user 1 Deposit 1000 USDC and 1 WETH, borrows 100 DAI. User 1 tries to withdraw all the USDC",
|
2020-06-08 12:03:40 +00:00
|
|
|
"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": "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"
|
|
|
|
},
|
2020-08-13 12:58:44 +00:00
|
|
|
{
|
|
|
|
"name": "mint",
|
|
|
|
"args": {
|
|
|
|
"reserve": "WETH",
|
|
|
|
"amount": "1",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "approve",
|
|
|
|
"args": {
|
|
|
|
"reserve": "WETH",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
2020-06-08 12:03:40 +00:00
|
|
|
{
|
|
|
|
"name": "deposit",
|
|
|
|
"args": {
|
2020-08-13 11:06:23 +00:00
|
|
|
"reserve": "WETH",
|
|
|
|
|
2020-06-08 12:03:40 +00:00
|
|
|
"amount": "1",
|
2020-08-13 12:58:44 +00:00
|
|
|
"user": "1"
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "borrow",
|
|
|
|
"args": {
|
|
|
|
"reserve": "DAI",
|
|
|
|
"amount": "100",
|
|
|
|
"user": "1",
|
|
|
|
"borrowRateMode": "stable"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
|
|
|
{
|
2020-08-19 10:56:39 +00:00
|
|
|
"name": "withdraw",
|
2020-06-08 12:03:40 +00:00
|
|
|
"args": {
|
|
|
|
"reserve": "USDC",
|
|
|
|
"amount": "-1",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|