Skip to content

gnosis/labs-contracts

Repository files navigation

Gnosis Labs Contracts

Repository holding the contracts made by Gnosis Labs team.

Implemented contracts

| Contract Name | Description | Mainnet Address | TheGraph | |----------------------------|-------------------------------------------------------|-------------------------------------------||-------------------------------------------| | OmenThumbnailMapping | Manages IPFS hashes for market thumbnails on Omen 2.0 | 0xe0cf08311F03850497B0ed6A2cf067f1750C3eFc | omen-thumbnailmapping |

Omen ThumbnailMapping

Contract used to store prediction market's address to IPFS hash of an image displayed on Omen 2.0

Set up contracts development

The repository uses Foundry.

Installation

See installation instructions on https://book.getfoundry.sh/getting-started/installation.

Build

forge build

Test

forge test

Format

forge fmt

Gas Snapshots

forge snapshot

Anvil

anvil

Deploy

On Anvil

Start Anvil with

anvil

and run

forge create --rpc-url 127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 OmenThumbnailMapping

On TestNet

forge create --gas-limit 10000000 --rpc-url https://rpc.chiadochain.net  --private-key <your_private_key> OmenThumbnailMapping

On MainNet

ETHERSCAN_API_KEY=<your_api_key> forge create --verify --verifier-url https://api.gnosisscan.io/api --rpc-url https://gnosis-rpc.publicnode.com --private-key <your_private_key> OmenThumbnailMapping

Cast

cast <subcommand>

Help

forge --help
anvil --help
cast --help

Set up graph development

Graphs uses The Graph.

Installation

See installation instructions on https://thegraph.com/docs/en/developing/creating-a-subgraph/#install-the-graph-cli.

Then open directory of one of the graphs and run npm install.

Build, test, deploy

Before working with graphs, you need to run forge build in the root directory.

  • omen-thumbnailmapping - see graphs/omen-thumbnailmapping/package.json

The sequence of commands is codegen -> build -> test -> deploy.

(On MacOS Sonoma, running the tests in the docker mode is required: LimeChain/matchstick#421)

About

Contracts made by Gnosis Labs team.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published