Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 312 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Register New Ran... | 10552663 | 2015 days ago | IN | 0 ETH | 0.00306606 | ||||
| Register New Ran... | 10551838 | 2015 days ago | IN | 0 ETH | 0.00278158 | ||||
| Register New Ran... | 10551003 | 2015 days ago | IN | 0 ETH | 0.00244098 | ||||
| Register New Ran... | 10550189 | 2015 days ago | IN | 0 ETH | 0.00255451 | ||||
| Register New Ran... | 10549359 | 2016 days ago | IN | 0 ETH | 0.0040313 | ||||
| Register New Ran... | 10548546 | 2016 days ago | IN | 0 ETH | 0.00437105 | ||||
| Register New Ran... | 10547717 | 2016 days ago | IN | 0 ETH | 0.00420075 | ||||
| Register New Ran... | 10546924 | 2016 days ago | IN | 0 ETH | 0.00363232 | ||||
| Register New Ran... | 10546074 | 2016 days ago | IN | 0 ETH | 0.00408808 | ||||
| Register New Ran... | 10545303 | 2016 days ago | IN | 0 ETH | 0.00374583 | ||||
| Register New Ran... | 10544456 | 2016 days ago | IN | 0 ETH | 0.00363308 | ||||
| Register New Ran... | 10543630 | 2016 days ago | IN | 0 ETH | 0.00488196 | ||||
| Register New Ran... | 10542822 | 2017 days ago | IN | 0 ETH | 0.00777872 | ||||
| Register New Ran... | 10541999 | 2017 days ago | IN | 0 ETH | 0.00641467 | ||||
| Register New Ran... | 10541158 | 2017 days ago | IN | 0 ETH | 0.00482621 | ||||
| Register New Ran... | 10540335 | 2017 days ago | IN | 0 ETH | 0.005394 | ||||
| Register New Ran... | 10539517 | 2017 days ago | IN | 0 ETH | 0.00493977 | ||||
| Register New Ran... | 10538724 | 2017 days ago | IN | 0 ETH | 0.00329248 | ||||
| Register New Ran... | 10537895 | 2017 days ago | IN | 0 ETH | 0.00227116 | ||||
| Register New Ran... | 10537054 | 2017 days ago | IN | 0 ETH | 0.0028945 | ||||
| Register New Ran... | 10536239 | 2018 days ago | IN | 0 ETH | 0.00516688 | ||||
| Register New Ran... | 10535441 | 2018 days ago | IN | 0 ETH | 0.00590501 | ||||
| Register New Ran... | 10534618 | 2018 days ago | IN | 0 ETH | 0.00522366 | ||||
| Register New Ran... | 10533784 | 2018 days ago | IN | 0 ETH | 0.0032364 | ||||
| Register New Ran... | 10532967 | 2018 days ago | IN | 0 ETH | 0.00329318 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BeaconContract
Compiler Version
v0.5.10+commit.5a6ea5b1
Contract Source Code (Solidity Multiple files format)
pragma solidity ^0.5.2;
import "./IFactRegistry.sol";
import "./PublicInputOffsets.sol";
contract BeaconContract is PublicInputOffsets {
event LogNewRandomness(uint256 blockNumber, bytes32 randomness);
// Mapping: blockNumber -> randomness.
mapping(uint256 => bytes32) private registeredRandomness;
uint256 latestBlockNumber;
address public owner;
uint256 public n_iterations;
IFactRegistry verifierContract;
uint256 internal constant PRIME = 0x30000003000000010000000000000001;
uint256 internal constant MAX_LOG_TRACE_LENGTH = 40;
uint256 internal constant PUBLIC_INPUT_SIZE = 5;
modifier onlyOwner {
require(msg.sender == owner, "Sender is not the owner");
_;
}
constructor(address verifierAddress, uint256 n_iters) public {
owner = msg.sender;
verifierContract = IFactRegistry(verifierAddress);
n_iterations = n_iters;
}
/*
Registers a new randomness if and only if:
1. Can verify the block hash of the given blockNumber and that it indeed equals blockHash.
2. The vdfInput calculted from the given blockHash matches the given proofPublicInput.
3. The proofPublicInput was registered as a fact in the verifier contract.
Updates latest randomness.
*/
function registerNewRandomness(
uint256 blockNumber,
bytes32 blockHash,
uint256[PUBLIC_INPUT_SIZE] calldata proofPublicInput
) external onlyOwner {
// EVM can get block hash only for latest 256 blocks.
require(
blockNumber < block.number && block.number <= blockNumber + 255,
"Block is not within the last 256 blocks."
);
// In case blockNumber refers to a block which is more than 256 blocks old,
// blockhash(blockNumber) returns 0.
require(
blockhash(blockNumber) == blockHash && blockHash != 0,
"blockHash does not match blockNumber or too old."
);
require(
proofPublicInput[OFFSET_LOG_TRACE_LENGTH] < MAX_LOG_TRACE_LENGTH,
"VDF reported length exceeds the integer overflow protection limit."
);
require(
n_iterations == 10 * 2**proofPublicInput[OFFSET_LOG_TRACE_LENGTH] - 1,
"Public input and n_iterations are not compatible."
);
require(
proofPublicInput[OFFSET_VDF_OUTPUT_X] < PRIME &&
proofPublicInput[OFFSET_VDF_OUTPUT_Y] < PRIME,
"Invalid vdf output."
);
// To calculate the input of the VDF we first hash the blockHash with the string "veedo",
// then we split the last 250 bits to two 125 bit field elements.
uint256 vdfInput = uint256(keccak256(abi.encodePacked(blockHash, "veedo")));
require(
vdfInput & ((1 << 125) - 1) == proofPublicInput[OFFSET_VDF_INPUT_X],
"blockHash does not match the given proofPublicInput."
);
require(
((vdfInput >> 125) & ((1 << 125) - 1)) == proofPublicInput[OFFSET_VDF_INPUT_Y],
"blockHash does not match the given proofPublicInput."
);
require(
verifierContract.isValid(keccak256(abi.encodePacked(proofPublicInput))),
"No valid proof provided."
);
// The randomness is the hash of the VDF output and the string "veedo"
bytes32 randomness = keccak256(
abi.encodePacked(
proofPublicInput[OFFSET_VDF_OUTPUT_X],
proofPublicInput[OFFSET_VDF_OUTPUT_Y],
"veedo"
)
);
registeredRandomness[blockNumber] = randomness;
emit LogNewRandomness(blockNumber, randomness);
// Update latestBlockNumber if blockNumber is greater than latestBlockNumber.
if (blockNumber > latestBlockNumber) {
latestBlockNumber = blockNumber;
}
}
/*
If there is a randomness for blockNumber, returns it.
Otherwise, returns 0.
*/
function getRandomness(uint256 blockNumber)
external
view
returns (bytes32)
{
return registeredRandomness[blockNumber];
}
/*
Returns the latest registered (blockNumber, randomness).
*/
function getLatestRandomness() external view returns (uint256, bytes32) {
return (latestBlockNumber, registeredRandomness[latestBlockNumber]);
}
}
pragma solidity ^0.5.2;
/*
The Fact Registry design pattern is a way to separate cryptographic verification from the
business logic of the contract flow.
A fact registry holds a hash table of verified "facts" which are represented by a hash of claims
that the registry hash check and found valid. This table may be queried by accessing the
isValid() function of the registry with a given hash.
In addition, each fact registry exposes a registry specific function for submitting new claims
together with their proofs. The information submitted varies from one registry to the other
depending of the type of fact requiring verification.
For further reading on the Fact Registry design pattern see this
`StarkWare blog post <https://medium.com/starkware/the-fact-registry-a64aafb598b6>`_.
*/
contract IFactRegistry {
/*
Returns true if the given fact was previously registered in the contract.
*/
function isValid(bytes32 fact)
external view
returns(bool);
}
pragma solidity ^0.5.2;
contract PublicInputOffsets {
// The following constants are offsets of data expected in the public input.
uint256 internal constant OFFSET_LOG_TRACE_LENGTH = 0;
uint256 internal constant OFFSET_VDF_OUTPUT_X = 1;
uint256 internal constant OFFSET_VDF_OUTPUT_Y = 2;
uint256 internal constant OFFSET_VDF_INPUT_X = 3;
uint256 internal constant OFFSET_VDF_INPUT_Y = 4;
}
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[{"name":"blockNumber","type":"uint256"}],"name":"getRandomness","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"n_iterations","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"blockNumber","type":"uint256"},{"name":"blockHash","type":"bytes32"},{"name":"proofPublicInput","type":"uint256[5]"}],"name":"registerNewRandomness","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getLatestRandomness","outputs":[{"name":"","type":"uint256"},{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"verifierAddress","type":"address"},{"name":"n_iters","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"blockNumber","type":"uint256"},{"indexed":false,"name":"randomness","type":"bytes32"}],"name":"LogNewRandomness","type":"event"}]Contract Creation Code
608060405234801561001057600080fd5b506040516108e03803806108e08339818101604052604081101561003357600080fd5b50805160209091015160028054336001600160a01b031991821617909155600480549091166001600160a01b03909316929092179091556003556108648061007c6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063c06d947511610050578063c06d9475146100cc578063d92f1280146100d4578063f4bebd7a146100fe57610067565b8063453f4f621461006c5780638da5cb5b1461009b575b600080fd5b6100896004803603602081101561008257600080fd5b503561011f565b60408051918252519081900360200190f35b6100a3610131565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61008961014d565b6100fc600480360360e08110156100ea57600080fd5b50803590602081013590604001610153565b005b61010661071a565b6040805192835260208301919091528051918290030190f35b60009081526020819052604090205490565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60025473ffffffffffffffffffffffffffffffffffffffff1633146101d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f53656e646572206973206e6f7420746865206f776e6572000000000000000000604482015290519081900360640190fd5b43831080156101eb57508260ff014311155b610240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806107736028913960400191505060405180910390fd5b81834014801561024f57508115155b6102a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061079b6030913960400191505060405180910390fd5b60288135106102fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260428152602001806107316042913960600191505060405180910390fd5b6003547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a833560020a020114610381576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806107ff6031913960400191505060405180910390fd5b6f3000000300000001000000000000000160208201351080156103b757506f300000030000000100000000000000016040820135105b61042257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496e76616c696420766466206f75747075742e00000000000000000000000000604482015290519081900360640190fd5b6040805160208082018590527f766565646f0000000000000000000000000000000000000000000000000000008284015282518083036025018152604590920190925280519101206f1fffffffffffffffffffffffffffffff81166060830135146104d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806107cb6034913960400191505060405180910390fd5b6f1fffffffffffffffffffffffffffffff607d82901c1660808301351461054a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806107cb6034913960400191505060405180910390fd5b60045460405173ffffffffffffffffffffffffffffffffffffffff90911690636a938567908490602001808260a08082843780830192505050915050604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156105d057600080fd5b505afa1580156105e4573d6000803e3d6000fd5b505050506040513d60208110156105fa57600080fd5b505161066757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f2076616c69642070726f6f662070726f76696465642e0000000000000000604482015290519081900360640190fd5b604080516020848101358183015284830135828401527f766565646f00000000000000000000000000000000000000000000000000000060608301528251604581840301815260658301808552815191830191909120600089815292839052918490208290558790526085820181905291517f72dad8b9464f88a2972c8e4a054a45894d36f445330974fc281d3d5a149ace469181900360a50190a16001548511156107135760018590555b5050505050565b600154600081815260208190526040902054909156fe564446207265706f72746564206c656e67746820657863656564732074686520696e7465676572206f766572666c6f772070726f74656374696f6e206c696d69742e426c6f636b206973206e6f742077697468696e20746865206c6173742032353620626c6f636b732e626c6f636b4861736820646f6573206e6f74206d6174636820626c6f636b4e756d626572206f7220746f6f206f6c642e626c6f636b4861736820646f6573206e6f74206d617463682074686520676976656e2070726f6f665075626c6963496e7075742e5075626c696320696e70757420616e64206e5f697465726174696f6e7320617265206e6f7420636f6d70617469626c652ea265627a7a72305820fe1cd36819ddc4aec3b7c6659adfd8e512922eac3f64b74e0c6de41936990d0264736f6c634300050a00320000000000000000000000005a6a37b41865eb940c5dd4ffe162e53b7ee220900000000000000000000000000000000000000000000000000000000013ffffff
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063c06d947511610050578063c06d9475146100cc578063d92f1280146100d4578063f4bebd7a146100fe57610067565b8063453f4f621461006c5780638da5cb5b1461009b575b600080fd5b6100896004803603602081101561008257600080fd5b503561011f565b60408051918252519081900360200190f35b6100a3610131565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61008961014d565b6100fc600480360360e08110156100ea57600080fd5b50803590602081013590604001610153565b005b61010661071a565b6040805192835260208301919091528051918290030190f35b60009081526020819052604090205490565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60025473ffffffffffffffffffffffffffffffffffffffff1633146101d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f53656e646572206973206e6f7420746865206f776e6572000000000000000000604482015290519081900360640190fd5b43831080156101eb57508260ff014311155b610240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806107736028913960400191505060405180910390fd5b81834014801561024f57508115155b6102a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061079b6030913960400191505060405180910390fd5b60288135106102fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260428152602001806107316042913960600191505060405180910390fd5b6003547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a833560020a020114610381576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806107ff6031913960400191505060405180910390fd5b6f3000000300000001000000000000000160208201351080156103b757506f300000030000000100000000000000016040820135105b61042257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496e76616c696420766466206f75747075742e00000000000000000000000000604482015290519081900360640190fd5b6040805160208082018590527f766565646f0000000000000000000000000000000000000000000000000000008284015282518083036025018152604590920190925280519101206f1fffffffffffffffffffffffffffffff81166060830135146104d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806107cb6034913960400191505060405180910390fd5b6f1fffffffffffffffffffffffffffffff607d82901c1660808301351461054a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806107cb6034913960400191505060405180910390fd5b60045460405173ffffffffffffffffffffffffffffffffffffffff90911690636a938567908490602001808260a08082843780830192505050915050604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156105d057600080fd5b505afa1580156105e4573d6000803e3d6000fd5b505050506040513d60208110156105fa57600080fd5b505161066757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f2076616c69642070726f6f662070726f76696465642e0000000000000000604482015290519081900360640190fd5b604080516020848101358183015284830135828401527f766565646f00000000000000000000000000000000000000000000000000000060608301528251604581840301815260658301808552815191830191909120600089815292839052918490208290558790526085820181905291517f72dad8b9464f88a2972c8e4a054a45894d36f445330974fc281d3d5a149ace469181900360a50190a16001548511156107135760018590555b5050505050565b600154600081815260208190526040902054909156fe564446207265706f72746564206c656e67746820657863656564732074686520696e7465676572206f766572666c6f772070726f74656374696f6e206c696d69742e426c6f636b206973206e6f742077697468696e20746865206c6173742032353620626c6f636b732e626c6f636b4861736820646f6573206e6f74206d6174636820626c6f636b4e756d626572206f7220746f6f206f6c642e626c6f636b4861736820646f6573206e6f74206d617463682074686520676976656e2070726f6f665075626c6963496e7075742e5075626c696320696e70757420616e64206e5f697465726174696f6e7320617265206e6f7420636f6d70617469626c652ea265627a7a72305820fe1cd36819ddc4aec3b7c6659adfd8e512922eac3f64b74e0c6de41936990d0264736f6c634300050a0032
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005a6a37b41865eb940c5dd4ffe162e53b7ee220900000000000000000000000000000000000000000000000000000000013ffffff
-----Decoded View---------------
Arg [0] : verifierAddress (address): 0x5a6a37B41865EB940C5dD4fFe162e53B7EE22090
Arg [1] : n_iters (uint256): 335544319
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000005a6a37b41865eb940c5dd4ffe162e53b7ee22090
Arg [1] : 0000000000000000000000000000000000000000000000000000000013ffffff
Deployed Bytecode Sourcemap
92:4340:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;92:4340:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4030:161;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4030:161:0;;:::i;:::-;;;;;;;;;;;;;;;;350:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;376:27;;;:::i;1304:2618::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;1304:2618:0;;;;;;;;;;;:::i;:::-;;4274:156;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;4030:161;4121:7;4151:33;;;;;;;;;;;;4030:161::o;350:20::-;;;;;;:::o;376:27::-;;;;:::o;1304:2618::-;681:5;;;;667:10;:19;659:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1585:12;1571:11;:26;:63;;;;;1617:11;1631:3;1617:17;1601:12;:33;;1571:63;1550:150;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1886:9;1870:11;1860:22;:35;:53;;;;-1:-1:-1;1899:14:0;;;1860:53;1839:148;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;568:2;2018:41;;:64;1997:177;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2205:12;;2221:53;:2;2229:41;;2226:1;:44;2221:49;:53;2205:69;2184:165;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;479:34;2380:37;;;;:45;:110;;;;-1:-1:-1;479:34:0;2445:37;;;;:45;2380:110;2359:176;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2754:36;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;2754:36:0;;;;;;;2744:47;;;;;2835:14;2823:27;;2854:36;;;;2823:67;2802:166;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3021:14;3013:3;3001:15;;;3000:36;3041;;;;2999:78;2978:177;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3186:16;;3221:34;;3186:16;;;;;:24;;3238:16;;3221:34;;;3238:16;3221:34;;3238:16;3221:34;1:33:-1;57:3;49:6;45:16;35:26;;3221:34:0;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3221:34:0;;;3211:45;;;;;;3186:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3186:71:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3186:71:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3186:71:0;3165:142;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3440:165;;;3474:37;;;;;3440:165;;;;3529:37;;;;3440:165;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;3440:165:0;;;;;;3417:198;;;;;;;;;-1:-1:-1;3625:33:0;;;;;;;;;;;:46;;;3686:41;;;;;;;;;;;;;;;;;;;;3841:17;;3827:11;:31;3823:93;;;3874:17;:31;;;3823:93;724:1;;1304:2618;;;:::o;4274:156::-;4364:17;;4328:7;4383:39;;;;;;;;;;;4274:156;;:::o
Swarm Source
bzzr://fe1cd36819ddc4aec3b7c6659adfd8e512922eac3f64b74e0c6de41936990d02
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 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.