ETH Price: $2,113.72 (-9.92%)

Contract

0x068CE2Cfc528B96F63C74E511f5bD7d378df2f03
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
Age
From
To
Add Controller138231932021-12-17 14:37:351168 days ago1639751855IN
0x068CE2Cf...378df2f03
0 ETH0.0039190185.06842278

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
Age
From
To
138581042021-12-22 23:59:361163 days ago1640217576
0x068CE2Cf...378df2f03
0 ETH
138552762021-12-22 13:29:201163 days ago1640179760
0x068CE2Cf...378df2f03
0 ETH
138552762021-12-22 13:29:201163 days ago1640179760
0x068CE2Cf...378df2f03
0 ETH
138552762021-12-22 13:29:201163 days ago1640179760
0x068CE2Cf...378df2f03
0 ETH
138552462021-12-22 13:23:411163 days ago1640179421
0x068CE2Cf...378df2f03
0 ETH
138552462021-12-22 13:23:411163 days ago1640179421
0x068CE2Cf...378df2f03
0 ETH
138552462021-12-22 13:23:411163 days ago1640179421
0x068CE2Cf...378df2f03
0 ETH
138552462021-12-22 13:23:411163 days ago1640179421
0x068CE2Cf...378df2f03
0 ETH
138552462021-12-22 13:23:411163 days ago1640179421
0x068CE2Cf...378df2f03
0 ETH
138552462021-12-22 13:23:411163 days ago1640179421
0x068CE2Cf...378df2f03
0 ETH
138479022021-12-21 10:05:491164 days ago1640081149
0x068CE2Cf...378df2f03
0 ETH
138479022021-12-21 10:05:491164 days ago1640081149
0x068CE2Cf...378df2f03
0 ETH
138479022021-12-21 10:05:491164 days ago1640081149
0x068CE2Cf...378df2f03
0 ETH
138479022021-12-21 10:05:491164 days ago1640081149
0x068CE2Cf...378df2f03
0 ETH
138478472021-12-21 9:53:541164 days ago1640080434
0x068CE2Cf...378df2f03
0 ETH
138478472021-12-21 9:53:541164 days ago1640080434
0x068CE2Cf...378df2f03
0 ETH
138478472021-12-21 9:53:541164 days ago1640080434
0x068CE2Cf...378df2f03
0 ETH
138478472021-12-21 9:53:541164 days ago1640080434
0x068CE2Cf...378df2f03
0 ETH
138474542021-12-21 8:28:091164 days ago1640075289
0x068CE2Cf...378df2f03
0 ETH
138474542021-12-21 8:28:091164 days ago1640075289
0x068CE2Cf...378df2f03
0 ETH
138462352021-12-21 3:53:441165 days ago1640058824
0x068CE2Cf...378df2f03
0 ETH
138462352021-12-21 3:53:441165 days ago1640058824
0x068CE2Cf...378df2f03
0 ETH
138419622021-12-20 12:21:251165 days ago1640002885
0x068CE2Cf...378df2f03
0 ETH
138419622021-12-20 12:21:251165 days ago1640002885
0x068CE2Cf...378df2f03
0 ETH
138419622021-12-20 12:21:251165 days ago1640002885
0x068CE2Cf...378df2f03
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Randomizer

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : Randomizer.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ICryptoBees.sol";
import "./Traits.sol";
import "./IAttack.sol";
contract Randomizer is Ownable {
struct Commit {
uint256 block;
address sender;
}
mapping(uint256 => Commit) commits;
mapping(address => bool) controllers;
uint256 commitIndex;
event CommitHash(address indexed sender, uint256 block, uint256 index);
constructor() {}
function createCommit() public {
require(controllers[msg.sender], "Not permitted");
commits[commitIndex].block = block.number;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 2 of 11 : Ownable.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.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.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 3 of 11 : ICryptoBees.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
// import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
interface ICryptoBees {
struct Token {
uint8 _type;
uint8 color;
uint8 eyes;
uint8 mouth;
uint8 nose;
uint8 hair;
uint8 accessory;
uint8 feelers;
uint8 strength;
uint48 lastAttackTimestamp;
uint48 cooldownTillTimestamp;
}
function getMinted() external view returns (uint256 m);
function increaseTokensPot(address _owner, uint256 amount) external;
function updateTokensLastAttack(
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 4 of 11 : Traits.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "hardhat/console.sol";
import "./ICryptoBees.sol";
import "./IHoney.sol";
import "./Base64.sol";
contract Traits is Ownable {
using Strings for uint256;
using MerkleProof for bytes32[];
// struct to store each trait's data for metadata and rendering
struct Trait {
string name;
string png;
}
string unrevealedImage;
ICryptoBees beesContract;
IHoney honeyContract;
// mint price ETH
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 5 of 11 : IAttack.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.9;
interface IAttack {
struct Settings {
uint8 bearChance;
uint8 beekeeperMultiplier;
uint24 hiveProtectionBear;
uint24 hiveProtectionKeeper;
uint24 bearCooldownBase;
uint24 bearCooldownPerHiveDay;
uint24 beekeeperCooldownBase;
uint24 beekeeperCooldownPerHiveDay;
uint8 attacksToRestart;
}
struct UnresolvedAttack {
uint24 tokenId;
uint48 nonce;
uint64 block;
uint32 howMuch;
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 6 of 11 : Context.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)
pragma solidity ^0.8.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 _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 7 of 11 : Strings.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)
pragma solidity ^0.8.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;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 8 of 11 : MerkleProof.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 9 of 11 : console.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: MIT
pragma solidity >= 0.4.22 <0.9.0;
library console {
address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67);
function _sendLogPayload(bytes memory payload) private view {
uint256 payloadLength = payload.length;
address consoleAddress = CONSOLE_ADDRESS;
assembly {
let payloadStart := add(payload, 32)
let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0)
}
}
function log() internal view {
_sendLogPayload(abi.encodeWithSignature("log()"));
}
function logInt(int p0) internal view {
_sendLogPayload(abi.encodeWithSignature("log(int)", p0));
}
function logUint(uint p0) internal view {
_sendLogPayload(abi.encodeWithSignature("log(uint)", p0));
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 10 of 11 : IHoney.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.9;
interface IHoney {
function mint(address to, uint256 amount) external;
function mintGiveaway(address[] calldata addresses, uint256 amount) external;
function burn(address from, uint256 amount) external;
function disableGiveaway() external;
function addController(address controller) external;
function removeController(address controller) external;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

File 11 of 11 : Base64.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
library Base64 {
string internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function encode(bytes memory data) internal pure returns (string memory) {
if (data.length == 0) return "";
// load the table into memory
string memory table = TABLE;
// multiply by 4/3 rounded up
uint256 encodedLen = 4 * ((data.length + 2) / 3);
// add some extra buffer at the end required for the writing
string memory result = new string(encodedLen + 32);
// solhint-disable-next-line no-inline-assembly
assembly {
// set the actual output length
mstore(result, encodedLen)
// prepare the lookup table
let tablePtr := add(table, 1)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Settings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"CommitHash","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"addController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createCommit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"removeController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"to","type":"uint256"}],"name":"reset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"}],"name":"revealSeed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105828061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063916fbda41161005b578063916fbda4146100eb578063a7fc7a07146100f3578063f2fde38b14610106578063f6a74ed71461011957600080fd5b80630413a0f01461008d578063310bd74b146100b3578063715018a6146100c85780638da5cb5b146100d0575b600080fd5b6100a061009b366004610489565b61012c565b6040519081526020015b60405180910390f35b6100c66100c1366004610489565b6101b3565b005b6100c66101eb565b6000546040516001600160a01b0390911681526020016100aa565b6100c6610221565b6100c66101013660046104a2565b610305565b6100c66101143660046104a2565b610353565b6100c66101273660046104a2565b6103ee565b60006003548210801561014c575060008281526001602052604090205443115b156101ab5760008281526001602081815260409283902091820154915483516001600160a01b03909316918301919091529181018490529040606082015260800160408051601f19818403018152919052805160209091012092915050565b506000919050565b6000546001600160a01b031633146101e65760405162461bcd60e51b81526004016101dd906104d2565b60405180910390fd5b600355565b6000546001600160a01b031633146102155760405162461bcd60e51b81526004016101dd906104d2565b61021f6000610439565b565b3360009081526002602052604090205460ff166102705760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c195c9b5a5d1d1959609a1b60448201526064016101dd565b600380546000908152600160208190526040808320439055835483528220810180546001600160a01b031916321790558254909291906102b190849061051d565b909155505060035432907f72c5a6bb2564859e4acc3a7296dbf32cf9cbddeebd48dce6ddf051add9abc5ee9043906102eb90600190610535565b6040805192835260208301919091520160405180910390a2565b6000546001600160a01b0316331461032f5760405162461bcd60e51b81526004016101dd906104d2565b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000546001600160a01b0316331461037d5760405162461bcd60e51b81526004016101dd906104d2565b6001600160a01b0381166103e25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101dd565b6103eb81610439565b50565b6000546001600160a01b031633146104185760405162461bcd60e51b81526004016101dd906104d2565b6001600160a01b03166000908152600260205260409020805460ff19169055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561049b57600080fd5b5035919050565b6000602082840312156104b457600080fd5b81356001600160a01b03811681146104cb57600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561053057610530610507565b500190565b60008282101561054757610547610507565b50039056fea2646970667358221220e98ea9a08709b1fb331a2d4eb3565622225a203a5754788994331d8bc914169e64736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063916fbda41161005b578063916fbda4146100eb578063a7fc7a07146100f3578063f2fde38b14610106578063f6a74ed71461011957600080fd5b80630413a0f01461008d578063310bd74b146100b3578063715018a6146100c85780638da5cb5b146100d0575b600080fd5b6100a061009b366004610489565b61012c565b6040519081526020015b60405180910390f35b6100c66100c1366004610489565b6101b3565b005b6100c66101eb565b6000546040516001600160a01b0390911681526020016100aa565b6100c6610221565b6100c66101013660046104a2565b610305565b6100c66101143660046104a2565b610353565b6100c66101273660046104a2565b6103ee565b60006003548210801561014c575060008281526001602052604090205443115b156101ab5760008281526001602081815260409283902091820154915483516001600160a01b03909316918301919091529181018490529040606082015260800160408051601f19818403018152919052805160209091012092915050565b506000919050565b6000546001600160a01b031633146101e65760405162461bcd60e51b81526004016101dd906104d2565b60405180910390fd5b600355565b6000546001600160a01b031633146102155760405162461bcd60e51b81526004016101dd906104d2565b61021f6000610439565b565b3360009081526002602052604090205460ff166102705760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c195c9b5a5d1d1959609a1b60448201526064016101dd565b600380546000908152600160208190526040808320439055835483528220810180546001600160a01b031916321790558254909291906102b190849061051d565b909155505060035432907f72c5a6bb2564859e4acc3a7296dbf32cf9cbddeebd48dce6ddf051add9abc5ee9043906102eb90600190610535565b6040805192835260208301919091520160405180910390a2565b6000546001600160a01b0316331461032f5760405162461bcd60e51b81526004016101dd906104d2565b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000546001600160a01b0316331461037d5760405162461bcd60e51b81526004016101dd906104d2565b6001600160a01b0381166103e25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101dd565b6103eb81610439565b50565b6000546001600160a01b031633146104185760405162461bcd60e51b81526004016101dd906104d2565b6001600160a01b03166000908152600260205260409020805460ff19169055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561049b57600080fd5b5035919050565b6000602082840312156104b457600080fd5b81356001600160a01b03811681146104cb57600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561053057610530610507565b500190565b60008282101561054757610547610507565b50039056fea2646970667358221220e98ea9a08709b1fb331a2d4eb3565622225a203a5754788994331d8bc914169e64736f6c63430008090033

Block Age Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Age Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Age Amount
View All Withdrawals

Transaction Hash Block Age Value Eth2 PubKey Valid
View All Deposits
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.