Smart Contracts
Contracts
SldCommitIntent

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

NameTypeDescription
_combinedHashbytes32keccak256 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

NameTypeDescription
_maxBlockWaituint256Number 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

NameTypeDescription
_minBlockWaituint256Number 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

NameTypeDescription
_combinedHashesbytes32[]array of keccak256 hashes of sld namehash / bytes32 secret / msg.sender

Structs

CommitData

struct CommitData {
    uint96 blockNumber;
    address user;
}