diff --git a/test/fork/BaseForkTest.sol b/test/fork/BaseForkTest.sol index 3bda514..9050d61 100644 --- a/test/fork/BaseForkTest.sol +++ b/test/fork/BaseForkTest.sol @@ -9,6 +9,7 @@ import { FixidityLib } from "celo/contracts/common/FixidityLib.sol"; // Interfaces import { IBiPoolManager } from "contracts/interfaces/IBiPoolManager.sol"; import { IBreakerBox } from "contracts/interfaces/IBreakerBox.sol"; +import { IERC20 } from "contracts/interfaces/IERC20.sol"; import { IBroker } from "contracts/interfaces/IBroker.sol"; import { ICeloProxy } from "contracts/interfaces/ICeloProxy.sol"; import { IOwnable } from "contracts/interfaces/IOwnable.sol"; @@ -119,14 +120,16 @@ abstract contract BaseForkTest is Test { function mint(address asset, address to, uint256 amount, bool updateSupply) public { if (asset == lookup("GoldToken")) { - if (!updateSupply) { - revert("BaseForkTest: can't mint GoldToken without updating supply"); - } - vm.prank(address(0)); - IMint(asset).mint(to, amount); + // with L2 Celo, we need to transfer GoldToken to the user manually from the reserve + transferCeloFromReserve(to, amount); return; } deal(asset, to, amount, updateSupply); } + + function transferCeloFromReserve(address to, uint256 amount) internal { + vm.prank(address(reserve)); + IERC20(lookup("GoldToken")).transfer(to, amount); + } } diff --git a/test/fork/ForkTests.t.sol b/test/fork/ForkTests.t.sol index d3ab0b4..541252d 100644 --- a/test/fork/ForkTests.t.sol +++ b/test/fork/ForkTests.t.sol @@ -45,7 +45,7 @@ import { GoodDollarTradingLimitsForkTest } from "./GoodDollar/TradingLimitsForkT import { GoodDollarSwapForkTest } from "./GoodDollar/SwapForkTest.sol"; import { GoodDollarExpansionForkTest } from "./GoodDollar/ExpansionForkTest.sol"; -contract Alfajores_ChainForkTest is ChainForkTest(ALFAJORES_ID, 1, uints(15)) {} +contract Alfajores_ChainForkTest is ChainForkTest(ALFAJORES_ID, 1, uints(16)) {} contract Alfajores_P0E00_ExchangeForkTest is ExchangeForkTest(ALFAJORES_ID, 0, 0) {} @@ -77,6 +77,8 @@ contract Alfajores_P0E13_ExchangeForkTest is ExchangeForkTest(ALFAJORES_ID, 0, 1 contract Alfajores_P0E14_ExchangeForkTest is ExchangeForkTest(ALFAJORES_ID, 0, 14) {} +contract Alfajores_P0E15_ExchangeForkTest is ExchangeForkTest(ALFAJORES_ID, 0, 15) {} + contract Celo_ChainForkTest is ChainForkTest(CELO_ID, 1, uints(15)) {} contract Celo_P0E00_ExchangeForkTest is ExchangeForkTest(CELO_ID, 0, 0) {}