SldCommitIntent
Git Source (opens in a new tab)
Author: Sam Ward
Inherits: ICommitIntent, Ownable
Author: Sam Ward
This contract is for registering intent to register a SLD
State Variables
nodeIntentBlockNumber
mapping(bytes32 => CommitData) public nodeIntentBlockNumber;
maxBlockWaitForCommit
uint256 public maxBlockWaitForCommit = 0x400;
minBlockWaitForCommit
uint256 public minBlockWaitForCommit = 8;
Functions
constructor
constructor();
commitIntent
Save commit intent hash
This function can called by anyone and will save the hash of data that can be used to verify that the user intends to register the domain this is so the user isn't front run
function commitIntent(bytes32 _combinedHash) public;
Parameters
Name | Type | Description |
---|---|---|
_combinedHash | bytes32 | keccak256 hash of sld namehash / bytes32 secret / msg.sender |
allowedCommit
function allowedCommit(bytes32 _namehash, bytes32 _secret, address _addr) external view returns (bool);
updateMaxBlockWaitForCommit
Update max block wait time for commit
Only the contract owner can call this function
function updateMaxBlockWaitForCommit(uint256 _maxBlockWait) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_maxBlockWait | uint256 | Number of blocks until the commit expires |
updateMinBlockWaitForCommit
Update min block wait time for commit
Only the contract owner can call this function. This helps prevent front running and also prevents issues if there is a reorg (unlikely)
function updateMinBlockWaitForCommit(uint256 _minBlockWait) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_minBlockWait | uint256 | Number of blocks until the commit becomes active |
multiCommitIntent
Save multiple commit intent hash
This function can called by anyone and will save the hash of data that can be used to verify that the user intends to register the domain this is so the user isn't front run
function multiCommitIntent(bytes32[] calldata _combinedHashes) external;
Parameters
Name | Type | Description |
---|---|---|
_combinedHashes | bytes32[] | array of keccak256 hashes of sld namehash / bytes32 secret / msg.sender |
Structs
CommitData
struct CommitData {
uint96 blockNumber;
address user;
}