A Pen by Julio Vasconez Yulan on CodePen.
This file contains 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
// File: contracts/CompoundContracts/Comp.sol | |
pragma solidity ^0.5.16; | |
pragma experimental ABIEncoderV2; | |
contract Comp { | |
/// @notice EIP-20 token name for this token | |
string public name; |
This file contains 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
// File: contracts/CompoundContracts/GovernorAlpha.sol | |
pragma solidity ^0.5.16; | |
pragma experimental ABIEncoderV2; | |
contract GovernorAlpha { | |
/// @notice The name of this contract | |
string public name; |
This file contains 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
export function handleDelegateChanged(event: DelegateChanged): void { | |
let delegator = event.params.delegator | |
let fromDelegate = event.params.fromDelegate | |
let toDelegate = event.params.toDelegate | |
let txHash = event.transaction.hash.toHex() | |
let timestamp = event.block.timestamp | |
let blockNumber = event.block.number | |
// Load Token Contract to get official votes (rather than computing from events) | |
let token = COMP.bind(event.address) |
This file contains 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
pragma solidity ^0.5.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20Detailed.sol"; | |
contract Token is ERC20, ERC20Detailed { | |
constructor (string memory name, string memory symbol, uint supply) public ERC20Detailed(name, symbol, 18) { | |
_mint(msg.sender, supply * (10 ** uint256(decimals()))); | |
} |
This file contains 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
[ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_DAO", | |
"type": "address" | |
} | |
], | |
"stateMutability": "nonpayable", |
This file contains 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
[ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "string", | |
"name": "_name", | |
"type": "string" | |
}, | |
{ | |
"internalType": "address", |
This file contains 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
[{"constant":false,"inputs":[],"name":"sendMinimumTwoEthNoArgs","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"hello","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"makeTxNoArgs","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"simpleMessage","type":"bytes32"}],"name":"sendEthWithArgs","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"fromAddress","type":"address"},{"name":"amount","type":"uint256"}],"name":"viewMultipleArgsMultipleReturn","outputs":[{"name":"longInteger","type":"uint256"},{"name":"sayHello","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"myString","type":"string"}],"name":"makeTxWithArgs","outputs":[],"payable":false,"stateMutability":"nonpayabl |
This file contains 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
pragma solidity 0.5.0; | |
contract DappHeroTest { | |
uint public important = 777; | |
bytes32 public hello = "Howdy"; | |
address public owner; | |
event EventTrigger(address indexed sender, uint value); | |
event ValueSent(address indexed sender); |
This file contains 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
<!------------------------ Custom Contract ----------------------------------------- | |
Notes: The contract used here as demonstration is availible at: | |
https://ropsten.etherscan.io/address/0x5d04f4635996dceaad4cda22799645af72633b7b#code | |
Here you will find the ABI and the Solidity Source code itself. | |
Contract Name is: DappHeroTest | |
Remember: To test this you need to have your admin "data-api" key match your project | |
in the DappHero admin. Currently the Data API below should resolve for Rinkeby. | |