Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yearn/itoken
yToken wrappers for automated investment strategy tokenization
https://github.com/yearn/itoken
defi erc20 solidity
Last synced: 8 days ago
JSON representation
yToken wrappers for automated investment strategy tokenization
- Host: GitHub
- URL: https://github.com/yearn/itoken
- Owner: yearn
- License: mit
- Created: 2020-01-25T22:44:32.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-14T00:30:37.000Z (about 2 years ago)
- Last Synced: 2023-03-03T19:34:47.650Z (over 1 year ago)
- Topics: defi, erc20, solidity
- Language: JavaScript
- Homepage: https://docs.iearn.finance
- Size: 43.1 MB
- Stars: 71
- Watchers: 14
- Forks: 89
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Documentation
[iearn.finance](https://docs.iearn.finance)
# Smart Contract Interface
| Contract | ABI | Address |
| -- | -- | -- |
| iEther | [JSON](https://github.com/iearn-finance/itoken/blob/master/build/contracts/IEther.json) | [0x9Dde7cdd09dbed542fC422d18d89A589fA9fD4C0](https://etherscan.io/address/0x9dde7cdd09dbed542fc422d18d89a589fa9fd4c0#code) |## iToken Interface
{% tabs %}
{% tab title="IIEther.sol" %}
```javascript
// Solidity Interfaceinterface IIEther {
// Invest ETH
function invest() external payable;
function calcPoolValueInETH() external view returns (uint);
function getPricePerFullShare() external view returns (uint);
// Redeem any invested tokens from the pool
function redeem(uint256 _shares) external;
}
```
{% endtab %}
{% endtabs %}## ERC20 Token Interface
{% tabs %}
{% tab title="TokenInterface.sol" %}
```javascript
// https://theethereum.wiki/w/index.php/ERC20_Token_Standard
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
// optional
function name() external view returns (string);
function symbol() external view returns (string);
function decimals() external view returns (string);event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
```
{% endtab %}{% endtabs %}