Verax is mainly composed of a set of smart contracts that allows anyone to read and write Attestations.
forge build
forge test
forge coverage
- Copy an
.env.NETWORK
file from theenv
folder to a.env
file:cp env/.env.linea .env
- Fill it with your Infura key, your private key and your chain explorer API key
- Update the
hardhat.config.ts
file with:- A new entry to the
networks
object - A new entry to the
etherscan.apiKey
object - A new entry to the
etherscan.customChains
array
- A new entry to the
- Add a new entry to the
script/utils.ts
file to define:- If the network is a testnet or a mainnet (cf.
isTestnet
) - The network's dedicated chain prefix (cf.
chainPrefix
)
- If the network is a testnet or a mainnet (cf.
- Run the
pnpm run deploy NETWORK_NAME
command (replacingNETWORK_NAME
with the name of the targeted network) - Note down the summarized addresses (proxies), and the total logs can be of interest too
- Add the addresses of the Verax registries to the
.env.NETWORK
and your.env
files
If the targeted network benefits from an EAS instance, you can deploy the contract enabling the EAS-Verax compatibility.
- Add the address of the EAS registry to the
EAS_REGISTRY_ADDRESS
value in your.env
file - Run the
pnpm run deploy:eas NETWORK_NAME
command (replacingNETWORK_NAME
with the name of the targeted network) - Note down the Attestation Reader contract address
- Add the Attestation Reader contract address to the
.env.NETWORK
and your.env
files
- Gather the first list of Issuer addresses
- Set the issuers via the PortalRegistry’s
setIssuers
method
- Deploy an instance of DefaultPortal via the PortalRegistry’s
deployDefaultPortal
method and note down its address - Verify this contract via
npx hardhat verify --network NETWORK_NAME ADDRESS
(replacingNETWORK_NAME
with the name of the targeted network andADDRESS
with the address of the freshly deployedDefaultPortal
)
Run pnpm run check:implementations
to check if the local versions of the registries follow the upgradeability rules.
Run pnpm run check:upgradeability NETWORK_NAME
(replacing NETWORK_NAME
with the name of the targeted network) to
check if the already deployed registries are upgradable to the new local versions.
Run pnpm run check:size
to check if all the contracts have a size below the threshold for deployment (24KiB).
- Check your
.env
file contains the address of all the proxies for the targeted network - Upgrade only the implementations that have changed since the last upgrade via the
pnpm run upgrade NETWORK_NAME
command - Optional: Upgrade all the implementations by forcing their re-deployment via the
pnpm run upgrade:force NETWORK_NAME
command
Run pnpm run reimport NETWORK_NAME
(replacing NETWORK_NAME
with the name of the targeted network) to re-generate the
network files describing the deployed contracts.
The core contracts are available on npm as a library. To deploy the library, follow the steps below:
- Upgrade the package version in package.json
- Test the deployment on npm
pnpm run publish:dry-run
- Deploy on npm
pnpm run publish:public
Change the arguments you want to use for the verify action in contracts/script/arguments.ts
, then run:
npx hardhat verify --network NETWORK_NAME CONTRACT_ADDRESS --constructor-args contracts/script/arguments.ts
Issuers may have Schemas associated with them. When removing issuers, you will need to reassign schema ownership by calling the following methods :
- updateSchemaIssuer
- bulkUpdateSchemasIssuers