Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
fbac committed Oct 7, 2024
1 parent eb7873c commit 17cdcab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion precompiles/bank/method_withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (c *Contract) withdraw(
return nil, err
}

// Safety check: token has to be a valid whitelisted ZRC20 and not be paused.
// Safety check: token has to be a non-paused whitelisted ZRC20.
if err := c.fungibleKeeper.IsValidZRC20(ctx, zrc20Addr); err != nil {
return nil, &ptypes.ErrInvalidToken{
Got: zrc20Addr.String(),
Expand Down
8 changes: 8 additions & 0 deletions x/fungible/keeper/zrc20_unlock_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ func (k Keeper) UnlockZRC20(
return fmt.Errorf("zrc20 address cannot be zero")
}

if err := k.IsValidZRC20(ctx, zrc20Address); err != nil {
return err
}

if err := k.CheckFungibleZRC20Balance(ctx, zrc20ABI, zrc20Address, amount); err != nil {
return err
}

args := []interface{}{to, amount}
res, err := k.CallEVM(
ctx,
Expand Down
8 changes: 1 addition & 7 deletions x/fungible/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,11 @@ func KeyPrefix(p string) []byte {
}

var (
ModuleAddress = authtypes.NewModuleAddress(ModuleName)
//ModuleAddressEVM common.EVMAddress
ModuleAddress = authtypes.NewModuleAddress(ModuleName)
ModuleAddressEVM = common.BytesToAddress(ModuleAddress.Bytes())
AdminAddress = "zeta1rx9r8hff0adaqhr5tuadkzj4e7ns2ntg446vtt"
)

func init() {
//fmt.Printf("ModuleAddressEVM of %s: %s\n", ModuleName, ModuleAddressEVM.String())
// 0x735b14BB79463307AAcBED86DAf3322B1e6226aB
}

const (
SystemContractKey = "SystemContract-value-"
)

0 comments on commit 17cdcab

Please sign in to comment.