@chainlink/evm-gauntlet-functions
v1.4.1
Published
EVM Gauntlet Functions
Readme
Chainlink Functions package
This package is an contains the comands necessary for interacting with the Chainlink Functions contracts
Handling contract updates
Whenever a contract is changed, the ABI and build must be updated this Gauntlet package.
Prerequisites:
First, ensure that Foundry is installed
In your local environment set the following environment variable to tell Foundry to use the Functions profile:
export FOUNDRY_PROFILE=functionsTo update an ABI:
- From the @chainlink repository go to
/contracts. - Run
forge build - In the folder
./contracts/foundry-artifacts/<contract name>/<contract name>.jsonthere will be artifacts. Find the relevant contracts and copy the ABI.
To regenerate the FunctionsContracts.build.json file:
- From the @chainlink repository go to
/contracts. - In
foundry.tomlthe[profile.functions]temporarily updatetestto point only to the
test = 'src/v0.8/functions/tests/v1_X/testhelpers/FunctionsClientUpgradeHelper.sol'- Run:
forge build --build-info --build-info-path=./info- You will notice a new folder in
./contracts/info. Verify that it looks as expected, then copy the contents intoFunctionsContracts.build.json
*If using Linux, remove the .Linux.gcc suffix from the end of the field "solcLongVersion"
Using a local build
There are scenarios such as when testing new code or deploying to a staging DON that you may want to make changes and use them through the Gauntlet package.
The proper way to do this would be:
- Make experimental changes
- Bump the version here in
gauntlet-evm's@chainlink/evm-gauntlet-functionspackage.json - Run
yarn buildfrom thegauntlet-evmrespository - Now in the
gauntletrepository link local package version usingnpm link [path to gauntlet-evm's @chainlink/evm-gauntlet-functions package.json] - Change
gauntlet's package.json to depend on the local version that was bumped to ingauntlet-evm's@chainlink/evm-gauntlet-functionspackage.json - Run
yarn installfrom thegauntletrepository - Run
yarn buildfrom thegauntletrepository - To verify, the
gauntletrepository'snode_modulesshould have@chainlink/evm-gauntlet-functionswith the version that you set locally and runningnpm ls -gshould show the local package version - Now that the packages are linked any hot changes to
gauntlet-evmcan be reloaded by runningyarn buildingauntlet-evmand then again ingauntlet
