0x2bf16b1275aab773bf22f1a5d03d56fa75e76ea713e8267cb2b1ed994d89793c
In buidler.config.js
add this:
usePlugin("@nomiclabs/buidler-web3");
You can do this with ethers but I am more familiar with web3, so that's what this example uses.
Also do:
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.6.0; | |
/** | |
* @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer. | |
* `CREATE2` can be used to compute in advance the address where a smart | |
* contract will be deployed, which allows for interesting new mechanisms known | |
* as 'counterfactual interactions'. | |
* | |
* See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more | |
* information. |
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.6.0; | |
contract Log2 { | |
/** | |
* @dev Computes the log2 of a uint64 | |
* @author Formula taken from a stackoverflow post by Desmond Hume | |
* https://stackoverflow.com/a/11398748 | |
*/ | |
function log2(uint64 input) external view returns (byte) { | |
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 MultiHashSha256 { | |
// https://github.com/pouladzade/Seriality/blob/master/src/BytesToTypes.sol | |
function bytesToBytes32(uint _offst, bytes memory _input, bytes32 _output) | |
internal pure { | |
assembly { | |
mstore(_output, add(_input, _offst)) | |
mstore(add(_output, 32), add(add(_input, _offst), 32)) | |
} |
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.7; | |
contract OrderMaker5000 { | |
struct Order { | |
address from; | |
uint haveAmt; | |
uint haveTokenIdx; | |
uint wantAmt; | |
uint wantTokenIdx; | |
} |
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.25; | |
pragma experimental ABIEncoderV2; | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal pure returns (uint256) { | |
if (a == 0) { | |
return 0; | |
} | |
uint256 c = a * b; | |
require(c / 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.25; | |
pragma experimental ABIEncoderV2; | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal pure returns (uint256) { | |
if (a == 0) { | |
return 0; | |
} | |
uint256 c = a * b; | |
require(c / 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.5.5; | |
import "./strings.sol"; | |
contract BetterNameService { | |
using strings for string; | |
struct TLDPrice { | |
uint price; | |
uint lastUpdate; |