Skip to content

Commit 05f3910

Browse files
Makefile + commands added; README updated to detail activation and big blocks switch; deployment working
1 parent 99c6bd9 commit 05f3910

9 files changed

Lines changed: 209 additions & 4 deletions

File tree

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-include .env
2+
3+
# Deploy L1Read Contract to HyperEVM
4+
deploy-read-contract:
5+
forge script script/DeployL1Read.s.sol:DeployL1Read --broadcast --legacy --account deployer -vvvvv
6+
7+
# Read the Hyperliquid Core block number using our deployed contract
8+
read-block-number:
9+
cast call $(L1READ_CONTRACT_ADDRESS) "l1BlockNumber()(uint64)" --rpc-url $(HYPEREVM_TESTNET_RPC)
10+

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@
44

55
Hyperliquid Read Precompiles docs: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/interacting-with-hypercore
66

7+
# Activate on Core
8+
If you are using a dev wallet that has never interacted with Hyperliquid before, you will need to activate it on Hyperliquid Core.
9+
10+
1. Go to: https://app.hyperliquid-testnet.xyz/drip
11+
2. Click on "Claim 1000 mock USDC"
12+
13+
# Switch to 'Big Blocks'
14+
Hyperliquid uses a dual block architecture, with small/fast blocks and large/slow blocks:
15+
"Fast block duration is set to 1 seconds with a 2M gas limit. Slow block duration is set to 1 minute with a 30M gas limit."
16+
Small/fast blocks are enabled on accounts by default, and they are not sufficient for deploying smart contracts.
17+
To get around this you need to switch your account to 'big blocks'.
18+
1. Go to: https://hyperevm-block-toggle.vercel.app/
19+
2. Toggle it to "Testnet" and click on the "Big" button
20+
3. Approve the transactions
21+
....you have successfully switched your account to big blocks and can now deploy your contract.

broadcast/DeployL1Read.s.sol/998/run-1753738168.json

Lines changed: 30 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployL1Read.s.sol/998/run-1753738264.json

Lines changed: 29 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployL1Read.s.sol/998/run-1753738626.json

Lines changed: 29 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployL1Read.s.sol/998/run-1753740481.json

Lines changed: 46 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployL1Read.s.sol/998/run-latest.json

Lines changed: 46 additions & 0 deletions
Large diffs are not rendered by default.

foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ out = "out"
44
libs = ["lib"]
55

66
[rpc_endpoints]
7-
hyperevm = "${HYPEREVM_SEPOLIA_RPC}"
7+
hyperevm = "${HYPEREVM_TESTNET_RPC}"
88

99
[etherscan]
1010
hyperevm = { key = "${HYPEREVM_ETHERSCAN_API_KEY}" }

script/DeployL1Read.s.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ contract DeployL1Read is Script {
99

1010
// deployer
1111
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
12-
12+
1313
vm.createSelectFork("hyperevm");
1414

1515
vm.startBroadcast(deployerPrivateKey);
1616

17-
// deploy OFT
18-
L1Read l1read = new L1Read{salt: "letsread"}();
17+
// deploy read contract
18+
L1Read l1read = new L1Read();
1919
console2.log("L1Read contract deployed on HyperEVM to: ", address(l1read));
2020

2121
vm.stopBroadcast();

0 commit comments

Comments
 (0)