2021-02-07 03:10:29 +00:00
|
|
|
{
|
|
|
|
"title": "LendingPool: Deposit",
|
|
|
|
"description": "Test cases for the deposit 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 1 deposits 1000 DAI after user 0",
|
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": "1"
|
|
|
|
},
|
|
|
|
"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 1 deposits 1000 USDC after user 0",
|
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": "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"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
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 1 deposits 1 WETH after user 0",
|
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": "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"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2021-02-08 16:05:10 +00:00
|
|
|
"description": "User 1 deposits 0 WETH (revert expected)",
|
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": "deposit",
|
|
|
|
"args": {
|
2021-02-08 16:05:10 +00:00
|
|
|
"reserve": "WETH",
|
2021-02-07 03:10:29 +00:00
|
|
|
"amount": "0",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "revert",
|
|
|
|
"revertMessage": "Amount must be greater than 0"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2021-02-19 20:50:13 +00:00
|
|
|
"description": "User 1 deposits 0 DAI",
|
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": "0",
|
|
|
|
"user": "1"
|
|
|
|
},
|
|
|
|
"expected": "revert",
|
|
|
|
"revertMessage": "Amount must be greater than 0"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2021-02-19 20:50:13 +00:00
|
|
|
"description": "User 1 deposits 100 DAI on behalf of user 2, user 2 tries to borrow 0.1 WETH",
|
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": "100",
|
|
|
|
"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": "100",
|
|
|
|
"user": "1",
|
|
|
|
"onBehalfOf": "2"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "borrow",
|
|
|
|
"args": {
|
2021-02-08 16:05:10 +00:00
|
|
|
"reserve": "WETH",
|
2021-02-07 03:10:29 +00:00
|
|
|
"amount": "0.1",
|
|
|
|
"borrowRateMode": "variable",
|
|
|
|
"user": "2"
|
|
|
|
},
|
|
|
|
"expected": "success"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|