@alt-research/alt-contracts
v0.43.0
Published
Alt Research smart contracts in Solidity
Readme
Commands
| Command | Description |
| --------------------------------------- | ---------------------------------------------------------------------------------------- |
| forge build | npx hardhat compile | Compiles contracts. |
| forge test | npx hardhat test | Runs contract tests. |
| npm run lint | Runs Solhint and ESLint. |
| slither . | Runs Slither, a Solidity static analysis framework. |
| npm run fmt | Formats files. |
Hardhat Tasks
accounts
Usage: hardhat [GLOBAL OPTIONS] accounts --n <STRING>
OPTIONS:
--n number of accounts
--output-path output path
accounts: Generates accountse.g.
npx hardhat accounts --n 10 --output-path ./foo.jsoninit-bytecode
Usage: hardhat [GLOBAL OPTIONS] init-bytecode --args <STRING> --name <STRING> --output-path <STRING>
OPTIONS:
--args array of constructor arguments in JSON string
--name contract name
--output-path output path
init-bytecode: Returns initialization bytecodee.g.
npx hardhat init-bytecode --name ERC20PresetMinterPauser --args '["TEST", "T"]' --output-path ./foo.jsondeploy-proxy
Usage: hardhat [GLOBAL OPTIONS] deploy-proxy --args <STRING> --implementation <STRING> --opts <STRING>
OPTIONS:
--args arguments for the initializer function in JSON string
--implementation implmentation contract name
--opts an object with the following options: initializer: string | false, unsafeAllow: ValidationError[], constructorArgs: unknown[], timeout: number, pollingInterval: number, redeployImplementation: 'always' | 'never' | 'onchange', kind: 'uups' | 'transparent', usePlatformDeploy: boolean
deploy-proxy: Deploys a proxy contracte.g.
npx hardhat --network 11155111 deploy-proxy --implementation TokenFaucet --args '[]' --opts '{}'
npx hardhat --network 11155111 deploy-proxy --implementation RateLimitedCounter --args '[]' --opts '{"constructorArgs":["10","5","10","1"]}'upgrade-proxy
Usage: hardhat [GLOBAL OPTIONS] upgrade-proxy --implementation <STRING> --proxy <STRING>
OPTIONS:
--implementation implementation contract name
--proxy proxy contract address
upgrade-proxy: Upgrade a proxy contracte.g.
npx hardhat --network 11155111 upgrade-proxy --implementation BoxV2 --proxy 0x772CEf59A311D10C245fEE54A87c573Cf8119326verify-contract
Usage: hardhat [GLOBAL OPTIONS] verify-contract --address <STRING> --args <STRING> [--contract <STRING>]
OPTIONS:
--address contract address
--args constructor arguments in JSON string
--contract contract path
verify-contract: Verifies the source code for your Solidity contracts on Etherscane.g.
npx hardhat --network 11155111 verify-contract --address 0x2de8a1FDE04276a7022AA2143198CF5a12c70063 --args '[]'
npx hardhat --network 11155111 verify-contract --address 0xBc3e225a3915996A736B90EaDCcbb402BCCfee54 --args '["TEST","T"]' --contract @openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol:ERC20PresetMinterPauserstate-changes
Usage: hardhat [GLOBAL OPTIONS] state-changes --nonce <STRING> --output-path <STRING> --token-address <STRING>
OPTIONS:
--nonce nonce
--output-path output path
--token-address token address
state-changes: get state changes by noncee.g.
npx hardhat --network 11155111 state-changes --output-path ./foo.json --token-address 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 --nonce 0merkleize
Usage: hardhat [GLOBAL OPTIONS] merkleize --chunk-size <STRING> --input-path <STRING> --output-path <STRING>
OPTIONS:
--chunk-size chunk size
--input-path input path
--output-path output path
merkleize: construct merkle treee.g.
npx hardhat merkleize --output-path ./l2-merkle-tree.json --chunk-size 100 --input-path ./l2-state-changes.jsonexecute-finalization
Usage: hardhat [GLOBAL OPTIONS] execute-finalization --finalizer <STRING> --input-path <STRING> --nonce <STRING> --private-key <STRING> --target <STRING>
OPTIONS:
--finalizer finalizer
--input-path input path
--nonce nonce
--private-key private key
--target target
execute-finalization: execute finalizatione.g.
npx hardhat --network 11155111 execute-finalization --input-path ./l2-merkle-tree.json --finalizer 0xEf23e67E3EA3dCBd0ce477510ED2Ff727dc3fb74 --target 0x8558aa7784162D51730Ae51ef5BEBDC9cc383AB6 --nonce 0 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80Environment Variables
See .env.example and create .env file.
Core Development Principles and Strategies
- security in depth
- simple and modular code
- comprehensive unit testing
- pre-and-post-condition sanity checks
- clarity-driven naming conventions
- code consistency
- regular audits
License
This project is open source software.
