-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Foundry Foreign Interface to File System (#10)
* Refactor to use ffs instead of ffi * Add seemingly newer broadcast type, without rpc * Remove call to cleanStringPath, incompatible with fs_permissions * Add makefile * added example that doenst work --------- Co-authored-by: PatrickAlphac <[email protected]>
- Loading branch information
1 parent
a8f7a89
commit 5415faa
Showing
13 changed files
with
399 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"transactions": [ | ||
{ | ||
"hash": "0x642b1f5b3c0f5e2972d9e2e32d0af76d52017236fdccc4678c8b403245e15a3b", | ||
"transactionType": "CREATE", | ||
"contractName": "Stuff", | ||
"contractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", | ||
"function": null, | ||
"arguments": null, | ||
"transaction": { | ||
"type": "0x02", | ||
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", | ||
"gas": "0x191eb", | ||
"value": "0x0", | ||
"data": "0x6080604052348015600f57600080fd5b50607780601d6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063cf33c3be14602d575b600080fd5b600760405190815260200160405180910390f3fea26469706673582212200382dc5886d11d466628cc59d88a4311d34375a8581173060a08b39ffe47d32464736f6c63430008150033", | ||
"nonce": "0x0", | ||
"accessList": [] | ||
}, | ||
"additionalContracts": [], | ||
"isFixedGasLimit": false | ||
} | ||
], | ||
"receipts": [ | ||
{ | ||
"transactionHash": "0x642b1f5b3c0f5e2972d9e2e32d0af76d52017236fdccc4678c8b403245e15a3b", | ||
"transactionIndex": "0x0", | ||
"blockHash": "0x73373ba2a0b941145f4b90354551b964a6fa7ace4a9517590a2caa952b9d2c75", | ||
"blockNumber": "0x8", | ||
"from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", | ||
"to": null, | ||
"cumulativeGasUsed": "0x13535", | ||
"gasUsed": "0x13535", | ||
"contractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", | ||
"logs": [], | ||
"status": "0x1", | ||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
"type": "0x2", | ||
"effectiveGasPrice": "0xca386e61" | ||
} | ||
], | ||
"libraries": [], | ||
"pending": [], | ||
"returns": {}, | ||
"timestamp": 1700448371, | ||
"chain": 31337, | ||
"multi": false, | ||
"commit": "742f1ca" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"transactions": [ | ||
{ | ||
"hash": "0xb9af5f14dd8208e7a5fa4315f2e23e915c56ecf8b37f11c1abe0086a3a3f0f30", | ||
"transactionType": "CREATE", | ||
"contractName": "NewStuff", | ||
"contractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", | ||
"function": null, | ||
"arguments": null, | ||
"transaction": { | ||
"type": "0x02", | ||
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", | ||
"gas": "0x191eb", | ||
"value": "0x0", | ||
"data": "0x6080604052348015600f57600080fd5b50607780601d6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063cf33c3be14602d575b600080fd5b600760405190815260200160405180910390f3fea26469706673582212201d5632e18d7fe499584a6ee0e5aa0e7e68761b304d3018503db2bb4badc34e8264736f6c63430008150033", | ||
"nonce": "0x0", | ||
"accessList": [] | ||
}, | ||
"additionalContracts": [], | ||
"isFixedGasLimit": false | ||
} | ||
], | ||
"receipts": [ | ||
{ | ||
"transactionHash": "0xb9af5f14dd8208e7a5fa4315f2e23e915c56ecf8b37f11c1abe0086a3a3f0f30", | ||
"transactionIndex": "0x0", | ||
"blockHash": "0x177a9f26fdfb32f329fbdac84132e343500da1f100eb3fd1d8c234b471338d41", | ||
"blockNumber": "0x1", | ||
"from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", | ||
"to": null, | ||
"cumulativeGasUsed": "0x13535", | ||
"gasUsed": "0x13535", | ||
"contractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", | ||
"logs": [], | ||
"status": "0x1", | ||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
"type": "0x2", | ||
"effectiveGasPrice": "0xee6b2800" | ||
} | ||
], | ||
"libraries": [], | ||
"pending": [], | ||
"returns": {}, | ||
"timestamp": 1700352554, | ||
"chain": 31337, | ||
"multi": false, | ||
"commit": "f421ebf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"transactions": [ | ||
{ | ||
"hash": "0xb9af5f14dd8208e7a5fa4315f2e23e915c56ecf8b37f11c1abe0086a3a3f0f30", | ||
"transactionType": "CREATE", | ||
"contractName": "NewStuff", | ||
"contractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", | ||
"function": null, | ||
"arguments": null, | ||
"transaction": { | ||
"type": "0x02", | ||
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", | ||
"gas": "0x191eb", | ||
"value": "0x0", | ||
"data": "0x6080604052348015600f57600080fd5b50607780601d6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063cf33c3be14602d575b600080fd5b600760405190815260200160405180910390f3fea26469706673582212201d5632e18d7fe499584a6ee0e5aa0e7e68761b304d3018503db2bb4badc34e8264736f6c63430008150033", | ||
"nonce": "0x0", | ||
"accessList": [] | ||
}, | ||
"additionalContracts": [], | ||
"isFixedGasLimit": false | ||
} | ||
], | ||
"receipts": [ | ||
{ | ||
"transactionHash": "0xb9af5f14dd8208e7a5fa4315f2e23e915c56ecf8b37f11c1abe0086a3a3f0f30", | ||
"transactionIndex": "0x0", | ||
"blockHash": "0x177a9f26fdfb32f329fbdac84132e343500da1f100eb3fd1d8c234b471338d41", | ||
"blockNumber": "0x1", | ||
"from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", | ||
"to": null, | ||
"cumulativeGasUsed": "0x13535", | ||
"gasUsed": "0x13535", | ||
"contractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", | ||
"logs": [], | ||
"status": "0x1", | ||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
"type": "0x2", | ||
"effectiveGasPrice": "0xee6b2800" | ||
} | ||
], | ||
"libraries": [], | ||
"pending": [], | ||
"returns": {}, | ||
"timestamp": 1700352554, | ||
"chain": 31337, | ||
"multi": false, | ||
"commit": "f421ebf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule forge-std
updated
26 files
+48 −6 | .github/workflows/ci.yml | |
+29 −0 | .github/workflows/sync.yml | |
+1 −1 | foundry.toml | |
+1 −1 | package.json | |
+5 −3 | src/Base.sol | |
+4 −3 | src/Script.sol | |
+26 −15 | src/StdChains.sol | |
+195 −17 | src/StdCheats.sol | |
+16 −1 | src/StdInvariant.sol | |
+18 −14 | src/StdJson.sol | |
+54 −3 | src/StdStorage.sol | |
+2 −2 | src/StdStyle.sol | |
+11 −2 | src/StdUtils.sol | |
+4 −3 | src/Test.sol | |
+568 −187 | src/Vm.sol | |
+394 −382 | src/console2.sol | |
+13,248 −0 | src/safeconsole.sol | |
+93 −77 | test/StdAssertions.t.sol | |
+114 −58 | test/StdChains.t.sol | |
+236 −44 | test/StdCheats.t.sol | |
+10 −10 | test/StdError.t.sol | |
+27 −12 | test/StdMath.t.sol | |
+66 −34 | test/StdStorage.t.sol | |
+4 −4 | test/StdStyle.t.sol | |
+80 −35 | test/StdUtils.t.sol | |
+15 −0 | test/Vm.t.sol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.PHONY: update anvil deploy | ||
|
||
DEFAULT_ANVIL_KEY := 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | ||
|
||
update:; forge update | ||
|
||
anvil:; anvil -m 'test test test test test test test test test test test junk' --steps-tracing --block-time 1 | ||
|
||
deploy:; forge script script/DeployStuff.s.sol:DeployStuff --broadcast --rpc-url http://localhost:8545 --private-key $(DEFAULT_ANVIL_KEY) -vvvv | ||
|
||
interact:; forge script script/InteractWithStuff.s.sol:InteractWithStuff --broadcast --rpc-url http://localhost:8545 --private-key $(DEFAULT_ANVIL_KEY) -vvvv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import {DevOpsTools} from "../src/DevOpsTools.sol"; | ||
import {Stuff} from "./DeployStuff.s.sol"; | ||
|
||
contract InteractWithStuff is Script { | ||
function run() external { | ||
address mostRecent = DevOpsTools.get_most_recent_deployment("DeployStuff", block.chainid); | ||
uint256 value = Stuff(mostRecent).getSeven(); | ||
assert(value == 7); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.19; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
|
||
contract NewStuff { | ||
function getSeven() public pure returns (uint256) { | ||
return 7; | ||
} | ||
} | ||
|
||
contract NewDeployStuff is Script { | ||
function run() external { | ||
vm.startBroadcast(); | ||
new NewStuff(); | ||
vm.stopBroadcast(); | ||
} | ||
} |
Oops, something went wrong.