Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void UnApprove(Address spender, ulong amount)
 {
     Allowances.Reduce(spender, amount);
     new UnApproved()
     {
         Owner   = Api.GetTransaction().From,
         Spender = spender,
         Amount  = amount
     }.Fire();
 }
Ejemplo n.º 3
0
 public ulong Allowance(Address owner, Address spender)
 {
     return(Allowances.GetAllowance(owner, spender));
 }