This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const main = async function() { | |
| console.log('Now transferring DAI from my wallet to MyContract...'); | |
| let transferResult = await daiContract.methods.transfer( | |
| myContractAddress, | |
| web3.utils.toHex(10e18) // 10 DAI to send to MyContract | |
| ).send({ | |
| from: myWalletAddress, | |
| gasLimit: web3.utils.toHex(150000), // posted at compound.finance/developers#gas-costs | |
| gasPrice: web3.utils.toHex(20000000000), // use ethgasstation.info (mainnet only) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contract MyContract { | |
| event MyLog(string, uint256); | |
| function supplyErc20ToCompound( | |
| address _erc20Contract, | |
| address _cErc20Contract, | |
| uint256 _numTokensToSupply | |
| ) public returns (uint) { | |
| // Create a reference to the underlying asset contract, like DAI. | |
| Erc20 underlying = Erc20(_erc20Contract); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Cert } = require('@0xcert/cert'); | |
| const { HttpProvider } = require('@0xcert/ethereum-http-provider'); | |
| const { AssetLedger } = require('@0xcert/ethereum-asset-ledger'); | |
| (async () => { | |
| const schema = { | |
| "$schema": "http://json-schema.org/draft-07/schema", | |
| "description": "A digital assets that have a unique combination of different properties.", | |
| "properties": { |
NewerOlder