https://github.com/dutterbutter/simple-oracle
https://github.com/dutterbutter/simple-oracle
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dutterbutter/simple-oracle
- Owner: dutterbutter
- License: mit
- Created: 2023-06-23T11:52:59.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T13:24:18.000Z (almost 3 years ago)
- Last Synced: 2025-01-10T23:42:48.200Z (over 1 year ago)
- Language: TypeScript
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zkSync Hardhat project
This project was scaffolded with [zksync-cli](https://github.com/matter-labs/zksync-cli).
## Project structure
- `/contracts`: smart contracts.
- `/deploy`: deployment and contract interaction scripts.
- `/test`: test files
- `hardhat.config.ts`: configuration file.
## Commands
- `yarn hardhat compile` will compile the contracts.
- `yarn run deploy` will execute the deployment script `/deploy/deploy-greeter.ts`. Requires [environment variable setup](#environment-variables).
- `yarn run greet` will execute the script `/deploy/use-greeter.ts` which interacts with the Greeter contract deployed.
- `yarn test`: run tests. **Check test requirements below.**
Both `yarn run deploy` and `yarn run greet` are configured in the `package.json` file and run `yarn hardhat deploy-zksync`.
### Environment variables
In order to prevent users to leak private keys, this project includes the `dotenv` package which is used to load environment variables. It's used to load the wallet private key, required to run the deploy script.
To use it, rename `.env.example` to `.env` and enter your private key.
```
WALLET_PRIVATE_KEY=123cde574ccff....
```
### Local testing
In order to run test, you need to start the zkSync local environment. Please check [this section of the docs](https://v2-docs.zksync.io/api/hardhat/testing.html#prerequisites) which contains all the details.
If you do not start the zkSync local environment, the tests will fail with error `Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.2)`
## Official Links
- [Website](https://zksync.io/)
- [Documentation](https://v2-docs.zksync.io/dev/)
- [GitHub](https://github.com/matter-labs)
- [Twitter](https://twitter.com/zksync)
- [Discord](https://discord.gg/nMaPGrDDwk)