Trigger OnInfuse

Example 1

In this example, this token will only accept being infused with the same token and reject anything else.

token TEST {
    import Runtime;
    trigger onInfuse(from:address, target:address, symbol:string, nftID:number)
    {
        local thisSymbol = $THIS_SYMBOL;
        Runtime.expect( thisSymbol == symbol, "Only with this token can be infused");
        return;
    }
}

Last updated