Arcana's Auth SDK features are powered by Arcana Smart Contracts and DKG Smart Contracts.
Arcana smart contracts are deployed and run on the Polygon Network. They manage the logic and state for implementing dApp configuration settings for Auth SDK usage and ensure data privacy and access control. To learn more about the different Arcana smart contracts, their role and interactions in the Arcana Network protocol, see Arcana Smart Contract documentation.
In this guide you will find instructions on how to modify or update these contracts, compile, lint, test, generate docs from smart contract source code comments, run code coverage, report gas and deploy the Arcana smart contracts.
- Copy .env.example to .env and set environment variables
$ cp .env.example .env
- Install dependencies
$ npm i
Use the following command to compile the smart contracts with Hardhat:
$ npm run compile
Use the following command to ompile the smart contracts and generate TypeChain artifacts:
$ npm run typechain
Lint the Solidity code:
$ npm run lint:sol
Lint the TypeScript code:
$ npm run lint:ts
Run the Chai tests:
$ npm run test
Generate the code coverage report:
$ npm run coverage
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true npm run test
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ npm run clean
Generate docs to smart contracts from the comments
$ npm run docs
Deploy the contracts to Hardhat Network:
$ npm run deploy
Deploy DKG contract
$ npm run deploy-dkg
Deploy the contracts to a specific network, such as the Ropsten testnet:
$ npm run deploy:network ropsten
If you use VSCode, you can enjoy syntax highlighting for your Solidity code via the vscode-solidity extension. The recommended approach to set the compiler version is to add the following fields to your VSCode user settings:
{
"solidity.compileUsingRemoteVersion": "v0.8.3+commit.8d00100c",
"solidity.defaultCompiler": "remote"
}
Where of course v0.8.3+commit.8d00100c
can be replaced with any other version.