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.4.24; | |
contract Math { | |
// Answer | |
uint public ans; | |
// Module #0 | |
function plus(uint _n1, uint _n2) public { ans = _n1 + _n2; } | |
// Module #1 | |
function minus(uint _n1, uint _n2) public { ans = _n1 - _n2; } | |
// Module #2 |
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.4.24; | |
contract Math { | |
uint public ans; | |
function add(uint a,uint b) public { | |
ans = a + b; | |
} | |
} |
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.4.24; | |
import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol"; | |
contract Payment { | |
using SafeMath for uint; | |
mapping (address => uint) public deposits; | |
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
/* | |
* Credit to: Ethereum | |
* Orginal source: https://www.ethereum.org/token | |
*/ | |
pragma solidity ^0.4.13; | |
contract Token { | |
mapping (address => uint256) public balances; |
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.4.24; | |
//// All Modules //// | |
contract Math { | |
// Module #0 | |
function plus(uint _n1, uint _n2) public pure returns (uint) { return _n1 + _n2; } | |
// Module #1 | |
function minus(uint _n1, uint _n2) public pure returns (uint ans) { return _n1 - _n2; } | |
// Module #2 |
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.4.24; | |
//// All Modules //// | |
// Module #0 | |
contract CanPlus { | |
function plus(uint _n1, uint _n2) public pure returns (uint ans) { return _n1 + _n2; } | |
} | |
// Module #1 | |
contract CanMinus { |
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.4.24; | |
// @title Modularized smart contract: Gating | |
// @author Hu Yao-Chieh (yhuag@ust.hk) | |
// @dev This smart contract is modularized by switching on/off a specific module via modifier access control mapping. | |
contract Gating { | |
address owner; | |
mapping (uint => bool) public enabled; | |
// Constructor |
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.4.21; | |
// @title MAR mode: Module-Agnostic Rendering Mode (Module) | |
// @author Jeff Hu | |
// @dev This smart contract is an atomic callable stub | |
contract M { | |
bool public value = false; | |
function setTrue() public { | |
value = true; |
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.4.21; | |
// @title MAR mode: Module-Agnostic Rendering Mode (Core) | |
// @author Jeff Hu | |
// @dev This smart contract is modularized via a module agnostic execution scheme | |
contract C { | |
address public M_addr; // The deployed address of the module M | |
string public M_func; // The target function signature of module M | |
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
download: function () { | |
let csvContent = "data:text/csv;charset=utf-8,"; | |
csvContent += document.getElementById("bulktextarea").value; | |
var encodedUri = encodeURI(csvContent); | |
var link = document.createElement("a"); | |
link.setAttribute("href", encodedUri); | |
link.setAttribute("download", "BitcoinKeys.csv"); | |
document.body.appendChild(link); |