public void TransferFrom(Address from, Address to, ulong amount) { var allowance = Allowances.GetAllowance(from, Api.GetTransaction().From); Api.Assert(allowance > amount, "Insufficient allowance."); DoTransfer(from, to, amount); Allowances.Reduce(from, amount); }
public ulong Allowance(Address owner, Address spender) { return(Allowances.GetAllowance(owner, spender)); }