0.11.2 • Published 2 years ago
@evmts/bun-plugin v0.11.2
@evmts/plugin-bun
A bun plugin for importing solidity files.
Installation
Install build dependencies
bun install -D bun-types @evmts/bun-plugin @evmts/ts-plugin @evmts/core solc
Setup
first create a plugins.ts
file
import { evmtsBunPlugin } from "@evmts/bun-plugin";
import { plugin } from 'bun'
plugin(evmtsBunPlugin())
Next load your plugin.ts
file in your bunfig.toml
preload = ["./plugins.ts"]
# add to [test] to use plugin in bun test too
[test]
preload = ["./plugins.ts"]
Usage
Once set up you can import solidity files directly from node modules such as openzepplin/contracts
or your source code. You can use with viem ethersjs or any other library.
import { http, createPublicClient } from 'viem'
import { optimismGoerli } from 'viem/chains'
import { ExampleContract } from './ExampleContract.sol'
export const publicClient = createPublicClient({
chain: optimismGoerli,
transport: http('https://goerli.optimism.io'),
})
const owner = '0x8f0ebdaa1cf7106be861753b0f9f5c0250fe0819'
publicClient.readContract(
ExampleContract.read({ chainId: optimismGoerli.id }).balanceOf(owner)
).then(console.log)
License 📄
1.0.0-next.18
2 years ago
1.0.0-next.17
2 years ago
1.0.0-next.15
2 years ago
1.0.0-next.13
2 years ago
1.0.0-next.12
2 years ago
1.0.0-next.11
2 years ago
1.0.0-next.9
2 years ago
1.0.0-next.8
2 years ago
1.0.0-next.6
2 years ago
1.0.0-next.5
2 years ago
1.0.0-next.4
2 years ago
1.0.0-next.3
2 years ago
1.0.0-next.2
2 years ago
1.0.0-next.0
2 years ago
0.11.2
2 years ago
0.10.0
2 years ago
0.9.0
2 years ago