No description
  • Solidity 82.3%
  • TypeScript 17.7%
Find a file
2024-09-19 12:41:45 +04:00
deploy Add zkSync support 2024-02-29 15:17:33 +04:00
lib Update config, add TurboTester and TurbodiceGame+TurboDiceCommitter 2024-06-04 12:55:58 +04:00
script Add TurboWorldchainTester sources 2024-09-19 12:41:45 +04:00
src Add TurboWorldchainTester sources 2024-09-19 12:41:45 +04:00
test Update config, add TurboTester and TurbodiceGame+TurboDiceCommitter 2024-06-04 12:55:58 +04:00
.env.example Add deployment script and instructions 2024-01-23 11:52:04 +04:00
.gitignore Add zkSync support 2024-02-29 15:17:33 +04:00
.gitmodules Add zkSync support 2024-02-29 15:17:33 +04:00
.prettierrc Update config, add TurboTester and TurbodiceGame+TurboDiceCommitter 2024-06-04 12:55:58 +04:00
foundry.toml Update config, add TurboTester and TurbodiceGame+TurboDiceCommitter 2024-06-04 12:55:58 +04:00
hardhat.config.ts Update config, add TurboTester and TurbodiceGame+TurboDiceCommitter 2024-06-04 12:55:58 +04:00
LICENSE Initial commit 2024-01-12 20:43:50 +04:00
package.json Update config, add TurboTester and TurbodiceGame+TurboDiceCommitter 2024-06-04 12:55:58 +04:00
pnpm-lock.yaml Update config, add TurboTester and TurbodiceGame+TurboDiceCommitter 2024-06-04 12:55:58 +04:00
README.md Add deployment script and instructions 2024-01-23 11:52:04 +04:00
remappings.txt Add zkSync support 2024-02-29 15:17:33 +04:00
tsconfig.json Update config, add TurboTester and TurbodiceGame+TurboDiceCommitter 2024-06-04 12:55:58 +04:00

Herodotus Turbo Smart Contract Boilerplate

Give superpowers to your Solidity contracts leveraging Herodotus Turbo, an on-chain interface to get instant access to historical & cross-chain data.

Documentation

https://docs.herodotus.dev

Usage

This repository is a template demonstrating how to use Herodotus Turbo in your Solidity contracts.

It gives you a basic contract named TurboAccountActivityChecker that uses Herodotus Turbo to get retrieve historical nonces from the chain history and use them to prove account activity and inactivity.

Turbo Interface

The Turbo interface is defined in src/turbo/ITurboSwap.sol alongside other useful content in the same directory.

Important Notes

  • In order to make the test suite pass and to be able to make your contracts functions interacting with Turbo work, you need to instantiate a TurboSwap contract from the deployed proxy address on supported chains. Please refer to the Herodotus documentation for more information.

  • To be able access to access some data from the TurboSwap, the underlying storage proofs must have been proven on-chain. Trying to access data from the TurboSwap that has not been proven yet will result in a revert.

  • To request a storage proof to be proven on-chain, you either need to use the Herodotus Turbo RPC (documentation coming soon) or use the Herodotus API.

Build

$ forge install && forge build

Deploy

Add TURBO_SWAP_PROXY_ADDRESS, ETHERSCAN_API_KEY, PRIVATE_KEY and RPC_URL to your .env file and run:

$ source .env; forge script script/TurboAccountActivityChecker.s.sol:TurboAccountActivityCheckerDeployer --rpc-url $RPC_URL --broadcast --verify --watch

Test

To run the tests, you need to fork a network where the TurboSwap contract has been deployed and instantiate a TurboSwap contract from the deployed proxy address. Create a .env file based on .env.example.

Also, accessed data must have been previously been proven on-chain.

You may need to adapt TurboAccountActivityChecker to your needs.

$ source .env; forge test --fork-url $GOERLI_FORK_URL

Deployed Contracts

Documentation

Here are some useful links for further reading:

License

Copyright 2024 - Herodotus Dev Ltd