Smart Contract

Smart Contract Implementation (Solidity Modifier):

Here is an example of a solidity modifier that gates a core function, msg.sender must have a 0xKYC soulbound

interface OxKYC {
    function hasSoul(address _soul) external view returns (bool);
}

contract YourContractUsingOxKYC {
    OxKYC public myOxKYC;

    constructor(address OxKYCAddress) {
        myOxKYC = OxKYC(OxKYCAddress);
    }

    modifier hasSoul {
        require(myOxKYC.hasSoul(msg.sender), "Soul does not exist");
        _;
    }

    function coreFunction() public hasSoul {
        // do something
    }

Last updated