Permission BR on SC

Once users scan the chip, an internal transaction will be created from the BoyoRelayer smart contract to your smart contract. You should approve any transaction that you receive from the BoyoRelayer smart contract.

contract DestinationSample {
    event doSomthingEvent();
    address public boyoLinkRelayer=0x....; // The address of BoyoLink relayer on the specific chain.
    address owner;
    
    constructor(){
        owner=msg.sender;
    }
    modifier onlyOwner(){
        require(owner==msg.sender,"Only owner");
        _;
    }
    
    
    // Add this operation to any operation users should be able to prefrom
    // by scanning an original chip
    modifier  onlyBoyoLinkRelayer(){
        require(msg.sender==boyoLinkRelayer,"Must be called by BoyoLink relayer");
        _;
    }
    function doSomething() onlyBoyoLinkRelayer public{
        emit doSomthingEvent();
    }
}

Last updated

Was this helpful?