@socket.tech/socket-v2-verifier-contracts v0.0.1-test.0
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 compileTypeChain
Compile the smart contracts and generate TypeChain bindings:
$ yarn typechainTest
Run the tests with Hardhat:
$ yarn testLint Solidity
Lint the Solidity code:
$ yarn lint:solLint TypeScript
Lint the TypeScript code:
$ yarn lint:tsCoverage
Generate the code coverage report:
$ yarn coverageReport Gas
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true yarn testClean
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ yarn cleanDeploy 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:prodProduction
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
3 years ago