Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 39 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Write | 13867398 | 1536 days ago | IN | 0 ETH | 0.01636144 | ||||
| Write | 13867398 | 1536 days ago | IN | 0 ETH | 0.01636396 | ||||
| Write | 13867371 | 1536 days ago | IN | 0 ETH | 0.0140801 | ||||
| Write | 13867286 | 1536 days ago | IN | 0 ETH | 0.01894879 | ||||
| Write | 13866763 | 1536 days ago | IN | 0 ETH | 0.01897987 | ||||
| Write | 13866688 | 1536 days ago | IN | 0 ETH | 0.02043291 | ||||
| Write | 13866688 | 1536 days ago | IN | 0 ETH | 0.02043042 | ||||
| Write | 13855850 | 1537 days ago | IN | 0 ETH | 0.02444169 | ||||
| Write | 13841806 | 1539 days ago | IN | 0 ETH | 0.00894765 | ||||
| Write | 13805404 | 1545 days ago | IN | 0 ETH | 0.02192538 | ||||
| Write | 13758472 | 1552 days ago | IN | 0 ETH | 0.02334127 | ||||
| Write | 13726114 | 1558 days ago | IN | 0 ETH | 0.02355853 | ||||
| Write | 13722164 | 1558 days ago | IN | 0 ETH | 0.03267652 | ||||
| Write | 13674786 | 1566 days ago | IN | 0 ETH | 0.034355 | ||||
| Write | 13674786 | 1566 days ago | IN | 0 ETH | 0.03435235 | ||||
| Write | 13674775 | 1566 days ago | IN | 0 ETH | 0.03198473 | ||||
| Write | 13535994 | 1588 days ago | IN | 0 ETH | 0.04650232 | ||||
| Write | 13454058 | 1601 days ago | IN | 0 ETH | 0.0144069 | ||||
| Write | 13454058 | 1601 days ago | IN | 0 ETH | 0.01440635 | ||||
| Write | 13454058 | 1601 days ago | IN | 0 ETH | 0.01440681 | ||||
| Write | 13454051 | 1601 days ago | IN | 0 ETH | 0.01324331 | ||||
| Write | 13454046 | 1601 days ago | IN | 0 ETH | 0.01539822 | ||||
| Write | 13448711 | 1601 days ago | IN | 0 ETH | 0.01583476 | ||||
| Write | 13442304 | 1602 days ago | IN | 0 ETH | 0.01852258 | ||||
| Write | 13441808 | 1602 days ago | IN | 0 ETH | 0.02301288 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SnapshotAffirmationWriter
Compiler Version
v0.7.3+commit.9bfce1f6
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "./UseAccessControl.sol";
import "./PermissionedTokenMetadataRegistry.sol";
import "./mixin/MixinSignature.sol";
import "./mixin/MixinPausable.sol";
import "./interface/IERC20.sol";
contract SnapshotAffirmationWriter is MixinSignature, MixinPausable, UseAccessControl {
PermissionedTokenMetadataRegistry public permissionedTokenMetadataRegistry;
bytes32 public immutable organizerRole;
bytes32 public immutable historianRole;
IERC20 public immutable tipToken;
uint256 public minimumQuorumAffirmations;
uint256 public constant VERSION = 2;
address payable public historianTipJar;
mapping(bytes32 => bool) public affirmationHashRegistry;
mapping(bytes32 => bool) public tipHashRegistry;
constructor(
address _accessControl,
address _permissionedTokenMetadataRegistry,
address payable _historianTipJar,
address _tipToken,
bytes32 _organizerRole,
bytes32 _historianRole
) UseAccessControl(_accessControl) {
permissionedTokenMetadataRegistry = PermissionedTokenMetadataRegistry(_permissionedTokenMetadataRegistry);
organizerRole = _organizerRole;
historianRole = _historianRole;
historianTipJar = _historianTipJar;
tipToken = IERC20(_tipToken);
}
struct Affirmation {
uint256 salt;
address signer;
bytes signature;
}
struct Tip {
uint256 version;
bytes32 writeHash;
address tipper;
uint256 value;
bytes signature;
}
struct Write {
uint256 tokenId;
string key;
string text;
uint256 salt;
}
event Affirmed(
uint256 indexed tokenId,
address indexed signer,
string indexed key,
bytes32 affirmationHash,
uint256 salt,
bytes signature
);
event Tipped(
bytes32 indexed writeHash,
address indexed tipper,
uint256 value,
bytes signature
);
function getWriteHash(Write calldata _write) public pure returns (bytes32) {
return keccak256(abi.encodePacked(_write.tokenId, _write.key, _write.text, _write.salt));
}
function getAffirmationHash(bytes32 _writeHash, Affirmation calldata _affirmation) public pure returns (bytes32) {
return keccak256(abi.encodePacked(_writeHash, _affirmation.signer, _affirmation.salt));
}
function getTipHash(Tip calldata _tip) public pure returns (bytes32) {
return keccak256(abi.encodePacked(_tip.version, _tip.writeHash, _tip.tipper, _tip.value));
}
function verifyAffirmation(
bytes32 writeHash, Affirmation calldata _affirmation
) public pure returns (bool) {
bytes32 signedHash = getAffirmationHash(writeHash, _affirmation);
(bytes32 r, bytes32 s, uint8 v) = splitSignature(_affirmation.signature);
return isSigned(_affirmation.signer, signedHash, v, r, s);
}
function verifyTip(
Tip calldata _tip
) public pure returns (bool) {
bytes32 signedHash = getTipHash(_tip);
(bytes32 r, bytes32 s, uint8 v) = splitSignature(_tip.signature);
return _tip.version == VERSION && isSigned(_tip.tipper, signedHash, v, r, s);
}
function updateMinimumQuorumAffirmations(uint256 _minimumQuorumAffirmations) public onlyRole(organizerRole) {
minimumQuorumAffirmations = _minimumQuorumAffirmations;
}
function updateHistorianTipJar(address payable _historianTipJar) public onlyRole(organizerRole) {
historianTipJar = _historianTipJar;
}
function pause() public onlyRole(organizerRole) {
_pause();
}
function unpause() public onlyRole(organizerRole) {
_unpause();
}
function write(Write calldata _write, Affirmation[] calldata _affirmations, Tip calldata _tip) public whenNotPaused {
bytes32 writeHash = getWriteHash(_write);
uint256 numValidAffirmations = 0;
for (uint256 i = 0; i < _affirmations.length; ++i) {
Affirmation calldata affirmation = _affirmations[i];
// once an affirmation is created and used on-chain it can't be used again
bytes32 affirmationHash = getAffirmationHash(writeHash, affirmation);
require(affirmationHashRegistry[affirmationHash] == false, "Affirmation has already been received");
affirmationHashRegistry[affirmationHash] = true;
require(verifyAffirmation(writeHash, affirmation) == true, "Affirmation doesn't have valid signature");
_checkRole(historianRole, affirmation.signer);
numValidAffirmations++;
emit Affirmed(_write.tokenId, affirmation.signer, _write.key, affirmationHash, affirmation.salt, affirmation.signature );
}
require(numValidAffirmations >= minimumQuorumAffirmations, "Minimum affirmations not met");
_writeDocument(_write);
_settleTip(writeHash, _tip);
}
function _writeDocument(Write calldata _write) internal {
string[] memory keys = new string[](1);
string[] memory texts = new string[](1);
keys[0] = _write.key;
texts[0] = _write.text;
permissionedTokenMetadataRegistry.writeDocuments(_write.tokenId, keys, texts);
}
function settleTip(bytes32 writeHash, Tip calldata _tip) public onlyRole(historianRole) {
_settleTip(writeHash, _tip);
}
function _settleTip(bytes32 writeHash, Tip calldata _tip) internal {
if (_tip.value != 0) {
require (writeHash == _tip.writeHash, 'Tip is not for write');
bytes32 tipHash = getTipHash(_tip);
require(tipHashRegistry[tipHash] == false, "Tip has already been used");
tipHashRegistry[tipHash] = true;
require(verifyTip(_tip) == true, "Tip doesn't have valid signature");
tipToken.transferFrom(_tip.tipper, historianTipJar, _tip.value);
emit Tipped(_tip.writeHash, _tip.tipper, _tip.value, _tip.signature);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "./interface/IAccessControl.sol";
import "./utils/Strings.sol";
contract UseAccessControl {
IAccessControl public accessControl;
constructor(address _accessControl) {
accessControl = IAccessControl(_accessControl);
}
modifier onlyRole(bytes32 role) {
_checkRole(role, msg.sender);
_;
}
function _checkRole(bytes32 role, address account) internal view {
if (!accessControl.hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
}pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "./library/LibSafeMath.sol";
import "./ERC1155Mintable.sol";
import "./mixin/MixinOwnable.sol";
contract PermissionedTokenMetadataRegistry is Ownable {
using LibSafeMath for uint256;
ERC1155Mintable public mintableErc1155;
mapping(uint256 => mapping(string => Document)) public tokenIdToDocumentMap;
mapping(address => bool) public permissedWriters;
struct Document {
address writer;
string text;
uint creationTime;
}
constructor(
address _mintableErc1155
) {
mintableErc1155 = ERC1155Mintable(_mintableErc1155);
}
event UpdatedDocument(
uint256 indexed tokenId,
address indexed writer,
string indexed key,
string text
);
function updatePermissedWriterStatus(address _writer, bool status) public onlyOwner {
permissedWriters[_writer] = status;
}
modifier onlyIfPermissed(address writer) {
require(permissedWriters[writer] == true, "writer can't write to registry");
_;
}
modifier onlyIfTokenExists(uint256 tokenId) {
require(mintableErc1155.ownerOf(tokenId) != address(0), "token doesn't exist");
_;
}
function writeDocuments(uint256 tokenId, string[] memory keys, string[] memory texts) public onlyIfTokenExists(tokenId) onlyIfPermissed(msg.sender) {
require(keys.length == texts.length, "tokenIds and txHashes size mismatch");
for (uint256 i = 0; i < keys.length; ++i) {
string memory key = keys[i];
string memory text = texts[i];
tokenIdToDocumentMap[tokenId][key] = Document(msg.sender, text, block.timestamp);
emit UpdatedDocument(tokenId, msg.sender, key, text);
}
}
}pragma solidity ^0.7.0;
contract MixinSignature {
function splitSignature(bytes memory sig)
public pure returns (bytes32 r, bytes32 s, uint8 v)
{
require(sig.length == 65, "invalid signature length");
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
if (v < 27) v += 27;
}
function isSigned(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s) public pure returns (bool) {
return _isSigned(_address, messageHash, v, r, s) || _isSignedPrefixed(_address, messageHash, v, r, s);
}
function _isSigned(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s)
internal pure returns (bool)
{
return ecrecover(messageHash, v, r, s) == _address;
}
function _isSignedPrefixed(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s)
internal pure returns (bool)
{
bytes memory prefix = "\x19Ethereum Signed Message:\n32";
return _isSigned(_address, keccak256(abi.encodePacked(prefix, messageHash)), v, r, s);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract MixinPausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
function setRoleAdmin(bytes32 role, bytes32 adminRole) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}pragma solidity ^0.7.0;
import "./LibRichErrors.sol";
import "./LibSafeMathRichErrors.sol";
library LibSafeMath {
function safeMul(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
if (a == 0) {
return 0;
}
uint256 c = a * b;
if (c / a != b) {
LibRichErrors.rrevert(LibSafeMathRichErrors.Uint256BinOpError(
LibSafeMathRichErrors.BinOpErrorCodes.MULTIPLICATION_OVERFLOW,
a,
b
));
}
return c;
}
function safeDiv(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
if (b == 0) {
LibRichErrors.rrevert(LibSafeMathRichErrors.Uint256BinOpError(
LibSafeMathRichErrors.BinOpErrorCodes.DIVISION_BY_ZERO,
a,
b
));
}
uint256 c = a / b;
return c;
}
function safeSub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
if (b > a) {
LibRichErrors.rrevert(LibSafeMathRichErrors.Uint256BinOpError(
LibSafeMathRichErrors.BinOpErrorCodes.SUBTRACTION_UNDERFLOW,
a,
b
));
}
return a - b;
}
function safeAdd(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
uint256 c = a + b;
if (c < a) {
LibRichErrors.rrevert(LibSafeMathRichErrors.Uint256BinOpError(
LibSafeMathRichErrors.BinOpErrorCodes.ADDITION_OVERFLOW,
a,
b
));
}
return c;
}
function max256(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
return a < b ? a : b;
}
}pragma solidity ^0.7.0;
import "./library/LibSafeMath.sol";
import "./library/LibAddress.sol";
import "./ERC1155.sol";
import "./interface/IERC1155Mintable.sol";
import "./mixin/MixinOwnable.sol";
import "./mixin/MixinContractURI.sol";
import "./mixin/MixinTokenURI.sol";
/// @dev Mintable form of ERC1155
/// Shows how easy it is to mint new items
contract ERC1155Mintable is
IERC1155Mintable,
ERC1155,
MixinContractURI,
MixinTokenURI
{
using LibSafeMath for uint256;
using LibAddress for address;
uint256 internal nonce;
/// mapping from token to max index
mapping (uint256 => uint256) public maxIndex;
mapping (uint256 => mapping(address => bool)) internal creatorApproval;
modifier onlyCreator(uint256 _id) {
require(creatorApproval[_id][msg.sender], "not an approved creator of id");
_;
}
function setCreatorApproval(uint256 id, address creator, bool status) external onlyCreator(id) {
creatorApproval[id][creator] = status;
}
/// @dev creates a new token
/// @param isNF is non-fungible token
/// @return type_ of token (a unique identifier)
function create(
bool isNF
)
external
override
onlyOwner()
returns (uint256 type_)
{
// Store the type in the upper 128 bits
type_ = (++nonce << 128);
// Set a flag if this is an NFI.
if (isNF) {
type_ = type_ | TYPE_NF_BIT;
}
creatorApproval[type_][msg.sender] = true;
// emit a Transfer event with Create semantic to help with discovery.
emit TransferSingle(
msg.sender,
address(0x0),
address(0x0),
type_,
0
);
emit URI(uri(type_), type_);
}
/// @dev creates a new token
/// @param type_ of token
function createWithType(
uint256 type_
)
external
onlyOwner()
{
creatorApproval[type_][msg.sender] = true;
// emit a Transfer event with Create semantic to help with discovery.
emit TransferSingle(
msg.sender,
address(0x0),
address(0x0),
type_,
0
);
emit URI(uri(type_), type_);
}
/// @dev mints fungible tokens
/// @param id token type
/// @param to beneficiaries of minted tokens
/// @param quantities amounts of minted tokens
function mintFungible(
uint256 id,
address[] calldata to,
uint256[] calldata quantities
)
external
override
onlyCreator(id)
{
// sanity checks
require(
isFungible(id),
"TRIED_TO_MINT_FUNGIBLE_FOR_NON_FUNGIBLE_TOKEN"
);
// mint tokens
for (uint256 i = 0; i < to.length; ++i) {
// cache to reduce number of loads
address dst = to[i];
uint256 quantity = quantities[i];
// Grant the items to the caller
balances[id][dst] = quantity.safeAdd(balances[id][dst]);
// Emit the Transfer/Mint event.
// the 0x0 source address implies a mint
// It will also provide the circulating supply info.
emit TransferSingle(
msg.sender,
address(0x0),
dst,
id,
quantity
);
// if `to` is a contract then trigger its callback
if (dst.isContract()) {
bytes4 callbackReturnValue = IERC1155Receiver(dst).onERC1155Received(
msg.sender,
msg.sender,
id,
quantity,
""
);
require(
callbackReturnValue == ERC1155_RECEIVED,
"BAD_RECEIVER_RETURN_VALUE"
);
}
}
}
/// @dev mints a non-fungible token
/// @param type_ token type
/// @param to beneficiaries of minted tokens
function mintNonFungible(
uint256 type_,
address[] calldata to
)
external
override
onlyCreator(type_)
{
require(
isNonFungible(type_),
"TRIED_TO_MINT_NON_FUNGIBLE_FOR_FUNGIBLE_TOKEN"
);
// Index are 1-based.
uint256 index = maxIndex[type_] + 1;
for (uint256 i = 0; i < to.length; ++i) {
// cache to reduce number of loads
address dst = to[i];
uint256 id = type_ | index + i;
nfOwners[id] = dst;
// You could use base-type id to store NF type balances if you wish.
balances[type_][dst] = balances[type_][dst].safeAdd(1);
emit TransferSingle(msg.sender, address(0x0), dst, id, 1);
// if `to` is a contract then trigger its callback
if (dst.isContract()) {
bytes4 callbackReturnValue = IERC1155Receiver(dst).onERC1155Received(
msg.sender,
msg.sender,
id,
1,
""
);
require(
callbackReturnValue == ERC1155_RECEIVED,
"BAD_RECEIVER_RETURN_VALUE"
);
}
}
// record the `maxIndex` of this nft type
// this allows us to mint more nft's of this type in a subsequent call.
maxIndex[type_] = to.length.safeAdd(maxIndex[type_]);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}pragma solidity ^0.7.0;
library LibRichErrors {
// bytes4(keccak256("Error(string)"))
bytes4 internal constant STANDARD_ERROR_SELECTOR =
0x08c379a0;
// solhint-disable func-name-mixedcase
/// @dev ABI encode a standard, string revert error payload.
/// This is the same payload that would be included by a `revert(string)`
/// solidity statement. It has the function signature `Error(string)`.
/// @param message The error string.
/// @return The ABI encoded error.
function StandardError(
string memory message
)
internal
pure
returns (bytes memory)
{
return abi.encodeWithSelector(
STANDARD_ERROR_SELECTOR,
bytes(message)
);
}
// solhint-enable func-name-mixedcase
/// @dev Reverts an encoded rich revert reason `errorData`.
/// @param errorData ABI encoded error data.
function rrevert(bytes memory errorData)
internal
pure
{
assembly {
revert(add(errorData, 0x20), mload(errorData))
}
}
}pragma solidity ^0.7.0;
library LibSafeMathRichErrors {
// bytes4(keccak256("Uint256BinOpError(uint8,uint256,uint256)"))
bytes4 internal constant UINT256_BINOP_ERROR_SELECTOR =
0xe946c1bb;
// bytes4(keccak256("Uint256DowncastError(uint8,uint256)"))
bytes4 internal constant UINT256_DOWNCAST_ERROR_SELECTOR =
0xc996af7b;
enum BinOpErrorCodes {
ADDITION_OVERFLOW,
MULTIPLICATION_OVERFLOW,
SUBTRACTION_UNDERFLOW,
DIVISION_BY_ZERO
}
enum DowncastErrorCodes {
VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT32,
VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT64,
VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT96
}
// solhint-disable func-name-mixedcase
function Uint256BinOpError(
BinOpErrorCodes errorCode,
uint256 a,
uint256 b
)
internal
pure
returns (bytes memory)
{
return abi.encodeWithSelector(
UINT256_BINOP_ERROR_SELECTOR,
errorCode,
a,
b
);
}
function Uint256DowncastError(
DowncastErrorCodes errorCode,
uint256 a
)
internal
pure
returns (bytes memory)
{
return abi.encodeWithSelector(
UINT256_DOWNCAST_ERROR_SELECTOR,
errorCode,
a
);
}
}pragma solidity ^0.7.0;
/**
* Utility library of inline functions on addresses
*/
library LibAddress {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solium-disable-next-line security/no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}pragma solidity ^0.7.0;
import "./library/LibSafeMath.sol";
import "./library/LibAddress.sol";
import "./interface/IERC1155.sol";
import "./interface/IERC1155Receiver.sol";
import "./mixin/MixinNonFungibleToken.sol";
import "./mixin/MixinOwnable.sol";
import "./WhitelistExchangesProxy.sol";
contract ERC1155 is
IERC1155,
MixinNonFungibleToken,
Ownable
{
using LibAddress for address;
using LibSafeMath for uint256;
// selectors for receiver callbacks
bytes4 constant public ERC1155_RECEIVED = 0xf23a6e61;
bytes4 constant public ERC1155_BATCH_RECEIVED = 0xbc197c81;
// id => (owner => balance)
mapping (uint256 => mapping(address => uint256)) internal balances;
// owner => (operator => approved)
mapping (address => mapping(address => bool)) internal operatorApproval;
address public exchangesRegistry;
function setExchangesRegistry(address newExchangesRegistry) external onlyOwner() {
exchangesRegistry = newExchangesRegistry;
}
/// @notice Transfers value amount of an _id from the _from address to the _to address specified.
/// @dev MUST emit TransferSingle event on success.
/// Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
/// MUST throw if `_to` is the zero address.
/// MUST throw if balance of sender for token `_id` is lower than the `_value` sent.
/// MUST throw on any other error.
/// When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0).
/// If so, it MUST call `onERC1155Received` on `_to` and revert if the return value
/// is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`.
/// @param from Source address
/// @param to Target address
/// @param id ID of the token type
/// @param value Transfer amount
/// @param data Additional data with no specified format, sent in call to `_to`
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 value,
bytes calldata data
)
override
external
{
// sanity checks
require(
to != address(0x0),
"CANNOT_TRANSFER_TO_ADDRESS_ZERO"
);
require(
from == msg.sender || isApprovedForAll(from, msg.sender),
"INSUFFICIENT_ALLOWANCE"
);
// perform transfer
if (isNonFungible(id)) {
require(
value == 1,
"AMOUNT_EQUAL_TO_ONE_REQUIRED"
);
require(
nfOwners[id] == from,
"NFT_NOT_OWNED_BY_FROM_ADDRESS"
);
nfOwners[id] = to;
// You could keep balance of NF type in base type id like so:
// uint256 baseType = getNonFungibleBaseType(_id);
// balances[baseType][_from] = balances[baseType][_from].safeSub(_value);
// balances[baseType][_to] = balances[baseType][_to].safeAdd(_value);
} else {
balances[id][from] = balances[id][from].safeSub(value);
balances[id][to] = balances[id][to].safeAdd(value);
}
emit TransferSingle(msg.sender, from, to, id, value);
// if `to` is a contract then trigger its callback
if (to.isContract()) {
bytes4 callbackReturnValue = IERC1155Receiver(to).onERC1155Received(
msg.sender,
from,
id,
value,
data
);
require(
callbackReturnValue == ERC1155_RECEIVED,
"BAD_RECEIVER_RETURN_VALUE"
);
}
}
/// @notice Send multiple types of Tokens from a 3rd party in one transfer (with safety call).
/// @dev MUST emit TransferBatch event on success.
/// Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
/// MUST throw if `_to` is the zero address.
/// MUST throw if length of `_ids` is not the same as length of `_values`.
/// MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_values` sent.
/// MUST throw on any other error.
/// When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0).
/// If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return value
/// is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`.
/// @param from Source addresses
/// @param to Target addresses
/// @param ids IDs of each token type
/// @param values Transfer amounts per token type
/// @param data Additional data with no specified format, sent in call to `_to`
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
)
override
external
{
// sanity checks
require(
to != address(0x0),
"CANNOT_TRANSFER_TO_ADDRESS_ZERO"
);
require(
ids.length == values.length,
"TOKEN_AND_VALUES_LENGTH_MISMATCH"
);
// Only supporting a global operator approval allows us to do
// only 1 check and not to touch storage to handle allowances.
require(
from == msg.sender || isApprovedForAll(from, msg.sender),
"INSUFFICIENT_ALLOWANCE"
);
// perform transfers
for (uint256 i = 0; i < ids.length; ++i) {
// Cache value to local variable to reduce read costs.
uint256 id = ids[i];
uint256 value = values[i];
if (isNonFungible(id)) {
require(
value == 1,
"AMOUNT_EQUAL_TO_ONE_REQUIRED"
);
require(
nfOwners[id] == from,
"NFT_NOT_OWNED_BY_FROM_ADDRESS"
);
nfOwners[id] = to;
} else {
balances[id][from] = balances[id][from].safeSub(value);
balances[id][to] = balances[id][to].safeAdd(value);
}
}
emit TransferBatch(msg.sender, from, to, ids, values);
// if `to` is a contract then trigger its callback
if (to.isContract()) {
bytes4 callbackReturnValue = IERC1155Receiver(to).onERC1155BatchReceived(
msg.sender,
from,
ids,
values,
data
);
require(
callbackReturnValue == ERC1155_BATCH_RECEIVED,
"BAD_RECEIVER_RETURN_VALUE"
);
}
}
/// @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
/// @dev MUST emit the ApprovalForAll event on success.
/// @param operator Address to add to the set of authorized operators
/// @param approved True if the operator is approved, false to revoke approval
function setApprovalForAll(address operator, bool approved) external override {
operatorApproval[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
/// @notice Queries the approval status of an operator for a given owner.
/// @param owner The owner of the Tokens
/// @param operator Address of authorized operator
/// @return True if the operator is approved, false if not
function isApprovedForAll(address owner, address operator) public override view returns (bool) {
bool approved = operatorApproval[owner][operator];
if (!approved && exchangesRegistry != address(0)) {
return WhitelistExchangesProxy(exchangesRegistry).isAddressWhitelisted(operator) == true;
}
return approved;
}
/// @notice Get the balance of an account's Tokens.
/// @param owner The address of the token holder
/// @param id ID of the Token
/// @return The _owner's balance of the Token type requested
function balanceOf(address owner, uint256 id) external override view returns (uint256) {
if (isNonFungibleItem(id)) {
return nfOwners[id] == owner ? 1 : 0;
}
return balances[id][owner];
}
/// @notice Get the balance of multiple account/token pairs
/// @param owners The addresses of the token holders
/// @param ids ID of the Tokens
/// @return balances_ The _owner's balance of the Token types requested
function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) external override view returns (uint256[] memory balances_) {
// sanity check
require(
owners.length == ids.length,
"OWNERS_AND_IDS_MUST_HAVE_SAME_LENGTH"
);
// get balances
balances_ = new uint256[](owners.length);
for (uint256 i = 0; i < owners.length; ++i) {
uint256 id = ids[i];
if (isNonFungibleItem(id)) {
balances_[i] = nfOwners[id] == owners[i] ? 1 : 0;
} else {
balances_[i] = balances[id][owners[i]];
}
}
return balances_;
}
bytes4 constant private INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7;
bytes4 constant private INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26;
function supportsInterface(bytes4 _interfaceID) external view returns (bool) {
if (_interfaceID == INTERFACE_SIGNATURE_ERC165 ||
_interfaceID == INTERFACE_SIGNATURE_ERC1155) {
return true;
}
return false;
}
}/*
Copyright 2019 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.7.0;
import "./IERC1155.sol";
/// @dev Mintable form of ERC1155
/// Shows how easy it is to mint new items
interface IERC1155Mintable is
IERC1155
{
/// @dev creates a new token
/// @param isNF is non-fungible token
/// @return type_ of token (a unique identifier)
function create(
bool isNF
)
external
returns (uint256 type_);
/// @dev mints fungible tokens
/// @param id token type
/// @param to beneficiaries of minted tokens
/// @param quantities amounts of minted tokens
function mintFungible(
uint256 id,
address[] calldata to,
uint256[] calldata quantities
)
external;
/// @dev mints a non-fungible token
/// @param type_ token type
/// @param to beneficiaries of minted tokens
function mintNonFungible(
uint256 type_,
address[] calldata to
)
external;
}pragma solidity ^0.7.0;
import "./MixinOwnable.sol";
contract MixinContractURI is Ownable {
string public contractURI;
function setContractURI(string calldata newContractURI) external onlyOwner() {
contractURI = newContractURI;
}
}pragma solidity ^0.7.0;
import "./MixinOwnable.sol";
import "../library/LibString.sol";
contract MixinTokenURI is Ownable {
using LibString for string;
string public baseMetadataURI = "";
function setBaseMetadataURI(string memory newBaseMetadataURI) public onlyOwner() {
baseMetadataURI = newBaseMetadataURI;
}
function uri(uint256 _id) public view returns (string memory) {
return LibString.strConcat(
baseMetadataURI,
LibString.uint2hexstr(_id)
);
}
}/*
Copyright 2019 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.7.0;
/// @title ERC-1155 Multi Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md
/// Note: The ERC-165 identifier for this interface is 0xd9b67a26.
interface IERC1155 {
/// @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred,
/// including zero value transfers as well as minting or burning.
/// Operator will always be msg.sender.
/// Either event from address `0x0` signifies a minting operation.
/// An event to address `0x0` signifies a burning or melting operation.
/// The total value transferred from address 0x0 minus the total value transferred to 0x0 may
/// be used by clients and exchanges to be added to the "circulating supply" for a given token ID.
/// To define a token ID with no initial balance, the contract SHOULD emit the TransferSingle event
/// from `0x0` to `0x0`, with the token creator as `_operator`.
event TransferSingle(
address indexed _operator,
address indexed _from,
address indexed _to,
uint256 _id,
uint256 _value
);
/// @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred,
/// including zero value transfers as well as minting or burning.
///Operator will always be msg.sender.
/// Either event from address `0x0` signifies a minting operation.
/// An event to address `0x0` signifies a burning or melting operation.
/// The total value transferred from address 0x0 minus the total value transferred to 0x0 may
/// be used by clients and exchanges to be added to the "circulating supply" for a given token ID.
/// To define multiple token IDs with no initial balance, this SHOULD emit the TransferBatch event
/// from `0x0` to `0x0`, with the token creator as `_operator`.
event TransferBatch(
address indexed _operator,
address indexed _from,
address indexed _to,
uint256[] _ids,
uint256[] _values
);
/// @dev MUST emit when an approval is updated.
event ApprovalForAll(
address indexed _owner,
address indexed _operator,
bool _approved
);
/// @dev MUST emit when the URI is updated for a token ID.
/// URIs are defined in RFC 3986.
/// The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata JSON Schema".
event URI(
string _value,
uint256 indexed _id
);
/// @notice Transfers value amount of an _id from the _from address to the _to address specified.
/// @dev MUST emit TransferSingle event on success.
/// Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
/// MUST throw if `_to` is the zero address.
/// MUST throw if balance of sender for token `_id` is lower than the `_value` sent.
/// MUST throw on any other error.
/// When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0).
/// If so, it MUST call `onERC1155Received` on `_to` and revert if the return value
/// is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`.
/// @param from Source address
/// @param to Target address
/// @param id ID of the token type
/// @param value Transfer amount
/// @param data Additional data with no specified format, sent in call to `_to`
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 value,
bytes calldata data
)
external;
/// @notice Send multiple types of Tokens from a 3rd party in one transfer (with safety call).
/// @dev MUST emit TransferBatch event on success.
/// Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
/// MUST throw if `_to` is the zero address.
/// MUST throw if length of `_ids` is not the same as length of `_values`.
/// MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_values` sent.
/// MUST throw on any other error.
/// When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0).
/// If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return value
/// is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`.
/// @param from Source addresses
/// @param to Target addresses
/// @param ids IDs of each token type
/// @param values Transfer amounts per token type
/// @param data Additional data with no specified format, sent in call to `_to`
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
)
external;
/// @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
/// @dev MUST emit the ApprovalForAll event on success.
/// @param operator Address to add to the set of authorized operators
/// @param approved True if the operator is approved, false to revoke approval
function setApprovalForAll(address operator, bool approved) external;
/// @notice Queries the approval status of an operator for a given owner.
/// @param owner The owner of the Tokens
/// @param operator Address of authorized operator
/// @return True if the operator is approved, false if not
function isApprovedForAll(address owner, address operator) external view returns (bool);
/// @notice Get the balance of an account's Tokens.
/// @param owner The address of the token holder
/// @param id ID of the Token
/// @return The _owner's balance of the Token type requested
function balanceOf(address owner, uint256 id) external view returns (uint256);
/// @notice Get the balance of multiple account/token pairs
/// @param owners The addresses of the token holders
/// @param ids ID of the Tokens
/// @return balances_ The _owner's balance of the Token types requested
function balanceOfBatch(
address[] calldata owners,
uint256[] calldata ids
)
external
view
returns (uint256[] memory balances_);
}/*
Copyright 2019 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.7.0;
interface IERC1155Receiver {
/// @notice Handle the receipt of a single ERC1155 token type
/// @dev The smart contract calls this function on the recipient
/// after a `safeTransferFrom`. This function MAY throw to revert and reject the
/// transfer. Return of other than the magic value MUST result in the
///transaction being reverted
/// Note: the contract address is always the message sender
/// @param operator The address which called `safeTransferFrom` function
/// @param from The address which previously owned the token
/// @param id An array containing the ids of the token being transferred
/// @param value An array containing the amount of tokens being transferred
/// @param data Additional data with no specified format
/// @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
)
external
returns(bytes4);
/// @notice Handle the receipt of multiple ERC1155 token types
/// @dev The smart contract calls this function on the recipient
/// after a `safeTransferFrom`. This function MAY throw to revert and reject the
/// transfer. Return of other than the magic value MUST result in the
/// transaction being reverted
/// Note: the contract address is always the message sender
/// @param operator The address which called `safeTransferFrom` function
/// @param from The address which previously owned the token
/// @param ids An array containing ids of each token being transferred
/// @param values An array containing amounts of each token being transferred
/// @param data Additional data with no specified format
/// @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
)
external
returns(bytes4);
}pragma solidity ^0.7.0;
contract MixinNonFungibleToken {
uint256 constant internal TYPE_MASK = uint256(uint128(~0)) << 128;
uint256 constant internal NF_INDEX_MASK = uint128(~0);
uint256 constant internal TYPE_NF_BIT = 1 << 255;
mapping (uint256 => address) internal nfOwners;
/// @dev Returns true if token is non-fungible
function isNonFungible(uint256 id) public pure returns(bool) {
return id & TYPE_NF_BIT == TYPE_NF_BIT;
}
/// @dev Returns true if token is fungible
function isFungible(uint256 id) public pure returns(bool) {
return id & TYPE_NF_BIT == 0;
}
/// @dev Returns index of non-fungible token
function getNonFungibleIndex(uint256 id) public pure returns(uint256) {
return id & NF_INDEX_MASK;
}
/// @dev Returns base type of non-fungible token
function getNonFungibleBaseType(uint256 id) public pure returns(uint256) {
return id & TYPE_MASK;
}
/// @dev Returns true if input is base-type of a non-fungible token
function isNonFungibleBaseType(uint256 id) public pure returns(bool) {
// A base type has the NF bit but does not have an index.
return (id & TYPE_NF_BIT == TYPE_NF_BIT) && (id & NF_INDEX_MASK == 0);
}
/// @dev Returns true if input is a non-fungible token
function isNonFungibleItem(uint256 id) public pure returns(bool) {
// A base type has the NF bit but does has an index.
return (id & TYPE_NF_BIT == TYPE_NF_BIT) && (id & NF_INDEX_MASK != 0);
}
/// @dev returns owner of a non-fungible token
function ownerOf(uint256 id) public view returns (address) {
return nfOwners[id];
}
}pragma solidity ^0.7.0;
import "./mixin/MixinOwnable.sol";
contract WhitelistExchangesProxy is Ownable {
mapping(address => bool) internal proxies;
bool public paused = true;
function setPaused(bool newPaused) external onlyOwner() {
paused = newPaused;
}
function updateProxyAddress(address proxy, bool status) external onlyOwner() {
proxies[proxy] = status;
}
function isAddressWhitelisted(address proxy) external view returns (bool) {
if (paused) {
return false;
} else {
return proxies[proxy];
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _txOrigin() internal view virtual returns (address) {
return tx.origin;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}pragma solidity ^0.7.0;
library LibString {
// via https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory) {
bytes memory _ba = bytes(_a);
bytes memory _bb = bytes(_b);
bytes memory _bc = bytes(_c);
bytes memory _bd = bytes(_d);
bytes memory _be = bytes(_e);
string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
bytes memory babcde = bytes(abcde);
uint k = 0;
for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i];
for (uint i = 0; i < _bb.length; i++) babcde[k++] = _bb[i];
for (uint i = 0; i < _bc.length; i++) babcde[k++] = _bc[i];
for (uint i = 0; i < _bd.length; i++) babcde[k++] = _bd[i];
for (uint i = 0; i < _be.length; i++) babcde[k++] = _be[i];
return string(babcde);
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d) internal pure returns (string memory) {
return strConcat(_a, _b, _c, _d, "");
}
function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory) {
return strConcat(_a, _b, _c, "", "");
}
function strConcat(string memory _a, string memory _b) internal pure returns (string memory) {
return strConcat(_a, _b, "", "", "");
}
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
if (_i == 0) {
return "0";
}
uint j = _i;
uint len;
while (j != 0) {
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint k = len - 1;
while (_i != 0) {
bstr[k--] = byte(uint8(48 + _i % 10));
_i /= 10;
}
return string(bstr);
}
function uint2hexstr(uint i) internal pure returns (string memory) {
if (i == 0) {
return "0";
}
uint j = i;
uint len;
while (j != 0) {
len++;
j = j >> 4;
}
uint mask = 15;
bytes memory bstr = new bytes(len);
uint k = len - 1;
while (i != 0){
uint curr = (i & mask);
bstr[k--] = curr > 9 ? byte(uint8(55 + curr)) : byte(uint8(48 + curr));
i = i >> 4;
}
return string(bstr);
}
}{
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_accessControl","type":"address"},{"internalType":"address","name":"_permissionedTokenMetadataRegistry","type":"address"},{"internalType":"address payable","name":"_historianTipJar","type":"address"},{"internalType":"address","name":"_tipToken","type":"address"},{"internalType":"bytes32","name":"_organizerRole","type":"bytes32"},{"internalType":"bytes32","name":"_historianRole","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":true,"internalType":"string","name":"key","type":"string"},{"indexed":false,"internalType":"bytes32","name":"affirmationHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"salt","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"signature","type":"bytes"}],"name":"Affirmed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"writeHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"tipper","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"signature","type":"bytes"}],"name":"Tipped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accessControl","outputs":[{"internalType":"contract IAccessControl","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"affirmationHashRegistry","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_writeHash","type":"bytes32"},{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SnapshotAffirmationWriter.Affirmation","name":"_affirmation","type":"tuple"}],"name":"getAffirmationHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"internalType":"bytes32","name":"writeHash","type":"bytes32"},{"internalType":"address","name":"tipper","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SnapshotAffirmationWriter.Tip","name":"_tip","type":"tuple"}],"name":"getTipHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"key","type":"string"},{"internalType":"string","name":"text","type":"string"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct SnapshotAffirmationWriter.Write","name":"_write","type":"tuple"}],"name":"getWriteHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"historianRole","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"historianTipJar","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32","name":"messageHash","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"isSigned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"minimumQuorumAffirmations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"organizerRole","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permissionedTokenMetadataRegistry","outputs":[{"internalType":"contract PermissionedTokenMetadataRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"writeHash","type":"bytes32"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"internalType":"bytes32","name":"writeHash","type":"bytes32"},{"internalType":"address","name":"tipper","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SnapshotAffirmationWriter.Tip","name":"_tip","type":"tuple"}],"name":"settleTip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"splitSignature","outputs":[{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"tipHashRegistry","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tipToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_historianTipJar","type":"address"}],"name":"updateHistorianTipJar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minimumQuorumAffirmations","type":"uint256"}],"name":"updateMinimumQuorumAffirmations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"writeHash","type":"bytes32"},{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SnapshotAffirmationWriter.Affirmation","name":"_affirmation","type":"tuple"}],"name":"verifyAffirmation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"internalType":"bytes32","name":"writeHash","type":"bytes32"},{"internalType":"address","name":"tipper","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SnapshotAffirmationWriter.Tip","name":"_tip","type":"tuple"}],"name":"verifyTip","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"key","type":"string"},{"internalType":"string","name":"text","type":"string"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct SnapshotAffirmationWriter.Write","name":"_write","type":"tuple"},{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SnapshotAffirmationWriter.Affirmation[]","name":"_affirmations","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"internalType":"bytes32","name":"writeHash","type":"bytes32"},{"internalType":"address","name":"tipper","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SnapshotAffirmationWriter.Tip","name":"_tip","type":"tuple"}],"name":"write","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e06040523480156200001157600080fd5b5060405162002e4738038062002e478339818101604052810190620000379190620001ae565b8560008060006101000a81548160ff02191690831515021790555080600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505084600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081608081815250508060a0818152505083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff1660601b81525050505050505050620002e4565b6000815190506200017a8162000296565b92915050565b6000815190506200019181620002b0565b92915050565b600081519050620001a881620002ca565b92915050565b60008060008060008060c08789031215620001c857600080fd5b6000620001d889828a0162000169565b9650506020620001eb89828a0162000169565b9550506040620001fe89828a0162000180565b94505060606200021189828a0162000169565b93505060806200022489828a0162000197565b92505060a06200023789828a0162000197565b9150509295509295509295565b6000620002518262000276565b9050919050565b6000620002658262000276565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b620002a18162000244565b8114620002ad57600080fd5b50565b620002bb8162000258565b8114620002c757600080fd5b50565b620002d5816200026c565b8114620002e157600080fd5b50565b60805160a05160c05160601c612b10620003376000398061076c5280610f6e52508061067752806109d95280610b9652508061064152806106b152806106fd52806107b652806109695250612b106000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c806382d9805b116100c3578063a7bb58031161007c578063a7bb5803146103cb578063ab651850146103fd578063d2ee1e5e14610419578063de951dad14610437578063eb4aa17e14610467578063ffa1ad741461048357610158565b806382d9805b146102f55780638456cb59146103135780638677ebe81461031d57806394cb900e1461034d57806398f9772a1461036b578063a650f1c21461039b57610158565b806332e96bb31161011557806332e96bb3146102455780633f4ba83a146102615780635c975abb1461026b5780636243db18146102895780636581b897146102a75780636f049e20146102d757610158565b80630a0332f31461015d578063109c494e1461018d57806313007d55146101ab57806313b846d7146101c95780632eab99c5146101f95780632f8c51a714610229575b600080fd5b61017760048036038101906101729190611adf565b6104a1565b6040516101849190612393565b60405180910390f35b6101956104ff565b6040516101a29190612326565b60405180910390f35b6101b3610525565b6040516101c09190612493565b60405180910390f35b6101e360048036038101906101de91906119b5565b61054b565b6040516101f09190612378565b60405180910390f35b610213600480360381019061020e9190611a9e565b6105eb565b6040516102209190612393565b60405180910390f35b610243600480360381019061023e9190611bbc565b61063f565b005b61025f600480360381019061025a9190611a09565b610675565b005b6102696106af565b005b6102736106e5565b6040516102809190612378565b60405180910390f35b6102916106fb565b60405161029e9190612393565b60405180910390f35b6102c160048036038101906102bc91906119b5565b61071f565b6040516102ce9190612393565b60405180910390f35b6102df61076a565b6040516102ec91906124ae565b60405180910390f35b6102fd61078e565b60405161030a91906124c9565b60405180910390f35b61031b6107b4565b005b610337600480360381019061033291906118ec565b6107ea565b6040516103449190612378565b60405180910390f35b610355610818565b6040516103629190612646565b60405180910390f35b6103856004803603810190610380919061198c565b61081e565b6040516103929190612378565b60405180910390f35b6103b560048036038101906103b09190611a9e565b61083e565b6040516103c29190612378565b60405180910390f35b6103e560048036038101906103e09190611a5d565b6108ec565b6040516103f4939291906123d7565b60405180910390f35b610417600480360381019061041291906118c3565b610967565b005b6104216109d7565b60405161042e9190612393565b60405180910390f35b610451600480360381019061044c919061198c565b6109fb565b60405161045e9190612378565b60405180910390f35b610481600480360381019061047c9190611b20565b610a1b565b005b61048b610ce6565b6040516104989190612646565b60405180910390f35b600081600001358280602001906104b8919061272f565b8480604001906104c8919061272f565b86606001356040516020016104e2969594939291906122c1565b604051602081830303815290604052805190602001209050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080610558848461071f565b905060008060006105ba86806040019061057291906126d8565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506108ec565b9250925092506105df8660200160208101906105d6919061189a565b858386866107ea565b94505050505092915050565b60008160000135826020013583604001602081019061060a919061189a565b84606001356040516020016106229493929190612273565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000061066a8133610ceb565b816002819055505050565b7f00000000000000000000000000000000000000000000000000000000000000006106a08133610ceb565b6106aa8383610e2b565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006106da8133610ceb565b6106e26110d5565b50565b60008060009054906101000a900460ff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b600082826020016020810190610735919061189a565b836000013560405160200161074c939291906121bb565b60405160208183030381529060405280519060200120905092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f00000000000000000000000000000000000000000000000000000000000000006107df8133610ceb565b6107e7611176565b50565b60006107f98686868686611218565b8061080d575061080c86868686866112a2565b5b905095945050505050565b60025481565b60056020528060005260406000206000915054906101000a900460ff1681565b60008061084a836105eb565b905060008060006108ac86806080019061086491906126d8565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506108ec565b925092509250600286600001351480156108e157506108e08660400160208101906108d7919061189a565b858386866107ea565b5b945050505050919050565b60008060006041845114610935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092c90612606565b60405180910390fd5b6020840151925060408401519150606084015160001a9050601b8160ff16101561096057601b810190505b9193909250565b7f00000000000000000000000000000000000000000000000000000000000000006109928133610ceb565b81600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60046020528060005260406000206000915054906101000a900460ff1681565b610a236106e5565b15610a63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5a90612586565b60405180910390fd5b6000610a6e856104a1565b90506000805b85859050811015610c855736868683818110610a8c57fe5b9050602002810190610a9e9190612786565b90506000610aac858361071f565b9050600015156004600083815260200190815260200160002060009054906101000a900460ff16151514610b15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0c906125c6565b60405180910390fd5b60016004600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060011515610b4f868461054b565b151514610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8890612566565b60405180910390fd5b610bcd7f0000000000000000000000000000000000000000000000000000000000000000836020016020810190610bc8919061189a565b610ceb565b8380600101945050888060200190610be5919061272f565b604051610bf3929190612220565b6040518091039020826020016020810190610c0e919061189a565b73ffffffffffffffffffffffffffffffffffffffff168a600001357f4f939e1e79b7839b1e037865222c2a81ee0b2e280f81850c00ed71d583cd9c8c848660000135878060400190610c6091906126d8565b604051610c70949392919061240e565b60405180910390a45050806001019050610a74565b50600254811015610ccb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc2906125a6565b60405180910390fd5b610cd48661131f565b610cde8284610e2b565b505050505050565b600281565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166391d1485483836040518363ffffffff1660e01b8152600401610d489291906123ae565b60206040518083038186803b158015610d6057600080fd5b505afa158015610d74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d989190611963565b610e2757610dbd8173ffffffffffffffffffffffffffffffffffffffff166014611531565b610dcb8360001c6020611531565b604051602001610ddc929190612239565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1e91906124e4565b60405180910390fd5b5050565b60008160600135146110d15780602001358214610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e74906125e6565b60405180910390fd5b6000610e88826105eb565b9050600015156005600083815260200190815260200160002060009054906101000a900460ff16151514610ef1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee890612526565b60405180910390fd5b60016005600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060011515610f2a8361083e565b151514610f6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6390612626565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd836040016020810190610fbb919061189a565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685606001356040518463ffffffff1660e01b815260040161100193929190612341565b602060405180830381600087803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110539190611963565b50816040016020810190611067919061189a565b73ffffffffffffffffffffffffffffffffffffffff1682602001357fba15ea7ef834bda8ee66fa6222e337710145a7e592d75421af7ad69b4f37d5e384606001358580608001906110b891906126d8565b6040516110c7939291906126a6565b60405180910390a3505b5050565b6110dd6106e5565b61111c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111390612546565b60405180910390fd5b60008060006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61115f611725565b60405161116c919061230b565b60405180910390a1565b61117e6106e5565b156111be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b590612586565b60405180910390fd5b60016000806101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611201611725565b60405161120e919061230b565b60405180910390a1565b60008573ffffffffffffffffffffffffffffffffffffffff1660018686868660405160008152602001604052604051611254949392919061244e565b6020604051602081039080840390855afa158015611276573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614905095945050505050565b600060606040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a33320000000081525090506113138782886040516020016112f59291906121f8565b60405160208183030381529060405280519060200120878787611218565b91505095945050505050565b6060600167ffffffffffffffff8111801561133957600080fd5b5060405190808252806020026020018201604052801561136d57816020015b60608152602001906001900390816113585790505b5090506060600167ffffffffffffffff8111801561138a57600080fd5b506040519080825280602002602001820160405280156113be57816020015b60608152602001906001900390816113a95790505b5090508280602001906113d1919061272f565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508260008151811061142157fe5b602002602001018190525082806040019061143c919061272f565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508160008151811061148c57fe5b6020026020010181905250600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636401dc8f846000013584846040518463ffffffff1660e01b81526004016114fa93929190612661565b600060405180830381600087803b15801561151457600080fd5b505af1158015611528573d6000803e3d6000fd5b50505050505050565b6060806002836002020167ffffffffffffffff8111801561155157600080fd5b506040519080825280601f01601f1916602001820160405280156115845781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106115b557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061161257fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002020190505b60018111156116d7577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061168557fe5b1a60f81b82828151811061169557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508060019003905061164d565b506000841461171b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171290612506565b60405180910390fd5b8091505092915050565b600033905090565b60008135905061173c81612a50565b92915050565b60008135905061175181612a67565b92915050565b60008083601f84011261176957600080fd5b8235905067ffffffffffffffff81111561178257600080fd5b60208301915083602082028301111561179a57600080fd5b9250929050565b6000815190506117b081612a7e565b92915050565b6000813590506117c581612a95565b92915050565b600082601f8301126117dc57600080fd5b81356117ef6117ea826127db565b6127aa565b9150808252602083016020830185838301111561180b57600080fd5b6118168382846129b6565b50505092915050565b60006060828403121561183157600080fd5b81905092915050565b600060a0828403121561184c57600080fd5b81905092915050565b60006080828403121561186757600080fd5b81905092915050565b60008135905061187f81612aac565b92915050565b60008135905061189481612ac3565b92915050565b6000602082840312156118ac57600080fd5b60006118ba8482850161172d565b91505092915050565b6000602082840312156118d557600080fd5b60006118e384828501611742565b91505092915050565b600080600080600060a0868803121561190457600080fd5b60006119128882890161172d565b9550506020611923888289016117b6565b945050604061193488828901611885565b9350506060611945888289016117b6565b9250506080611956888289016117b6565b9150509295509295909350565b60006020828403121561197557600080fd5b6000611983848285016117a1565b91505092915050565b60006020828403121561199e57600080fd5b60006119ac848285016117b6565b91505092915050565b600080604083850312156119c857600080fd5b60006119d6858286016117b6565b925050602083013567ffffffffffffffff8111156119f357600080fd5b6119ff8582860161181f565b9150509250929050565b60008060408385031215611a1c57600080fd5b6000611a2a858286016117b6565b925050602083013567ffffffffffffffff811115611a4757600080fd5b611a538582860161183a565b9150509250929050565b600060208284031215611a6f57600080fd5b600082013567ffffffffffffffff811115611a8957600080fd5b611a95848285016117cb565b91505092915050565b600060208284031215611ab057600080fd5b600082013567ffffffffffffffff811115611aca57600080fd5b611ad68482850161183a565b91505092915050565b600060208284031215611af157600080fd5b600082013567ffffffffffffffff811115611b0b57600080fd5b611b1784828501611855565b91505092915050565b60008060008060608587031215611b3657600080fd5b600085013567ffffffffffffffff811115611b5057600080fd5b611b5c87828801611855565b945050602085013567ffffffffffffffff811115611b7957600080fd5b611b8587828801611757565b9350935050604085013567ffffffffffffffff811115611ba457600080fd5b611bb08782880161183a565b91505092959194509250565b600060208284031215611bce57600080fd5b6000611bdc84828501611870565b91505092915050565b6000611bf18383611d97565b905092915050565b611c0281612914565b82525050565b611c11816128b5565b82525050565b611c20816128a3565b82525050565b611c37611c32826128a3565b6129f8565b82525050565b6000611c488261281b565b611c528185612849565b935083602082028501611c648561280b565b8060005b85811015611ca05784840389528151611c818582611be5565b9450611c8c8361283c565b925060208a01995050600181019050611c68565b50829750879550505050505092915050565b611cbb816128c7565b82525050565b611cca816128d3565b82525050565b611ce1611cdc826128d3565b612a0a565b82525050565b6000611cf3838561285a565b9350611d008385846129b6565b611d0983612a32565b840190509392505050565b6000611d1f82612826565b611d29818561286b565b9350611d398185602086016129c5565b80840191505092915050565b611d4e81612926565b82525050565b611d5d8161294a565b82525050565b611d6c8161296e565b82525050565b6000611d7e8385612898565b9350611d8b8385846129b6565b82840190509392505050565b6000611da282612831565b611dac8185612876565b9350611dbc8185602086016129c5565b611dc581612a32565b840191505092915050565b6000611ddb82612831565b611de58185612887565b9350611df58185602086016129c5565b611dfe81612a32565b840191505092915050565b6000611e1482612831565b611e1e8185612898565b9350611e2e8185602086016129c5565b80840191505092915050565b6000611e47602083612887565b91507f537472696e67733a20686578206c656e67746820696e73756666696369656e746000830152602082019050919050565b6000611e87601983612887565b91507f5469702068617320616c7265616479206265656e2075736564000000000000006000830152602082019050919050565b6000611ec7601483612887565b91507f5061757361626c653a206e6f74207061757365640000000000000000000000006000830152602082019050919050565b6000611f07602883612887565b91507f41666669726d6174696f6e20646f65736e277420686176652076616c6964207360008301527f69676e61747572650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611f6d601083612887565b91507f5061757361626c653a20706175736564000000000000000000000000000000006000830152602082019050919050565b6000611fad601c83612887565b91507f4d696e696d756d2061666669726d6174696f6e73206e6f74206d6574000000006000830152602082019050919050565b6000611fed602583612887565b91507f41666669726d6174696f6e2068617320616c7265616479206265656e2072656360008301527f65697665640000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612053601483612887565b91507f546970206973206e6f7420666f722077726974650000000000000000000000006000830152602082019050919050565b6000612093601783612898565b91507f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006000830152601782019050919050565b60006120d3601883612887565b91507f696e76616c6964207369676e6174757265206c656e67746800000000000000006000830152602082019050919050565b6000612113601183612898565b91507f206973206d697373696e6720726f6c65200000000000000000000000000000006000830152601182019050919050565b6000612153602083612887565b91507f54697020646f65736e277420686176652076616c6964207369676e61747572656000830152602082019050919050565b61218f816128fd565b82525050565b6121a66121a1826128fd565b612a26565b82525050565b6121b581612907565b82525050565b60006121c78286611cd0565b6020820191506121d78285611c26565b6014820191506121e78284612195565b602082019150819050949350505050565b60006122048285611d14565b91506122108284611cd0565b6020820191508190509392505050565b600061222d828486611d72565b91508190509392505050565b600061224482612086565b91506122508285611e09565b915061225b82612106565b91506122678284611e09565b91508190509392505050565b600061227f8287612195565b60208201915061228f8286611cd0565b60208201915061229f8285611c26565b6014820191506122af8284612195565b60208201915081905095945050505050565b60006122cd8289612195565b6020820191506122de828789611d72565b91506122eb828587611d72565b91506122f78284612195565b602082019150819050979650505050505050565b60006020820190506123206000830184611c17565b92915050565b600060208201905061233b6000830184611c08565b92915050565b60006060820190506123566000830186611c17565b6123636020830185611bf9565b6123706040830184612186565b949350505050565b600060208201905061238d6000830184611cb2565b92915050565b60006020820190506123a86000830184611cc1565b92915050565b60006040820190506123c36000830185611cc1565b6123d06020830184611c17565b9392505050565b60006060820190506123ec6000830186611cc1565b6123f96020830185611cc1565b61240660408301846121ac565b949350505050565b60006060820190506124236000830187611cc1565b6124306020830186612186565b8181036040830152612443818486611ce7565b905095945050505050565b60006080820190506124636000830187611cc1565b61247060208301866121ac565b61247d6040830185611cc1565b61248a6060830184611cc1565b95945050505050565b60006020820190506124a86000830184611d45565b92915050565b60006020820190506124c36000830184611d54565b92915050565b60006020820190506124de6000830184611d63565b92915050565b600060208201905081810360008301526124fe8184611dd0565b905092915050565b6000602082019050818103600083015261251f81611e3a565b9050919050565b6000602082019050818103600083015261253f81611e7a565b9050919050565b6000602082019050818103600083015261255f81611eba565b9050919050565b6000602082019050818103600083015261257f81611efa565b9050919050565b6000602082019050818103600083015261259f81611f60565b9050919050565b600060208201905081810360008301526125bf81611fa0565b9050919050565b600060208201905081810360008301526125df81611fe0565b9050919050565b600060208201905081810360008301526125ff81612046565b9050919050565b6000602082019050818103600083015261261f816120c6565b9050919050565b6000602082019050818103600083015261263f81612146565b9050919050565b600060208201905061265b6000830184612186565b92915050565b60006060820190506126766000830186612186565b81810360208301526126888185611c3d565b9050818103604083015261269c8184611c3d565b9050949350505050565b60006040820190506126bb6000830186612186565b81810360208301526126ce818486611ce7565b9050949350505050565b600080833560016020038436030381126126f157600080fd5b80840192508235915067ffffffffffffffff82111561270f57600080fd5b60208301925060018202360383131561272757600080fd5b509250929050565b6000808335600160200384360303811261274857600080fd5b80840192508235915067ffffffffffffffff82111561276657600080fd5b60208301925060018202360383131561277e57600080fd5b509250929050565b60008235600160600383360303811261279e57600080fd5b80830191505092915050565b6000604051905081810181811067ffffffffffffffff821117156127d1576127d0612a30565b5b8060405250919050565b600067ffffffffffffffff8211156127f6576127f5612a30565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006128ae826128dd565b9050919050565b60006128c0826128dd565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061291f82612992565b9050919050565b600061293182612938565b9050919050565b6000612943826128dd565b9050919050565b60006129558261295c565b9050919050565b6000612967826128dd565b9050919050565b600061297982612980565b9050919050565b600061298b826128dd565b9050919050565b600061299d826129a4565b9050919050565b60006129af826128dd565b9050919050565b82818337600083830152505050565b60005b838110156129e35780820151818401526020810190506129c8565b838111156129f2576000848401525b50505050565b6000612a0382612a14565b9050919050565b6000819050919050565b6000612a1f82612a43565b9050919050565b6000819050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b612a59816128a3565b8114612a6457600080fd5b50565b612a70816128b5565b8114612a7b57600080fd5b50565b612a87816128c7565b8114612a9257600080fd5b50565b612a9e816128d3565b8114612aa957600080fd5b50565b612ab5816128fd565b8114612ac057600080fd5b50565b612acc81612907565b8114612ad757600080fd5b5056fea2646970667358221220c3cc2ecc46234048ff3ec7a22cf69020b076712cffbef5c8b5b3305dbf2a964564736f6c634300070300330000000000000000000000007229883a69a333055b191132d2118c8a676014dd0000000000000000000000007e79289de44392982a84380a764ccfa86c8c0e790000000000000000000000009cb3dc1615a82595e3e4b2f9705879ffcb180386000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc210000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101585760003560e01c806382d9805b116100c3578063a7bb58031161007c578063a7bb5803146103cb578063ab651850146103fd578063d2ee1e5e14610419578063de951dad14610437578063eb4aa17e14610467578063ffa1ad741461048357610158565b806382d9805b146102f55780638456cb59146103135780638677ebe81461031d57806394cb900e1461034d57806398f9772a1461036b578063a650f1c21461039b57610158565b806332e96bb31161011557806332e96bb3146102455780633f4ba83a146102615780635c975abb1461026b5780636243db18146102895780636581b897146102a75780636f049e20146102d757610158565b80630a0332f31461015d578063109c494e1461018d57806313007d55146101ab57806313b846d7146101c95780632eab99c5146101f95780632f8c51a714610229575b600080fd5b61017760048036038101906101729190611adf565b6104a1565b6040516101849190612393565b60405180910390f35b6101956104ff565b6040516101a29190612326565b60405180910390f35b6101b3610525565b6040516101c09190612493565b60405180910390f35b6101e360048036038101906101de91906119b5565b61054b565b6040516101f09190612378565b60405180910390f35b610213600480360381019061020e9190611a9e565b6105eb565b6040516102209190612393565b60405180910390f35b610243600480360381019061023e9190611bbc565b61063f565b005b61025f600480360381019061025a9190611a09565b610675565b005b6102696106af565b005b6102736106e5565b6040516102809190612378565b60405180910390f35b6102916106fb565b60405161029e9190612393565b60405180910390f35b6102c160048036038101906102bc91906119b5565b61071f565b6040516102ce9190612393565b60405180910390f35b6102df61076a565b6040516102ec91906124ae565b60405180910390f35b6102fd61078e565b60405161030a91906124c9565b60405180910390f35b61031b6107b4565b005b610337600480360381019061033291906118ec565b6107ea565b6040516103449190612378565b60405180910390f35b610355610818565b6040516103629190612646565b60405180910390f35b6103856004803603810190610380919061198c565b61081e565b6040516103929190612378565b60405180910390f35b6103b560048036038101906103b09190611a9e565b61083e565b6040516103c29190612378565b60405180910390f35b6103e560048036038101906103e09190611a5d565b6108ec565b6040516103f4939291906123d7565b60405180910390f35b610417600480360381019061041291906118c3565b610967565b005b6104216109d7565b60405161042e9190612393565b60405180910390f35b610451600480360381019061044c919061198c565b6109fb565b60405161045e9190612378565b60405180910390f35b610481600480360381019061047c9190611b20565b610a1b565b005b61048b610ce6565b6040516104989190612646565b60405180910390f35b600081600001358280602001906104b8919061272f565b8480604001906104c8919061272f565b86606001356040516020016104e2969594939291906122c1565b604051602081830303815290604052805190602001209050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080610558848461071f565b905060008060006105ba86806040019061057291906126d8565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506108ec565b9250925092506105df8660200160208101906105d6919061189a565b858386866107ea565b94505050505092915050565b60008160000135826020013583604001602081019061060a919061189a565b84606001356040516020016106229493929190612273565b604051602081830303815290604052805190602001209050919050565b7f100000000000000000000000000000000000000000000000000000000000000061066a8133610ceb565b816002819055505050565b7f10000000000000000000000000000000000000000000000000000000000000016106a08133610ceb565b6106aa8383610e2b565b505050565b7f10000000000000000000000000000000000000000000000000000000000000006106da8133610ceb565b6106e26110d5565b50565b60008060009054906101000a900460ff16905090565b7f100000000000000000000000000000000000000000000000000000000000000081565b600082826020016020810190610735919061189a565b836000013560405160200161074c939291906121bb565b60405160208183030381529060405280519060200120905092915050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f10000000000000000000000000000000000000000000000000000000000000006107df8133610ceb565b6107e7611176565b50565b60006107f98686868686611218565b8061080d575061080c86868686866112a2565b5b905095945050505050565b60025481565b60056020528060005260406000206000915054906101000a900460ff1681565b60008061084a836105eb565b905060008060006108ac86806080019061086491906126d8565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506108ec565b925092509250600286600001351480156108e157506108e08660400160208101906108d7919061189a565b858386866107ea565b5b945050505050919050565b60008060006041845114610935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092c90612606565b60405180910390fd5b6020840151925060408401519150606084015160001a9050601b8160ff16101561096057601b810190505b9193909250565b7f10000000000000000000000000000000000000000000000000000000000000006109928133610ceb565b81600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b7f100000000000000000000000000000000000000000000000000000000000000181565b60046020528060005260406000206000915054906101000a900460ff1681565b610a236106e5565b15610a63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5a90612586565b60405180910390fd5b6000610a6e856104a1565b90506000805b85859050811015610c855736868683818110610a8c57fe5b9050602002810190610a9e9190612786565b90506000610aac858361071f565b9050600015156004600083815260200190815260200160002060009054906101000a900460ff16151514610b15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0c906125c6565b60405180910390fd5b60016004600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060011515610b4f868461054b565b151514610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8890612566565b60405180910390fd5b610bcd7f1000000000000000000000000000000000000000000000000000000000000001836020016020810190610bc8919061189a565b610ceb565b8380600101945050888060200190610be5919061272f565b604051610bf3929190612220565b6040518091039020826020016020810190610c0e919061189a565b73ffffffffffffffffffffffffffffffffffffffff168a600001357f4f939e1e79b7839b1e037865222c2a81ee0b2e280f81850c00ed71d583cd9c8c848660000135878060400190610c6091906126d8565b604051610c70949392919061240e565b60405180910390a45050806001019050610a74565b50600254811015610ccb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc2906125a6565b60405180910390fd5b610cd48661131f565b610cde8284610e2b565b505050505050565b600281565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166391d1485483836040518363ffffffff1660e01b8152600401610d489291906123ae565b60206040518083038186803b158015610d6057600080fd5b505afa158015610d74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d989190611963565b610e2757610dbd8173ffffffffffffffffffffffffffffffffffffffff166014611531565b610dcb8360001c6020611531565b604051602001610ddc929190612239565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1e91906124e4565b60405180910390fd5b5050565b60008160600135146110d15780602001358214610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e74906125e6565b60405180910390fd5b6000610e88826105eb565b9050600015156005600083815260200190815260200160002060009054906101000a900460ff16151514610ef1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee890612526565b60405180910390fd5b60016005600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060011515610f2a8361083e565b151514610f6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6390612626565b60405180910390fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff166323b872dd836040016020810190610fbb919061189a565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685606001356040518463ffffffff1660e01b815260040161100193929190612341565b602060405180830381600087803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110539190611963565b50816040016020810190611067919061189a565b73ffffffffffffffffffffffffffffffffffffffff1682602001357fba15ea7ef834bda8ee66fa6222e337710145a7e592d75421af7ad69b4f37d5e384606001358580608001906110b891906126d8565b6040516110c7939291906126a6565b60405180910390a3505b5050565b6110dd6106e5565b61111c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111390612546565b60405180910390fd5b60008060006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61115f611725565b60405161116c919061230b565b60405180910390a1565b61117e6106e5565b156111be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b590612586565b60405180910390fd5b60016000806101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611201611725565b60405161120e919061230b565b60405180910390a1565b60008573ffffffffffffffffffffffffffffffffffffffff1660018686868660405160008152602001604052604051611254949392919061244e565b6020604051602081039080840390855afa158015611276573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614905095945050505050565b600060606040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a33320000000081525090506113138782886040516020016112f59291906121f8565b60405160208183030381529060405280519060200120878787611218565b91505095945050505050565b6060600167ffffffffffffffff8111801561133957600080fd5b5060405190808252806020026020018201604052801561136d57816020015b60608152602001906001900390816113585790505b5090506060600167ffffffffffffffff8111801561138a57600080fd5b506040519080825280602002602001820160405280156113be57816020015b60608152602001906001900390816113a95790505b5090508280602001906113d1919061272f565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508260008151811061142157fe5b602002602001018190525082806040019061143c919061272f565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508160008151811061148c57fe5b6020026020010181905250600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636401dc8f846000013584846040518463ffffffff1660e01b81526004016114fa93929190612661565b600060405180830381600087803b15801561151457600080fd5b505af1158015611528573d6000803e3d6000fd5b50505050505050565b6060806002836002020167ffffffffffffffff8111801561155157600080fd5b506040519080825280601f01601f1916602001820160405280156115845781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106115b557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061161257fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002020190505b60018111156116d7577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061168557fe5b1a60f81b82828151811061169557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508060019003905061164d565b506000841461171b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171290612506565b60405180910390fd5b8091505092915050565b600033905090565b60008135905061173c81612a50565b92915050565b60008135905061175181612a67565b92915050565b60008083601f84011261176957600080fd5b8235905067ffffffffffffffff81111561178257600080fd5b60208301915083602082028301111561179a57600080fd5b9250929050565b6000815190506117b081612a7e565b92915050565b6000813590506117c581612a95565b92915050565b600082601f8301126117dc57600080fd5b81356117ef6117ea826127db565b6127aa565b9150808252602083016020830185838301111561180b57600080fd5b6118168382846129b6565b50505092915050565b60006060828403121561183157600080fd5b81905092915050565b600060a0828403121561184c57600080fd5b81905092915050565b60006080828403121561186757600080fd5b81905092915050565b60008135905061187f81612aac565b92915050565b60008135905061189481612ac3565b92915050565b6000602082840312156118ac57600080fd5b60006118ba8482850161172d565b91505092915050565b6000602082840312156118d557600080fd5b60006118e384828501611742565b91505092915050565b600080600080600060a0868803121561190457600080fd5b60006119128882890161172d565b9550506020611923888289016117b6565b945050604061193488828901611885565b9350506060611945888289016117b6565b9250506080611956888289016117b6565b9150509295509295909350565b60006020828403121561197557600080fd5b6000611983848285016117a1565b91505092915050565b60006020828403121561199e57600080fd5b60006119ac848285016117b6565b91505092915050565b600080604083850312156119c857600080fd5b60006119d6858286016117b6565b925050602083013567ffffffffffffffff8111156119f357600080fd5b6119ff8582860161181f565b9150509250929050565b60008060408385031215611a1c57600080fd5b6000611a2a858286016117b6565b925050602083013567ffffffffffffffff811115611a4757600080fd5b611a538582860161183a565b9150509250929050565b600060208284031215611a6f57600080fd5b600082013567ffffffffffffffff811115611a8957600080fd5b611a95848285016117cb565b91505092915050565b600060208284031215611ab057600080fd5b600082013567ffffffffffffffff811115611aca57600080fd5b611ad68482850161183a565b91505092915050565b600060208284031215611af157600080fd5b600082013567ffffffffffffffff811115611b0b57600080fd5b611b1784828501611855565b91505092915050565b60008060008060608587031215611b3657600080fd5b600085013567ffffffffffffffff811115611b5057600080fd5b611b5c87828801611855565b945050602085013567ffffffffffffffff811115611b7957600080fd5b611b8587828801611757565b9350935050604085013567ffffffffffffffff811115611ba457600080fd5b611bb08782880161183a565b91505092959194509250565b600060208284031215611bce57600080fd5b6000611bdc84828501611870565b91505092915050565b6000611bf18383611d97565b905092915050565b611c0281612914565b82525050565b611c11816128b5565b82525050565b611c20816128a3565b82525050565b611c37611c32826128a3565b6129f8565b82525050565b6000611c488261281b565b611c528185612849565b935083602082028501611c648561280b565b8060005b85811015611ca05784840389528151611c818582611be5565b9450611c8c8361283c565b925060208a01995050600181019050611c68565b50829750879550505050505092915050565b611cbb816128c7565b82525050565b611cca816128d3565b82525050565b611ce1611cdc826128d3565b612a0a565b82525050565b6000611cf3838561285a565b9350611d008385846129b6565b611d0983612a32565b840190509392505050565b6000611d1f82612826565b611d29818561286b565b9350611d398185602086016129c5565b80840191505092915050565b611d4e81612926565b82525050565b611d5d8161294a565b82525050565b611d6c8161296e565b82525050565b6000611d7e8385612898565b9350611d8b8385846129b6565b82840190509392505050565b6000611da282612831565b611dac8185612876565b9350611dbc8185602086016129c5565b611dc581612a32565b840191505092915050565b6000611ddb82612831565b611de58185612887565b9350611df58185602086016129c5565b611dfe81612a32565b840191505092915050565b6000611e1482612831565b611e1e8185612898565b9350611e2e8185602086016129c5565b80840191505092915050565b6000611e47602083612887565b91507f537472696e67733a20686578206c656e67746820696e73756666696369656e746000830152602082019050919050565b6000611e87601983612887565b91507f5469702068617320616c7265616479206265656e2075736564000000000000006000830152602082019050919050565b6000611ec7601483612887565b91507f5061757361626c653a206e6f74207061757365640000000000000000000000006000830152602082019050919050565b6000611f07602883612887565b91507f41666669726d6174696f6e20646f65736e277420686176652076616c6964207360008301527f69676e61747572650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611f6d601083612887565b91507f5061757361626c653a20706175736564000000000000000000000000000000006000830152602082019050919050565b6000611fad601c83612887565b91507f4d696e696d756d2061666669726d6174696f6e73206e6f74206d6574000000006000830152602082019050919050565b6000611fed602583612887565b91507f41666669726d6174696f6e2068617320616c7265616479206265656e2072656360008301527f65697665640000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612053601483612887565b91507f546970206973206e6f7420666f722077726974650000000000000000000000006000830152602082019050919050565b6000612093601783612898565b91507f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006000830152601782019050919050565b60006120d3601883612887565b91507f696e76616c6964207369676e6174757265206c656e67746800000000000000006000830152602082019050919050565b6000612113601183612898565b91507f206973206d697373696e6720726f6c65200000000000000000000000000000006000830152601182019050919050565b6000612153602083612887565b91507f54697020646f65736e277420686176652076616c6964207369676e61747572656000830152602082019050919050565b61218f816128fd565b82525050565b6121a66121a1826128fd565b612a26565b82525050565b6121b581612907565b82525050565b60006121c78286611cd0565b6020820191506121d78285611c26565b6014820191506121e78284612195565b602082019150819050949350505050565b60006122048285611d14565b91506122108284611cd0565b6020820191508190509392505050565b600061222d828486611d72565b91508190509392505050565b600061224482612086565b91506122508285611e09565b915061225b82612106565b91506122678284611e09565b91508190509392505050565b600061227f8287612195565b60208201915061228f8286611cd0565b60208201915061229f8285611c26565b6014820191506122af8284612195565b60208201915081905095945050505050565b60006122cd8289612195565b6020820191506122de828789611d72565b91506122eb828587611d72565b91506122f78284612195565b602082019150819050979650505050505050565b60006020820190506123206000830184611c17565b92915050565b600060208201905061233b6000830184611c08565b92915050565b60006060820190506123566000830186611c17565b6123636020830185611bf9565b6123706040830184612186565b949350505050565b600060208201905061238d6000830184611cb2565b92915050565b60006020820190506123a86000830184611cc1565b92915050565b60006040820190506123c36000830185611cc1565b6123d06020830184611c17565b9392505050565b60006060820190506123ec6000830186611cc1565b6123f96020830185611cc1565b61240660408301846121ac565b949350505050565b60006060820190506124236000830187611cc1565b6124306020830186612186565b8181036040830152612443818486611ce7565b905095945050505050565b60006080820190506124636000830187611cc1565b61247060208301866121ac565b61247d6040830185611cc1565b61248a6060830184611cc1565b95945050505050565b60006020820190506124a86000830184611d45565b92915050565b60006020820190506124c36000830184611d54565b92915050565b60006020820190506124de6000830184611d63565b92915050565b600060208201905081810360008301526124fe8184611dd0565b905092915050565b6000602082019050818103600083015261251f81611e3a565b9050919050565b6000602082019050818103600083015261253f81611e7a565b9050919050565b6000602082019050818103600083015261255f81611eba565b9050919050565b6000602082019050818103600083015261257f81611efa565b9050919050565b6000602082019050818103600083015261259f81611f60565b9050919050565b600060208201905081810360008301526125bf81611fa0565b9050919050565b600060208201905081810360008301526125df81611fe0565b9050919050565b600060208201905081810360008301526125ff81612046565b9050919050565b6000602082019050818103600083015261261f816120c6565b9050919050565b6000602082019050818103600083015261263f81612146565b9050919050565b600060208201905061265b6000830184612186565b92915050565b60006060820190506126766000830186612186565b81810360208301526126888185611c3d565b9050818103604083015261269c8184611c3d565b9050949350505050565b60006040820190506126bb6000830186612186565b81810360208301526126ce818486611ce7565b9050949350505050565b600080833560016020038436030381126126f157600080fd5b80840192508235915067ffffffffffffffff82111561270f57600080fd5b60208301925060018202360383131561272757600080fd5b509250929050565b6000808335600160200384360303811261274857600080fd5b80840192508235915067ffffffffffffffff82111561276657600080fd5b60208301925060018202360383131561277e57600080fd5b509250929050565b60008235600160600383360303811261279e57600080fd5b80830191505092915050565b6000604051905081810181811067ffffffffffffffff821117156127d1576127d0612a30565b5b8060405250919050565b600067ffffffffffffffff8211156127f6576127f5612a30565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006128ae826128dd565b9050919050565b60006128c0826128dd565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061291f82612992565b9050919050565b600061293182612938565b9050919050565b6000612943826128dd565b9050919050565b60006129558261295c565b9050919050565b6000612967826128dd565b9050919050565b600061297982612980565b9050919050565b600061298b826128dd565b9050919050565b600061299d826129a4565b9050919050565b60006129af826128dd565b9050919050565b82818337600083830152505050565b60005b838110156129e35780820151818401526020810190506129c8565b838111156129f2576000848401525b50505050565b6000612a0382612a14565b9050919050565b6000819050919050565b6000612a1f82612a43565b9050919050565b6000819050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b612a59816128a3565b8114612a6457600080fd5b50565b612a70816128b5565b8114612a7b57600080fd5b50565b612a87816128c7565b8114612a9257600080fd5b50565b612a9e816128d3565b8114612aa957600080fd5b50565b612ab5816128fd565b8114612ac057600080fd5b50565b612acc81612907565b8114612ad757600080fd5b5056fea2646970667358221220c3cc2ecc46234048ff3ec7a22cf69020b076712cffbef5c8b5b3305dbf2a964564736f6c63430007030033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007229883a69a333055b191132d2118c8a676014dd0000000000000000000000007e79289de44392982a84380a764ccfa86c8c0e790000000000000000000000009cb3dc1615a82595e3e4b2f9705879ffcb180386000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc210000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _accessControl (address): 0x7229883a69a333055B191132d2118C8a676014dD
Arg [1] : _permissionedTokenMetadataRegistry (address): 0x7e79289de44392982a84380A764CCFA86c8C0E79
Arg [2] : _historianTipJar (address): 0x9cb3DC1615a82595e3e4B2f9705879FfcB180386
Arg [3] : _tipToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [4] : _organizerRole (bytes32): 0x1000000000000000000000000000000000000000000000000000000000000000
Arg [5] : _historianRole (bytes32): 0x1000000000000000000000000000000000000000000000000000000000000001
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000007229883a69a333055b191132d2118c8a676014dd
Arg [1] : 0000000000000000000000007e79289de44392982a84380a764ccfa86c8c0e79
Arg [2] : 0000000000000000000000009cb3dc1615a82595e3e4b2f9705879ffcb180386
Arg [3] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [4] : 1000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 1000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.