Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bernatmarcilla/globalescrow-compound-supply
Escrow arrangement to supply Ether locked in a smart contract escrow to the Compound protocol via Solidity
https://github.com/bernatmarcilla/globalescrow-compound-supply
compound-finance compound-protocol ethereum smart-contracts solidity
Last synced: 3 days ago
JSON representation
Escrow arrangement to supply Ether locked in a smart contract escrow to the Compound protocol via Solidity
- Host: GitHub
- URL: https://github.com/bernatmarcilla/globalescrow-compound-supply
- Owner: bernatmarcilla
- Created: 2021-10-04T11:05:52.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-03T16:04:17.000Z (over 2 years ago)
- Last Synced: 2024-09-11T15:48:03.611Z (2 months ago)
- Topics: compound-finance, compound-protocol, ethereum, smart-contracts, solidity
- Language: Solidity
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GlobalEscrow-compound-supply
Supply Ether locked in the smart contract escrow to the Compound protocol via Solidity.
- https://github.com/compound-developers/compound-supply-examples## Eher supply to Compound protocol
Ether is supplied to Compound at the point of deposit.
```solidity
205 //Ether supplying to Compound at the point of deposit:
206 CEther cEthToken = CEther("0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5"); //contract address, the cEth contract address
207 uint256 mintResult = cEthToken.mint(e.fund); //num Tokens to supply
208 //mintResult = balance of cEth
```## Ether retrieve
Ether is subsequently retrieved at the point of withdrawal.
```solidity
271 //Ether retrieved only at the point of withdrawal:
272 CEther cEthToken = CEther("0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5"); //contract address, the cEth contract address
273 uint256 redeemResult = cEthToken.redeem(_amount); //num Tokens to redeem275 // REDEEM_ERROR_CODES
276 emit MyLog("If this is not 0, there was an error", redeemResult);
277 require(redeemResult == 0, "redeemResult error"); //uint 0=success, otherwise a failure
```