Skip to content

Commit 24dd718

Browse files
authored
Clean up build script (#13)
* Update build commands and clean node-env script * fix node-envv * clean up * update doc * fixes
1 parent 35b54b0 commit 24dd718

23 files changed

+868
-890
lines changed

.gitignore

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
# Logs
22
logs
3-
codegen/*.ts
4-
codegen/abi/**
5-
!codegen/abi/.gitkeep
6-
7-
codegen/bytecode/**
8-
!codegen/bytecode/.gitkeep
9-
103
*.log
114
.env
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
pnpm-debug.log*
9+
lerna-debug.log*
10+
11+
codegen/*.ts
12+
codegen/abi/*
13+
codegen/pvm/*
14+
codegen/evm/*
15+
*.sha256.txt
16+
1217
node_modules
18+
dist
19+
dist-ssr
20+
*.local
21+
!.gitkeep
22+
src/samples
1323

1424
# Editor directories and files
1525
.vscode/*
@@ -22,3 +32,4 @@ node_modules
2232
*.sln
2333
*.sw?
2434

35+

.prettierrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ dev-node run
117117
eth-rpc run ws://localhost:9944
118118
```
119119

120+
To test contracts with Geth
121+
122+
```sh
123+
# Run geth with mitmproxy in a tmux window
124+
geth_stack
125+
```
126+
120127
# Learn more
121128

122129
- [Asset Hub documentation](https://contracts.polkadot.io) to learn more about building Smart Contracts on Asset Hub.

cli/dao-hack-traces.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ function visitor(key: string, value: any) {
6060
return value
6161
}
6262
case 'logs':
63-
return parseEventLogs({ abi: (abis as Record<string, Abi>).Dao, logs: value })
63+
return parseEventLogs({
64+
abi: (abis as Record<string, Abi>).Dao,
65+
logs: value,
66+
})
6467
default: {
6568
if (typeof value === 'bigint') {
6669
return value.toString()

cli/dao-hack.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const App = () => {
5757
}, [])
5858

5959
return (
60-
<Box flexDirection="column">
60+
<Box flexDirection='column'>
6161
<Text>🏴‍☠️ Attacker balance: {formatEther(attacker)}</Text>
6262
<Text>🏛️ DAO balance: {formatEther(dao)}</Text>
6363
</Box>

cli/playground.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,31 @@
22

33
import { env } from '../tools/lib/index.ts'
44
import { abis } from '../codegen/abis.ts'
5-
import { Storage } from '../codegen/addresses.ts'
6-
7-
{
8-
const { request } = await env.wallet.simulateContract({
9-
address: Storage,
10-
abi: abis.Storage,
11-
functionName: 'store',
12-
args: [42n],
13-
})
14-
15-
const result = await env.wallet.writeContract(request)
16-
console.log(result)
17-
}
5+
import { Caller } from '../codegen/addresses.ts'
6+
import { encodeFunctionData } from 'viem'
187

198
{
209
const result = await env.wallet.readContract({
21-
address: Storage,
22-
abi: abis.Storage,
23-
functionName: 'retrieve',
10+
address: Caller,
11+
abi: abis.Caller,
12+
functionName: 'staticCall',
2413
args: [],
2514
})
2615
console.log({ result })
2716
}
17+
18+
{
19+
const result = await env.debugClient.traceCall(
20+
{
21+
to: Caller,
22+
data: encodeFunctionData({
23+
abi: abis.Caller,
24+
functionName: 'staticCall',
25+
args: [],
26+
}),
27+
},
28+
'callTracer',
29+
)
30+
31+
console.log(result)
32+
}

cli/storage-playground.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type { Abi } from 'viem'
1717
}),
1818
},
1919
'prestateTracer',
20-
{ diffMode: false }
20+
{ diffMode: false },
2121
)
2222
console.log(res)
2323
}

codegen/pvm/.gitkeep

Whitespace-only changes.

contracts/Main.sol

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)