{ "title": "LendingPool: Redeem", "description": "Redeem 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 redeems half of the deposited DAI", "actions": [ { "name": "redeem", "args": { "reserve": "DAI", "amount": "500", "user": "0" }, "expected": "success" } ] }, { "description": "User 0 redeems remaining half of the deposited DAI", "actions": [ { "name": "redeem", "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 redeems half of the deposited USDC", "actions": [ { "name": "redeem", "args": { "reserve": "USDC", "amount": "500", "user": "0" }, "expected": "success" } ] }, { "description": "User 0 redeems remaining half of the deposited USDC", "actions": [ { "name": "redeem", "args": { "reserve": "USDC", "amount": "-1", "user": "0" }, "expected": "success" } ] }, { "description": "User 0 Deposits 1 ETH in an empty reserve", "actions": [ { "name": "deposit", "args": { "reserve": "ETH", "amount": "1", "user": "0", "sendValue": "1" }, "expected": "success" } ] }, { "description": "User 0 redeems half of the deposited ETH", "actions": [ { "name": "redeem", "args": { "reserve": "ETH", "amount": "0.5", "user": "0" }, "expected": "success" } ] }, { "description": "User 0 redeems remaining half of the deposited ETH", "actions": [ { "name": "redeem", "args": { "reserve": "ETH", "amount": "-1", "user": "0" }, "expected": "success" } ] }, { "description": "Users 0 and 1 Deposit 1000 DAI, both redeem", "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": "redeem", "args": { "reserve": "DAI", "amount": "-1", "user": "0" }, "expected": "success" }, { "name": "redeem", "args": { "reserve": "DAI", "amount": "-1", "user": "1" }, "expected": "success" } ] }, { "description": "Users 0 deposits 1000 DAI, user 1 Deposit 1000 USDC and 1 ETH, borrows 100 DAI. User 1 tries to redeem all the USDC", "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" }, { "name": "deposit", "args": { "reserve": "ETH", "amount": "1", "user": "1", "sendValue": "1" }, "expected": "success" }, { "name": "borrow", "args": { "reserve": "DAI", "amount": "100", "user": "1", "borrowRateMode": "stable" }, "expected": "success" }, { "name": "redeem", "args": { "reserve": "USDC", "amount": "-1", "user": "1" }, "expected": "success" } ] } ] }