2021-02-07 03:10:29 +00:00
{
"title" : "LendingPool: withdraw" ,
"description" : "withdraw function." ,
"stories" : [
{
2021-02-19 20:50:13 +00:00
"description" : "User 0 Deposits 1000 DAI in an empty reserve" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "mint" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-19 20:50:13 +00:00
"description" : "User 0 withdraws half of the deposited DAI" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "withdraw" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "500" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-19 20:50:13 +00:00
"description" : "User 0 withdraws remaining half of the deposited DAI" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "withdraw" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "-1" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-19 20:50:13 +00:00
"description" : "User 0 Deposits 1000 USDC in an empty reserve" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "mint" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-19 20:50:13 +00:00
"description" : "User 0 withdraws half of the deposited USDC" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "withdraw" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"amount" : "500" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-19 20:50:13 +00:00
"description" : "User 0 withdraws remaining half of the deposited USDC" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "withdraw" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"amount" : "-1" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-08 16:05:10 +00:00
"description" : "User 0 Deposits 1 WETH in an empty reserve" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "mint" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-08 16:05:10 +00:00
"description" : "User 0 withdraws half of the deposited WETH" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "withdraw" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "0.5" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
"description" : "User 0 withdraws remaining half of the deposited WETH" ,
"actions" : [
{
"name" : "withdraw" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "-1" ,
"user" : "0"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-19 20:50:13 +00:00
"description" : "Users 0 and 1 Deposit 1000 DAI, both withdraw" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "mint" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "withdraw" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "-1" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "withdraw" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "-1" ,
"user" : "1"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-19 20:50:13 +00:00
"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" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "deposit" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "mint" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"amount" : "1000" ,
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "mint" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "1" ,
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "borrow" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-07 03:10:29 +00:00
"amount" : "100" ,
"user" : "1" ,
"borrowRateMode" : "stable"
} ,
2021-02-09 23:14:38 +00:00
"expected" : "revert"
} ,
{
"name" : "withdraw" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-09 23:14:38 +00:00
"amount" : "-1" ,
"user" : "1"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-19 20:50:13 +00:00
"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" ,
2021-02-09 23:14:38 +00:00
"actions" : [
{
"name" : "mint" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-09 23:14:38 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-09 23:14:38 +00:00
"amount" : "1000" ,
"user" : "0"
} ,
"expected" : "success"
} ,
{
"name" : "mint" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-09 23:14:38 +00:00
"amount" : "10000" ,
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "approve" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-09 23:14:38 +00:00
"user" : "1"
} ,
"expected" : "success"
} ,
{
"name" : "deposit" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-09 23:14:38 +00:00
"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" : {
2021-02-19 20:50:13 +00:00
"reserve" : "DAI" ,
2021-02-09 23:14:38 +00:00
"amount" : "100" ,
"user" : "1" ,
"borrowRateMode" : "variable"
} ,
2021-02-07 03:10:29 +00:00
"expected" : "success"
} ,
{
"name" : "withdraw" ,
"args" : {
2021-02-19 20:50:13 +00:00
"reserve" : "USDC" ,
2021-02-07 03:10:29 +00:00
"amount" : "-1" ,
"user" : "1"
} ,
"expected" : "success"
}
]
} ,
{
2021-02-08 16:05:10 +00:00
"description" : "Users 1 tries to withdraw 0.05 WETH, which does not bring the HF below 1" ,
2021-02-07 03:10:29 +00:00
"actions" : [
{
"name" : "withdraw" ,
"args" : {
2021-02-08 16:05:10 +00:00
"reserve" : "WETH" ,
2021-02-07 03:10:29 +00:00
"amount" : "0.05" ,
"user" : "1"
} ,
"expected" : "success"
}
]
}
]
}