Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Jan 15, 2025
1 parent 4b9509d commit 7a45b94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/gno.land/r/demo/atomicswap/atomicswap.gno
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,23 @@ func NewCustomGRC20Swap(recipient std.Address, hashlock string, timelock time.Ti

allowance := token.Allowance(sender, curAddr)
require(allowance > 0, "no allowance")

userTeller := token.CallerTeller()
err := userTeller.TransferFrom(sender, curAddr, allowance)
require(err == nil, "cannot retrieve tokens from allowance")

amountStr := ufmt.Sprintf("%d%s", allowance, token.GetSymbol())
sendFn := func(to std.Address) {
err := userTeller.Transfer(to, allowance)
require(err == nil, "cannot transfer tokens")
}

swap := newSwap(sender, recipient, hashlock, timelock, amountStr, sendFn)

counter++
id := strconv.Itoa(counter)
swaps.Set(id, swap)

return counter, swap
}

Expand Down

0 comments on commit 7a45b94

Please sign in to comment.