@socket.tech/socket-v2-verifier-contracts
v0.0.1-test.0
Published
Verifier contracts for Socket V2 call data
Downloads
4
Readme
Socket V2 Verifier
The Socket V2 Verifier contract allows consumers of the Socket API to validate onchain that their call data will have the effects they expect.
This guards against a compromise of API servers causing users to sign malicious transactions coming from the API.
Usage
Compile
Compile the smart contracts with Hardhat:
$ yarn compile
TypeChain
Compile the smart contracts and generate TypeChain bindings:
$ yarn typechain
Test
Run the tests with Hardhat:
$ yarn test
Lint Solidity
Lint the Solidity code:
$ yarn lint:sol
Lint TypeScript
Lint the TypeScript code:
$ yarn lint:ts
Coverage
Generate the code coverage report:
$ yarn coverage
Report Gas
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true yarn test
Clean
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ yarn clean
Deploy locally
Deploy the contracts to Hardhat Network:
$ yarn deploy"
Deploy production
To deploy to production. First load a private key with enough funds for deployment. You can see the required networks in the config xdeploy.networks
section.
Then run with your private key:
$ PRIVATE_KEY="0xprivatekey" yarn deploy:prod
Production
Having to set mnemonics and api keys to develop locally is unnecessary so the template was modified to only require these for deploying and testing on live networks.
To deploy to live networks, make sure to set MNEMONIC
and INFURA_API_KEY
and NODE_ENV="production"
, via env variables or .env
file. Example available in .env.example