Extensions for forge-std and added utilities that are shared between mento-core
and mento-deployments
, and potentially other Mento Solidity repositories.
Provides helpers to build dynamic arrays of finite length by the use of overloaded functions. The Array.sol file is generated by this script, which can be called by running:
pnpm gen:array-helpers
The configuration is stored in the script file:
const TARGETS = {
uints: {
type: "uint256"
},
addresses: {
type: 'address'
},
bytes4s: {
type: 'bytes4'
},
bytes32s: {
type: 'bytes32'
}
} as const;
const MAX_SIZE = 8;
CeloChains is an extension of the StdChains
contract in forge-std
.
It adds the celo specific chains to the registered chains in StdChains
, and adds
a couple of convenience methods.
The contract implements the logic to lookup contract addresses that can be derived from:
- A dependencies.json file.
- Contract creations recorded in broadcast scripts, that are explicitly loaded by calling
load
. - The Celo registry.
- The GovernanceFactory contract, if it can be found in (1) or (2).
Usage:
import {Script} from "mento-std/Script.sol"
contract SomeScript is Script {
function setUp() {
load("DeploySomething", "latest");
}
function doSufff() {
address something = lookup("Something");
}
}
Minimum precompiles helper which only treats the TRANSFER precompile, it seams like after the L2 move this will be the only one left, and it's the only one we have ever cared about at mento.
Base Script
contract that composes from base forge-std
modules and extends them with the local modules.
Base Test
contract that composes from base forge-std
modules and extends them with the local modules.