From e7c1698fa4761566fbb6ac9a71327e71bdd6dc59 Mon Sep 17 00:00:00 2001 From: Malek Lahbib <111009238+MalekLahbib@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:56:52 +0200 Subject: [PATCH] will be update when more clarity, will be used as the gnofundme token as suggested by @moul --- examples/gno.land/r/malek_/gfmt/gfmt.gno | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/gno.land/r/malek_/gfmt/gfmt.gno b/examples/gno.land/r/malek_/gfmt/gfmt.gno index 285ad026c88..9a9bdea19b6 100644 --- a/examples/gno.land/r/malek_/gfmt/gfmt.gno +++ b/examples/gno.land/r/malek_/gfmt/gfmt.gno @@ -12,9 +12,10 @@ import ( ) var ( - banker *grc20.Banker - admin *ownable.Ownable - Token grc20.Token + banker *grc20.Banker + admin *ownable.Ownable + Token grc20.Token + ErrInvalidUint64 = errors.New("invalid uint64, must be between 0 and 18446744073709551615") ) func init() { @@ -39,6 +40,11 @@ func Deposit() { } func Withdraw(amount uint64) { + // check for overflow + // if amount < 0 || amount > 18446744073709551615 { + // panic("Invalid amount: Overflow uint64") + // } + require(amount >= gfmtMinDeposit, ufmt.Sprintf("Deposit below minimum: %d/%d gfmt.", amount, gfmtMinDeposit)) caller := std.PrevRealm().Addr()