Skip to content

Commit

Permalink
feat(publish): set publish reward per trigger to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
murongg committed Jan 3, 2024
1 parent 44fa6d0 commit db0166c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ See also: [Verifier Contract Interface](https://github.com/DelphinusLab/halo2agg

#### Usage
```bash
zkgraph publish <ipfs_hash> <bounty_reward_per_trigger>
zkgraph publish <ipfs_hash> [bounty_reward_per_trigger]
```

#### Arguments

| Arguments | Description |
| ----------------------------- | ---------------------------------------------------------- |
| `<ipfs hash>` | IPFS hash of uploaded zkGraph |
| `<bounty reward per trigger>` | Bounty reward per trigger in ETH |
| `[bounty reward per trigger]` | Bounty reward per trigger in ETH |

### Deposit

Expand Down
4 changes: 2 additions & 2 deletions packages/zkgraph-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ See also: [Verifier Contract Interface](https://github.com/DelphinusLab/halo2agg

#### Usage
```bash
zkgraph publish <ipfs_hash> <bounty_reward_per_trigger>
zkgraph publish <ipfs_hash> [bounty_reward_per_trigger]
```

#### Arguments

| Arguments | Description |
| ----------------------------- | ---------------------------------------------------------- |
| `<ipfs hash>` | IPFS hash of uploaded zkGraph |
| `<bounty reward per trigger>` | Bounty reward per trigger in ETH |
| `[bounty reward per trigger]` | Bounty reward per trigger in ETH |

### Deposit

Expand Down
8 changes: 4 additions & 4 deletions packages/zkgraph-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ Usage cases:
})

cli
.command('publish <ipfs_hash> <bounty_reward_per_trigger>', 'Publish and Register zkGraph Onchain')
.example('zkgraph publish 0x00000000000000000000000000000000 0x00000000000000000000000000000000 100')
.usage(`publish <ipfs_hash> <bounty_reward_per_trigger>
.command('publish <ipfs_hash> [bounty_reward_per_trigger]', 'Publish and Register zkGraph Onchain')
.example('zkgraph publish 0x00000000000000000000000000000000 0')
.usage(`publish <ipfs_hash> [bounty_reward_per_trigger]
ipfs_hash: by finishing upload get it
`)
.action((ipfsHash, bountyRewardPerTrigger) => {
publish({
ipfsHash,
bountyRewardPerTrigger,
bountyRewardPerTrigger: bountyRewardPerTrigger || 0,
yamlPath: config.YamlPath,
wasmPath: config.WasmBinPath,
jsonRpcProviderUrl: config.JsonRpcProviderUrl,
Expand Down
4 changes: 2 additions & 2 deletions packages/zkgraph-cli/src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export interface PublishOptions {
}

export async function publish(options: PublishOptions) {
const { ipfsHash, jsonRpcProviderUrl, userPrivateKey, bountyRewardPerTrigger, yamlPath, wasmPath, zkWasmProviderUrl } = options
const { ipfsHash, jsonRpcProviderUrl, userPrivateKey, bountyRewardPerTrigger = 0, yamlPath, wasmPath, zkWasmProviderUrl } = options
logger.info('>> PUBLISH ZKGRAPH')
if (isNaN(bountyRewardPerTrigger)) {
logger.warn('[-] BOUNTY REWARD IS NOT A VALID NUMBER.')
logDivider()
}
const newBountyRewardPerTrigger = bountyRewardPerTrigger * 10 ** 9
const newBountyRewardPerTrigger = (Number(bountyRewardPerTrigger) || 0) * 10 ** 9

const zkgraphYaml = zkgapi.ZkGraphYaml.fromYamlPath(yamlPath)
if (!zkgraphYaml) {
Expand Down

0 comments on commit db0166c

Please sign in to comment.