Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
490 commits
Select commit Hold shift + click to select a range
e1cc39b
use struct DealParams to create deals
dappvibe Feb 21, 2026
4080f14
taker can cancel unaccepted deal any time
dappvibe Feb 21, 2026
9c853e2
use common deploy function instead of loadFixture()
dappvibe Feb 22, 2026
8660a22
complete rewrite tests for hardhat v3 + viem
dappvibe Feb 22, 2026
816d67f
upgrade to solc 0.8.34 and disable viaIR for dev
dappvibe Feb 22, 2026
a72b376
fix: ensure address
dappvibe Feb 23, 2026
7c1e876
use bytes for inventory, do not store offers tree
dappvibe Feb 23, 2026
aa93731
Deal: do not store terms/paymentInstructions, emit event instead
dappvibe Feb 23, 2026
735fb07
Deal: derive roles dynamically and remove AccessControl
dappvibe Feb 23, 2026
e2da7ce
use calldata for params where it is not yet used
dappvibe Feb 23, 2026
70cb1d2
keccak() dispute resolutions at compile time
dappvibe Feb 23, 2026
f2beb96
remove Strings import
dappvibe Feb 23, 2026
72befd1
store feedback message in logs
dappvibe Feb 23, 2026
5c89500
pack Profile.Stats struct well
dappvibe Feb 23, 2026
020127b
protect profile from overflows
dappvibe Feb 23, 2026
fad5162
prevent infinite loops if tokens or fiats count > 255
dappvibe Feb 23, 2026
53aeda3
hardhat-tester skill explains how to measure gas
dappvibe Feb 23, 2026
0b3c914
merge DealFactory into Offer which is naturally producer of deals
dappvibe Feb 23, 2026
6f0bd02
FeeCollector's poolKey is immutable
dappvibe Feb 23, 2026
e358cc8
tests for FeeCollector
dappvibe Feb 23, 2026
db6b31b
validate chainlink oracle price
dappvibe Feb 23, 2026
96fe9c8
correctly deploy without DealFactory
dappvibe Feb 23, 2026
9367644
use safeTransfer() for tokens in Deal
dappvibe Feb 23, 2026
06edd12
Deal: buyer can't cancel until time window expired
dappvibe Feb 23, 2026
7afb947
Merge OfferFactory into Market (which is factory of offers)
dappvibe Feb 23, 2026
c68350b
subgraph: remove alchemy rpc
dappvibe Feb 23, 2026
b486e32
remove old subgraph abis duplicates
dappvibe Feb 23, 2026
f7845ae
sync token api in subgraph
dappvibe Feb 23, 2026
a1a40fb
newline that somehow keeps appearing
dappvibe Feb 23, 2026
af58c8c
remove Profile.merge(), keep tokens soulbound but transferable
dappvibe Feb 23, 2026
974e45c
check membership in Deal.feedback()
dappvibe Feb 23, 2026
07a734d
do not enforce minimum for offers
dappvibe Feb 23, 2026
0af193a
use constants for claim instead of runtime keccak
dappvibe Feb 23, 2026
8b8b871
vite: do build into single file
dappvibe Feb 23, 2026
55c8040
Parallelize Price and Allowance Fetch in useOffer
dappvibe Feb 23, 2026
05e478f
⚡ Optimize useOffers dependency tracking
dappvibe Feb 23, 2026
5d845c9
use 2 spaces for tabs, not 4
dappvibe Feb 23, 2026
d103162
generate wagmi files on each web build
dappvibe Feb 23, 2026
182edd6
Merge pull request #19 from dappvibe/parallelize-useOffer-fetch-65543…
dappvibe Feb 23, 2026
9716b92
Merge pull request #20 from dappvibe/optimize-use-offers-255882765049…
dappvibe Feb 23, 2026
f079158
Optimize formatMoney with Intl.NumberFormat caching
dappvibe Feb 23, 2026
b2eab3e
⚡ Remove @mui/icons-material dependency
dappvibe Feb 23, 2026
b9c05eb
clean out comments
dappvibe Feb 24, 2026
e389a42
fully cover Market with tests
dappvibe Feb 24, 2026
e718456
Merge remote-tracking branch 'origin/develop' into develop
dappvibe Feb 24, 2026
a004631
remove false alarm, fund() checks state
dappvibe Feb 24, 2026
3647f20
apply prettierrc
dappvibe Feb 24, 2026
0278438
additional minor tests
dappvibe Feb 24, 2026
03f0978
use interfaces for pillar contracts
dappvibe Feb 24, 2026
3d52fe7
remove redundant SSTORE write
dappvibe Feb 25, 2026
13d6b75
group openzeppelin imports
dappvibe Feb 25, 2026
cf42bfe
run configuration for all tests
dappvibe Feb 25, 2026
3bb1d14
pass finder to Deal instead of Market
dappvibe Feb 25, 2026
0de57b0
profile is not burnable after merge() was removed
dappvibe Feb 25, 2026
7309e46
Deal oracle callback returns if deal is not disputed, not reverts
dappvibe Feb 26, 2026
d5d616e
drop unused method
dappvibe Feb 26, 2026
25efd9a
custom errors in all contracts
dappvibe Feb 26, 2026
07006a3
market fee can't be higher than 2.55%, 0 by default
dappvibe Feb 26, 2026
55e8f49
use generated getter to check offer existence
dappvibe Feb 26, 2026
e109c87
slight formatting
dappvibe Feb 26, 2026
745e9f3
eliminate cross contract calls in emit
dappvibe Feb 26, 2026
d574564
minor comment
dappvibe Feb 26, 2026
a2b0ab6
remove redundant offer address check, it is done in addDeal()
dappvibe Feb 26, 2026
e726548
group methods in market
dappvibe Feb 26, 2026
c632c27
store USDC address in immutable Market impl
dappvibe Feb 26, 2026
c3672d3
significantly refactor inventory storage, massive gas savings and mul…
dappvibe Mar 1, 2026
80f54be
support for multiple methods in single Offer contract
dappvibe Mar 2, 2026
5f5f565
comment why it is bytes3 mapping key
dappvibe Mar 2, 2026
188c261
rename FinderConstants to Services
dappvibe Mar 2, 2026
7b8e1fd
remove UniswapV3Factory mock deployment
dappvibe Mar 2, 2026
d6f5b6f
use address type for simplicity
dappvibe Mar 2, 2026
b281342
deploy WETH, USDC; USD, EUR; Bank Transfer by default
dappvibe Mar 2, 2026
ea07cb5
catch-up tests to the new storage structure
dappvibe Mar 2, 2026
f8ebd84
move event definition to interface
dappvibe Mar 2, 2026
e6ea653
mock UniswapUniversalRouter
dappvibe Mar 2, 2026
cf1a43f
remove obsolete file (fiat rates http fetch was there)
dappvibe Mar 2, 2026
c47020a
remove updateRates which to be refactored as a module
dappvibe Mar 2, 2026
683d8c0
tool to generate parameters/localhost.json after mocks module
dappvibe Mar 2, 2026
63eb295
drop obsolete file which should be a module
dappvibe Mar 2, 2026
cb25913
remove arbitrum parameters files
dappvibe Mar 2, 2026
cd2e660
catchup subgraph with the new schema
dappvibe Mar 2, 2026
208a59b
agent skill describing subgraph tools
dappvibe Mar 2, 2026
57df44e
avoid error
dappvibe Mar 2, 2026
35a3193
update local address
dappvibe Mar 2, 2026
0bbec68
remove redundant docker file
dappvibe Mar 2, 2026
131940f
playwright timeout 2m -> 1m for LLM to find fails faster
dappvibe Mar 2, 2026
c6ee74c
forward browser console log to CLI so that agent can see
dappvibe Mar 2, 2026
268d2c8
reduce playwright timeout to 20s
dappvibe Mar 2, 2026
2944aa2
agent skill for playwright
dappvibe Mar 2, 2026
232354f
useInventory() fetch data from subgraph
dappvibe Mar 2, 2026
566c9eb
create offer form use the new ABI to submit offer
dappvibe Mar 2, 2026
b42138e
track generated wagmi hooks
dappvibe Mar 2, 2026
7911ad1
replace ethers with wagmi hooks in create offer form
dappvibe Mar 2, 2026
252c1d2
group to offer features
dappvibe Mar 3, 2026
93bac78
group deal feature
dappvibe Mar 3, 2026
fa73752
group profile feature
dappvibe Mar 3, 2026
7429d0e
group landing feature
dappvibe Mar 3, 2026
4e821cf
move feature/layout to shared/layout
dappvibe Mar 3, 2026
7efb059
move top level components/hooks to shared/ DDD folders
dappvibe Mar 3, 2026
75c6830
remove obsolete etherjs models
dappvibe Mar 3, 2026
662818d
filter offers list in GraphQL
dappvibe Mar 3, 2026
dd2c9cd
look for built-in payment method that is always there
dappvibe Mar 3, 2026
741062c
parse logs of actual submitted tx not general OfferCreated logs
dappvibe Mar 3, 2026
f5049cc
on offer submit wait for subgraph to index before redirect
dappvibe Mar 3, 2026
f827642
playwright timeout is 60s
dappvibe Mar 3, 2026
8377091
verbose messages om offer edits
dappvibe Mar 3, 2026
ef043c9
e2e fixtures for new offer and deal
dappvibe Mar 3, 2026
122287f
offers list e2e test
dappvibe Mar 3, 2026
7666503
fix fiat fetch (bytes3 hello)
dappvibe Mar 3, 2026
497984a
take screenshot in playwright test fails
dappvibe Mar 3, 2026
4261a5a
single playwright worker to avoid nonce errors
dappvibe Mar 4, 2026
05f1f0f
clearer --headed instructions
dappvibe Mar 4, 2026
03b7324
log browser console in e2e tests
dappvibe Mar 5, 2026
49e875f
approve before fund in e2e
dappvibe Mar 5, 2026
1a47949
e2e feedback wording fix
dappvibe Mar 5, 2026
d8c7973
fill fiat amount
dappvibe Mar 5, 2026
4196566
e2e test runner npm script
dappvibe Mar 5, 2026
53084a9
try enforce --headed harder in the skill
dappvibe Mar 5, 2026
b06971b
wait for new deal to be indexed before redirect
dappvibe Mar 5, 2026
176bc0b
wait for new deal to be indexed before redirect
dappvibe Mar 5, 2026
cec1c20
group offer crud test to describe sections
dappvibe Mar 5, 2026
e64994d
display method name instead of index on edit offer page
dappvibe Mar 5, 2026
7ae81e7
display 'paid' button for buyer
dappvibe Mar 5, 2026
ce75ebc
correct profile address after deployment module consolidation
dappvibe Mar 6, 2026
0986dd2
use wagmi for profile page
dappvibe Mar 6, 2026
41749c3
remove ethers and useContract()
dappvibe Mar 6, 2026
108e88e
client side filter of methods in offers list
dappvibe Mar 6, 2026
b6d0a59
sepolia params file with deps addresses
dappvibe Mar 7, 2026
2889c6a
Setup Vercel Web Analytics for your project
dappvibe Mar 7, 2026
5af1e3f
Merge branch 'master' of github.com:dappvibe/pexfi
dappvibe Mar 7, 2026
8bbf143
deploy: skip setting obsolete Mediator on Finder
dappvibe Mar 7, 2026
24be0e6
fixed vesting start timestamp
dappvibe Mar 7, 2026
19012c8
remove ethers related dev deps
dappvibe Mar 7, 2026
90a4fa8
sepolia deployment
dappvibe Mar 7, 2026
cda8200
link to X in announcement
dappvibe Mar 7, 2026
7cf3c63
properly pass vite args in build scripts
dappvibe Mar 7, 2026
5852348
update sepolia address for sugraph
dappvibe Mar 7, 2026
44a0cd4
compile artifacts on fresh clones
dappvibe Mar 7, 2026
efd5c13
npx on build:evm
dappvibe Mar 7, 2026
6e4efa5
new sepolia deployment
dappvibe Mar 7, 2026
2b09a30
Revert "subgraph: remove alchemy rpc"
dappvibe Mar 7, 2026
49fdac4
use https
dappvibe Mar 7, 2026
1546f1e
allow pexfi CORS origins in caddy
dappvibe Mar 7, 2026
2d7bcfa
remove hardhat network that stalls prod
dappvibe Mar 7, 2026
bc87e2e
allow any origin
dappvibe Mar 7, 2026
f5b9a1d
simplify caddy file
dappvibe Mar 7, 2026
2f4ec5d
caddy removes any downstream origins headers
dappvibe Mar 7, 2026
29ef809
another attempt to strip headers
dappvibe Mar 7, 2026
49b6c3a
use google rpc for indexing
dappvibe Mar 7, 2026
f2e1a20
manually sync address in subgraph
dappvibe Mar 7, 2026
43b5dd4
log subgraph entities
dappvibe Mar 7, 2026
354293d
fix fuckup
dappvibe Mar 7, 2026
149829e
poll new blocks every 500ms -> 1000ms, giveup after 3 attempts for re…
dappvibe Mar 8, 2026
d020230
use only alchemy for indexing
dappvibe Mar 8, 2026
0b4ead9
limit requests so that alchemy does not complain 429
dappvibe Mar 8, 2026
c07003f
duplicate limits in config file
dappvibe Mar 8, 2026
1320d99
limit parallel requests to 1
dappvibe Mar 8, 2026
7a01ee9
request receipts in batches not concurrently
dappvibe Mar 8, 2026
b028d27
block batch size to 1
dappvibe Mar 8, 2026
857fd11
back to google rpc
dappvibe Mar 8, 2026
54a42ea
back to google rpc
dappvibe Mar 8, 2026
21649ef
debug level logs
dappvibe Mar 8, 2026
a8d72d8
try infura
dappvibe Mar 8, 2026
a423b44
remove config.toml usage
dappvibe Mar 8, 2026
28776e1
try limit logs range size
dappvibe Mar 8, 2026
a557e71
bump subgraph to v0.41.2
dappvibe Mar 8, 2026
52e35fe
deploy subgraph to graph studio
dappvibe Mar 8, 2026
48811bc
correct url
dappvibe Mar 8, 2026
9cf2b8b
fix bug with incorrect astronomical price
dappvibe Mar 8, 2026
cc848b7
remove 'npm ci' to not interfere with installed packages
dappvibe Mar 8, 2026
d16d94e
do not use config.toml in local dev
dappvibe Mar 8, 2026
bb093ee
updateMarket ignition module
dappvibe Mar 8, 2026
5aa7b8b
update market on sepolia for correct price
dappvibe Mar 8, 2026
ff285cc
drop obsolete test
dappvibe Mar 9, 2026
a66c872
deduplicate useOffer() GQL fetch
dappvibe Mar 9, 2026
15e3b8d
deduplicate token entity
dappvibe Mar 9, 2026
f8a0787
delete react unit tests
dappvibe Mar 9, 2026
6ff6d6d
thirdweb connect button
dappvibe Mar 9, 2026
c278219
use connectEmbed and custom fonts
dappvibe Mar 9, 2026
84a535b
feat: add seo metadata to frontend pages
dappvibe Mar 9, 2026
9888b7b
Fix pageview tracking for hash routing and track wallet connections
dappvibe Mar 9, 2026
eeeac45
Correctly track hash routes in vercel
dappvibe Mar 9, 2026
eb89457
simplify useCreateDeal(), offer page now uses a hook to fetch and a h…
dappvibe Mar 9, 2026
fd599e7
fix: display method name in 'My Deals' instead of index
dappvibe Mar 9, 2026
07a130d
chore: deduplicate method index decoding
dappvibe Mar 9, 2026
c7d35de
fix: useMemo() instead of effect
dappvibe Mar 9, 2026
e52a99c
replace prop types with ts types
dappvibe Mar 9, 2026
2224901
chore: normalize market price in single util function
dappvibe Mar 9, 2026
b5eb52f
ux: use loading persistent messages while confirming
dappvibe Mar 9, 2026
9b10ba8
use modal connector
dappvibe Mar 10, 2026
cd1451f
remove networkSelector and ExplorerLink
dappvibe Mar 10, 2026
df97091
fix topnav to be in one row
dappvibe Mar 10, 2026
430eb7f
display horizontal menu if connected
dappvibe Mar 11, 2026
99ccc70
Merge branch 'wallet/thirdweb' into develop
dappvibe Mar 11, 2026
98f697d
fix menu again
dappvibe Mar 11, 2026
56cba64
Add GitHub Action for EVM tests
dappvibe Mar 14, 2026
8d7d4ef
fix #PEXFI-991: simplify e2e test environment detection
dappvibe Mar 14, 2026
58958bf
Add Sensible Healthchecks to Services in compose.yml (#34)
dappvibe Mar 14, 2026
ebd79b6
subgraph: remove self-hosted deployment related files
dappvibe Mar 14, 2026
8e0d488
help wagmi find hardhat
dappvibe Mar 14, 2026
c3ee143
minimize Profile contract by indexing all
dappvibe Mar 14, 2026
98e6ca2
subgraph: Dynamically generate networks.json for one-shot local deploy
dappvibe Mar 14, 2026
559e047
use built-in healthcheck for ipfs
dappvibe Mar 14, 2026
fc5b5ac
simple port probe as healthcheck
dappvibe Mar 14, 2026
65c9344
give evm time to startup
dappvibe Mar 14, 2026
39bb6bf
github e2e action to deploy local full stack and run playwright tests
dappvibe Mar 15, 2026
0968951
run full e2e suite even with failures
dappvibe Mar 15, 2026
63c3fb5
run e2e action on playwright changes
dappvibe Mar 15, 2026
3c90a93
⚡ perf: deduplicate block timestamp fetching in useDeal (#39)
dappvibe Mar 15, 2026
3ea9900
chore: reorg offer e2e test files
dappvibe Mar 15, 2026
5a4b563
chore: group offer CRUD tests
dappvibe Mar 15, 2026
b8eefdf
remove redundant allowance and approval logic
dappvibe Mar 15, 2026
22ca922
chore: create offers for deal tests directly with RPC
dappvibe Mar 15, 2026
5c8df7d
chore: quotes
dappvibe Mar 15, 2026
2419dc9
custom healtcheck for ipfs is faster
dappvibe Mar 15, 2026
7040287
ci/cd: deploy contracts with docker
dappvibe Mar 15, 2026
e01cc50
ide run configuration for deal flow
dappvibe Mar 15, 2026
c4a449a
refactor: split hooks in deals feature
dappvibe Mar 15, 2026
2aca6ab
fix: legacy peer deps for evm tests action
dappvibe Mar 15, 2026
2ddf06b
chore: remove obsolete test
dappvibe Mar 15, 2026
8357f9b
chore: rename for consistency
dappvibe Mar 15, 2026
3f59948
chore: there is only one deal screen
dappvibe Mar 15, 2026
20f6891
fix: query offer once
dappvibe Mar 15, 2026
29fcfd9
fix: rename hook to clearly show subgraph request
dappvibe Mar 15, 2026
71c713e
e2e offer crud test conf
dappvibe Mar 15, 2026
4632177
refactor: split too generic useQueryOffer
dappvibe Mar 15, 2026
a2c7074
cursor is not used
dappvibe Mar 15, 2026
7337e6a
chore: use viem Address type instead of custom 0x${string}
dappvibe Mar 15, 2026
da1a96c
draft wagmi agent skill
dappvibe Mar 15, 2026
36ed3ca
rename to useQueryDeal() for consistency with conventions
dappvibe Mar 15, 2026
dba0320
refactor: progressive rendering on deal page
dappvibe Mar 16, 2026
06e5300
refactor: remove deal context to decouple
dappvibe Mar 16, 2026
9db990f
rename to useDeal() to emphasis it returns full entity
dappvibe Mar 16, 2026
59475bf
fix: deal progress logic
dappvibe Mar 16, 2026
a323308
feat(profile): poll graph for indexed profile after minting
dappvibe Mar 16, 2026
4148597
ci(e2e): fix permission denied error on vite build
dappvibe Mar 16, 2026
a6be848
fix: add vercel analytics only in production build
dappvibe Mar 16, 2026
af6235c
fix: set reuseExistingServer to true in playwright config
dappvibe Mar 16, 2026
e4bd37e
chore(web3): migrate wagmi hooks to v3 naming
dappvibe Mar 16, 2026
d0a44a8
chore: remove staging build mode and update production configuration
dappvibe Mar 16, 2026
7f34ca6
Remove Call to Action and smart contract setup details
dappvibe Mar 16, 2026
074fec9
feat: add strongly-typed return values to useUserDeals hook
dappvibe Mar 16, 2026
e587a7e
test: Test E2E against production build
dappvibe Mar 16, 2026
792c0e9
fix: update WalletMenu to use wagmi v3 hook methods correctly
dappvibe Mar 16, 2026
225acd9
deal creation e2e test to validate redirection
dappvibe Mar 16, 2026
d3dfe35
remove to not confuse agents
dappvibe Mar 16, 2026
c2b96b4
feat: replace thirdweb connect button with web3-onboard
dappvibe Mar 16, 2026
d5d73a0
fix: Web3Onboard config filters chains when in E2E mode to prevent ra…
dappvibe Mar 16, 2026
d6c45c5
fix: properly destructure useAccount instead of useConnection
dappvibe Mar 16, 2026
920954b
Hi, it's Jules! I've updated the code to use `writeContractAsync` ove…
dappvibe Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
135 changes: 135 additions & 0 deletions .agent/skills/hardhat-tester/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
name: hardhat-tester
description: Solidity contracts testing guides using Hardhat3. This skill should be used when writing, reviewing or refactoring unit tests to run against deployed contracts in local in-memory hardhat instance or blockchain deployments.
---

# When to Apply

Reference these guidelines when:
- Writing unit tests to check Solidity contracts functionality
- Creating or changing Solidity contracts that requires testing

# Architectural guidelines

You MUST use latest hardhat v3 with TypeScript, viem and 'node:test' engine.

To deploy initial state of blockchain and contracts you MUST use ignition modules.
If you need fixtures check for existing ignition modules that may provide mocks or initial values. You are required to load ignition module directly in tests.
Goal is to replicate blockchain state as if was deployed with ignition to a live blockchain.

# Running tests

`npx hardhat test`

# Using network in Hardhat 3

Hardhat 3 creates multiple networks which is very different from hardhat 2.
Tools are no longer exported from hardhat module, but from connected module.

Correct usage:
```
import { network } from "hardhat";
const { ignition, viem, networkHelpers } = await network.connect();
```

# Accounts

Hardhat has pre-defined 20 accounts accessible with:
```
import { network } from "hardhat";
const { ignition, viem, networkHelpers } = await network.connect();
const clients = await viem.getWalletClients()
const deployer = clients[0]
```

For simple single account tests default is account indexed at 0.

# Blockchain state snapshots

To improve tests performance you SHOULD use snapshots of a clear blockchain state instead of deploying each time.

Example:
```
const { networkHelpers } = await hre.network.connect();
const snapshot = await networkHelpers.takeSnapshot();
await snapshot.restore(); // Restores the blockchain state
```

## Fixtures

The loadFixture function is useful in tests where you need to set up the blockchain to a desired state (like deploying contracts, minting tokens, etc.) and then run multiple tests based on that state.

It executes the given fixture function, which should set up the blockchain state, and takes a snapshot of the blockchain. On subsequent calls to loadFixture with the same fixture function, the blockchain is restored to that snapshot rather than executing the fixture function again.

The fixture function receives the connection object as its only argument, allowing you to interact with the network.

Do not pass anonymous functions as the fixture function. Passing an anonymous function like loadFixture(async () => { ... }) will bypass the snapshot mechanism and result in the fixture being executed each time. Instead, always pass a named function, like loadFixture(deployTokens).

```
type Fixture<T> = (connection: NetworkConnection) => Promise<T>;
loadFixture(fixture: Fixture<T>): Promise<T>
// fixture: A named asynchronous function that sets up the desired blockchain state and returns the fixture’s data.
```

Example:
```
async function setupContracts({ viem }: NetworkConnection) {
const contractA = await viem.deployContract("ContractA");
const contractB = await viem.deployContract("ContractB");
return { contractA, contractB };
}
const { contractA, contractB } = await loadFixture(setupContracts);
```

# Viem Assertions

Correct:
```
import { describe, it } from "node:test";
import hre from "hardhat";

const { viem, networkHelpers } = await hre.network.connect();

describe("Counter", function () {
it("Should emit the Increment event when calling the inc() function", async function () {
const counter = await viem.deployContract("Counter");

await viem.assertions.emitWithArgs(
counter.write.inc(),
counter,
"Increment",
[1n],
);
});

it("Should allow the owner to increment and revert for non-owners", async function () {
const counter = await viem.deployContract("Counter");

const nonOwnerAddress = "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

// Impersonate the non-owner account
await networkHelpers.impersonateAccount(nonOwnerAddress);

// Fund the non-owner account with some ETH to pay for gas
await networkHelpers.setBalance(nonOwnerAddress, 10n ** 18n);

// Call inc() as the owner - should succeed
await viem.assertions.emitWithArgs(
counter.write.inc(),
counter,
"Increment",
[1n],
);

// Call inc() as a non-owner - should revert
await viem.assertions.revertWith(
counter.write.inc({ account: nonOwnerAddress }),
"only the owner can increment the counter",
);
});
});
```

# Gas Stats

When solving tasks for optimization and gas savings use `--gas-stats` option for test runner to compare results.
9 changes: 9 additions & 0 deletions .agent/skills/jules-api/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: jules
description: 'Scripts to communicate with Jules AI - An Autonomous Coding Agent'
---

Jules has access to source code on GitHub. Source is `github/dappvibe/pexfi`
Always work on this source and access to any other listed sources is forbidden.

Only outsource tasks when explicitly asked by user.
28 changes: 28 additions & 0 deletions .agent/skills/jules-api/scripts/approve-plan.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { julesFetch, ApprovePlanRequest, ApprovePlanResponse } from './client.js';

async function main() {
const sessionName = process.argv[2];

if (!sessionName) {
console.error('Usage: npx tsx approve-plan.ts <session-name>');
console.error('Example: npx tsx approve-plan.ts sessions/12345');
process.exit(1);
}

// Use strict type (empty object)
const payload: ApprovePlanRequest = {};

try {
await julesFetch<ApprovePlanResponse>(`${sessionName}:approvePlan`, {
method: 'POST',
body: JSON.stringify(payload)
});

console.log(`Plan for session ${sessionName} approved successfully.`);

} catch (error) {
process.exit(1);
}
}

main();
Loading
Loading