Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add simple contract and config file for docs #417

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/codegen/SimpleContract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// contracts/SimpleContract.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract SimpleContract {
uint256 public data;

function setData(uint256 _data) public {
data = _data;
}

function getData() public view returns (uint256) {
return data;
}
}
32 changes: 32 additions & 0 deletions packages/codegen/example.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
contracts:
# Contract name:
- name: SimpleContract
# Contract file path or an url:
path: ./SimpleContract.sol
# Contract kind (should match name of dataSource in {subgraphPath}/subgraph.yaml if subgraphPath provided)
#kind: Example1

# Output folder path (logs output using `stdout` if not provided).
outputFolder: ../simple-contract-watcher

# Code generation mode [eth_call | storage | all | none] (default: none).
mode: none

# Kind of watcher [lazy | active] (default: active).
kind: lazy

# Watcher server port (default: 3008).
port: 3008

# Solc version to use (optional)
# If not defined, uses solc version listed in dependencies
solc: v0.8.0+commit.c7dfd78e

# Flatten the input contract file(s) [true | false] (default: true).
flatten: true

# Path to the subgraph build (optional).
# Can set empty contracts array when using subgraphPath.
# subgraphPath: ../graph-node/test/subgraph/example1/build

# NOTE: When passed an *URL* as contract path, it is assumed that it points to an already flattened contract file.