Skip to content

fix: allow contract view calls without execute#6

Open
Urazanev wants to merge 1 commit into
Abstract-Foundation:mainfrom
Urazanev:fix/contract-write-view-read-dry-run
Open

fix: allow contract view calls without execute#6
Urazanev wants to merge 1 commit into
Abstract-Foundation:mainfrom
Urazanev:fix/contract-write-view-read-dry-run

Conversation

@Urazanev

@Urazanev Urazanev commented Jul 9, 2026

Copy link
Copy Markdown

Summary

  • Execute view/pure contract calls through the read path even when --execute is not provided
  • Keep mutating contract writes in preview mode until explicit --execute
  • Fix the upvoting skill examples to use the published agw-cli command name

Why

The upvoting skill documents read-only contract calls such as voteCost(), currentEpoch(), and userVotesRemaining(address) using contract write --dry-run. Before this change those calls returned only a preview envelope, so the user could not get the actual return value needed before voting. Since view/pure calls cannot mutate state, they can safely be executed via readContract without requiring explicit execute intent.

Test plan

  • corepack pnpm jest test/agw-runtime.test.ts --runInBand
  • corepack pnpm jest --runInBand
  • corepack pnpm lint
  • ./node_modules/.bin/tsc -p tsconfig.json --noEmit
  • corepack pnpm --dir packages/agw-core check-types
  • corepack pnpm --dir packages/agw-cli check-types
  • corepack pnpm --dir app check-types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant