Skip to content

Commit

Permalink
Fix contract addresses on Alfajores
Browse files Browse the repository at this point in the history
  • Loading branch information
palango authored and karlb committed Jul 10, 2024
1 parent ef6fcd6 commit e2f7bcd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/vm/celo_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ func celoPrecompileAddress(index byte) common.Address {
}

func (ctx *celoPrecompileContext) IsCallerCeloToken() (bool, error) {
return addresses.CeloTokenAddress == ctx.caller, nil
tokenAddress := addresses.CeloTokenAddress
if ctx.evm.ChainConfig().ChainID != nil && ctx.evm.ChainConfig().ChainID.Uint64() == addresses.AlfajoresChainID {
tokenAddress = addresses.CeloTokenAlfajoresAddress
}
return tokenAddress == ctx.caller, nil
}

// Native transfer contract to make CELO ERC20 compatible.
Expand Down

0 comments on commit e2f7bcd

Please sign in to comment.