🌊Smart Contract

This section explains which parameters need to be sended to the smart contract.

constructor()

constructor(address _publicKey, uint256 _cluID) {
        publicKey = _publicKey;
        cluID = _cluID;
}

The _publicKey that you need to put if you are using our public backend service is 0xd1309C93a4bF7C7a1eE81E5fC8291Adb583cc602 and the cluID is 0

useclu3()

function useclu3(uint256 _timestamp, bytes memory signature) public returns(bool) {
        bytes32 message = keccak256(abi.encodePacked(msg.sender, _timestamp, cluID));
        if(recoverSigner(message, signature) == publicKey) {
            if(checkStorage(Strings.toString(_timestamp))){
                return true;
            } else {
                revert("timestamp + cluID already used");
            }
        }
        revert("Invalid signature");
}

The arguments that needs to be passed are the _timestamp and the signature of the message returned by the backend service.

Last updated