Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Celo native token not compatible with foundry #4559

Closed
2 tasks done
kyscott18 opened this issue Mar 14, 2023 · 1 comment
Closed
2 tasks done

Celo native token not compatible with foundry #4559

kyscott18 opened this issue Mar 14, 2023 · 1 comment
Labels
T-bug Type: bug

Comments

@kyscott18
Copy link

kyscott18 commented Mar 14, 2023

Component

Forge, Anvil

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (df8ab09 2023-03-14T10:00:26.197329Z)

What command(s) is the bug in?

No response

Operating System

macOS (Apple Silicon)

Describe the bug

This test fails I think because the celo token is a precompile. This issue is also present in Viem.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { Test } from "forge-std/Test.sol";
import { console2 } from "forge-std/console2.sol";
import { ERC20 } from "solmate/tokens/ERC20.sol";

contract CeloTest is Test {
    ERC20 celo = ERC20(0x471EcE3750Da237f93B8E339c536989b8978a438);

    // deal doesn't work in this case so use an address that already has some celo
    address addr = 0x4117f8C086a0ECA19eA21dE0AE7C5087e3C359fb;

    address recipient = makeAddr("");

    function testCeloBalance() external {
        vm.createSelectFork("celo");
        uint256 balance = celo.balanceOf(addr);

        vm.prank(addr);
        celo.transfer(recipient, 1 ether);

        assertEq(balance - 1 ether, celo.balanceOf(addr));
        assertEq(1 ether, celo.balanceOf(recipient));
    }
}
@kyscott18 kyscott18 added the T-bug Type: bug label Mar 14, 2023
@gakonst gakonst added this to Foundry Mar 14, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Mar 14, 2023
@DaniPopes
Copy link
Member

This is known. We currently only support mainnet precompiles which are implemented in Revm, and there's no way to configure this in Foundry. See also #748.

@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

2 participants