a0ki-credits-presale

1 minute read

One of the interesting elements of the A0K1Credits contract is the implementation of the presale. The presale price is the same as the regular sale price.

function activate(
    uint256 startTime_,
    uint256 duration,
    uint256 presaleInterval_,
    uint256 claimStartTime_,
    uint256 claimEndTime_
) external override adminRequired {
    _activate(
        startTime_,
        duration,
        presaleInterval_,
        claimStartTime_,
        claimEndTime_
    );
}

Following the inheritance structure, this activate method calls the _activate method in the CollectionBase Contract:

function _activate(
    uint256 startTime_,
    uint256 duration,
    uint256 presaleInterval_,
    uint256 claimStartTime_,
    uint256 claimEndTime_
) internal virtual {
    require(!active, "Already active");
    require(startTime_ > block.timestamp, "Cannot activate in the past");
    require(
        presaleInterval_ < duration,
        "Presale Interval cannot be longer than the sale"
    );
    require(
        claimStartTime_ <= claimEndTime_ && claimEndTime_ <= startTime_,
        "Invalid claim times"
    );
    startTime = startTime_;
    endTime = startTime + duration;
    presaleInterval = presaleInterval_;
    claimStartTime = claimStartTime_;
    claimEndTime = claimEndTime_;
    active = true;

    emit CollectionActivated(
        startTime,
        endTime,
        presaleInterval,
        claimStartTime,
        claimEndTime
    );
}

Meta Data

Source: a0k1Credits-nft-contract

Relevant Context(s):

Related Notes:

  • a0k1credits-token