Skip to content

spritz-finance/contracts-core

Repository files navigation

Spritz Finance Contracts Hardhat License: MIT

Getting Started

Click the Use this template button at the top of the page to create a new repository with this repo as the initial state.

Security Toolbox

Spritz Finance contracts make use of the trailofbits/eth-security-toolbox to analyze it's contracts with the most popular eth security tools.

To download the toolbox, run docker pull trailofbits/eth-security-toolbox The toolbox isstance can then be launched by running the command yarn toolbox or docker run -it --rm -v $PWD:/src trailofbits/eth-security-toolbox from the PWD.

Slither

Open the docker shell:

yarn toolbox

Then, run:

slither /src/contracts/ --solc-remaps @openzeppelin=/src/node_modules/@openzeppelin --exclude naming-convention,external-function,low-level-calls --filter-paths @openzeppelin

To exit:

exit

Echidna

Open the docker shell:

yarn toolbox

Then, run this:

echidna-test /src/test/fuzzing/SpritzPayFuzzTest.sol --contract SpritzPayFuzzTest --config /src/test/fuzzing/config.yaml

To exit:

exit

Usage

Compile

Pre Requisites

Before being able to run any command, you need to create a .env file and set a BIP-39 compatible mnemonic as an environment variable. You can follow the example in .env.example. If you don't already have a mnemonic, you can use this website to generate one.

Then, proceed with installing dependencies:

$ yarn install

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

Deploy the contracts to Hardhat Network:

$ yarn deploy --greeting "Bonjour, le monde!"

Tips

Syntax Highlighting

If you use VSCode, you can get Solidity syntax highlighting with the hardhat-solidity extension.

License

MIT © Spritz Finance

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •