forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Make consistent forge script artifacts (foundry-rs#2490)
* chore: replace skip with Default * chore: replace tx with transaction * feat: add script and artifact to testdata * fix: rename 'type'; change defaults from null * fix: compiler warning * chore: forge fmt
- Loading branch information
Showing
3 changed files
with
130 additions
and
17 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
63 changes: 63 additions & 0 deletions
63
testdata/script/broadcast/deploy.sol/31337/run-latest.json
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,63 @@ | ||
{ | ||
"transactions": [ | ||
{ | ||
"hash": null, | ||
"type": "CREATE", | ||
"contractName": null, | ||
"contractAddress": "0x731a10897d267e19b34503ad902d0a29173ba4b1", | ||
"function": null, | ||
"arguments": null, | ||
"transaction": { | ||
"type": "0x02", | ||
"from": "0x00a329c0648769a73afac7f9381e08fb43dbea72", | ||
"gas": "0x54653", | ||
"value": "0x0", | ||
"data": "0x608060405234801561001057600080fd5b506103d9806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063d5dcf1271461003b578063f8194e4814610050575b600080fd5b61004e6100493660046100e9565b600155565b005b61006361005e366004610118565b610079565b60405161007091906101f9565b60405180910390f35b6060600061008783826102b5565b5060008260405160200161009b9190610375565b60405160208183030381529060405290507fefdeaaf566f7751d16a12c7fa8909eb74120f42cba334d07dd5246c48f1fba81816040516100db91906101f9565b60405180910390a192915050565b6000602082840312156100fb57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561012a57600080fd5b813567ffffffffffffffff8082111561014257600080fd5b818401915084601f83011261015657600080fd5b81358181111561016857610168610102565b604051601f8201601f19908116603f0116810190838211818310171561019057610190610102565b816040528281528760208487010111156101a957600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b838110156101e45781810151838201526020016101cc565b838111156101f3576000848401525b50505050565b60208152600082518060208401526102188160408501602087016101c9565b601f01601f19169190910160400192915050565b600181811c9082168061024057607f821691505b60208210810361026057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102b057600081815260208120601f850160051c8101602086101561028d5750805b601f850160051c820191505b818110156102ac57828155600101610299565b5050505b505050565b815167ffffffffffffffff8111156102cf576102cf610102565b6102e3816102dd845461022c565b84610266565b602080601f83116001811461031857600084156103005750858301515b600019600386901b1c1916600185901b1785556102ac565b600085815260208120601f198616915b8281101561034757888601518255948401946001909101908401610328565b50858210156103655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6502432b63637960d51b8152600082516103968160068501602087016101c9565b919091016006019291505056fea2646970667358221220a380cb042b6ca762a5a0f97e497c4cffa21c45dc21e2dab4107e5415921a704a64736f6c634300080f0033", | ||
"nonce": "0x0", | ||
"accessList": [] | ||
} | ||
}, | ||
{ | ||
"hash": null, | ||
"type": "CALL", | ||
"contractName": null, | ||
"contractAddress": "0x731a10897d267e19b34503ad902d0a29173ba4b1", | ||
"function": null, | ||
"arguments": null, | ||
"transaction": { | ||
"type": "0x02", | ||
"from": "0x00a329c0648769a73afac7f9381e08fb43dbea72", | ||
"to": "0x731a10897d267e19b34503ad902d0a29173ba4b1", | ||
"gas": "0xef15", | ||
"value": "0x0", | ||
"data": "0xf8194e48000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000046a6f686e00000000000000000000000000000000000000000000000000000000", | ||
"nonce": "0x1", | ||
"accessList": [] | ||
} | ||
}, | ||
{ | ||
"hash": null, | ||
"type": "CALL", | ||
"contractName": null, | ||
"contractAddress": "0x731a10897d267e19b34503ad902d0a29173ba4b1", | ||
"function": null, | ||
"arguments": null, | ||
"transaction": { | ||
"type": "0x02", | ||
"from": "0x00a329c0648769a73afac7f9381e08fb43dbea72", | ||
"to": "0x731a10897d267e19b34503ad902d0a29173ba4b1", | ||
"gas": "0xdcde", | ||
"value": "0x0", | ||
"data": "0xd5dcf127000000000000000000000000000000000000000000000000000000000000007b", | ||
"nonce": "0x2", | ||
"accessList": [] | ||
} | ||
} | ||
], | ||
"receipts": [], | ||
"libraries": [], | ||
"pending": [], | ||
"path": "broadcast/deploy.sol/31337/run-latest.json", | ||
"returns": {}, | ||
"timestamp": 1658913881 | ||
} |
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,38 @@ | ||
// SPDX-License-Identifier: Unlicense | ||
pragma solidity >=0.8.0; | ||
|
||
import {DSTest} from "../lib/ds-test/src/test.sol"; | ||
import {Cheats} from "../cheats/Cheats.sol"; | ||
|
||
contract Greeter { | ||
string name; | ||
uint256 age; | ||
|
||
event Greet(string greet); | ||
|
||
function greeting(string memory _name) public returns (string memory) { | ||
name = _name; | ||
string memory greet = string(abi.encodePacked("Hello ", _name)); | ||
emit Greet(greet); | ||
return greet; | ||
} | ||
|
||
function setAge(uint256 _age) external { | ||
age = _age; | ||
} | ||
} | ||
|
||
contract Deploy is DSTest { | ||
Cheats constant cheats = Cheats(HEVM_ADDRESS); | ||
|
||
Greeter greeter; | ||
string greeting; | ||
|
||
function run() external { | ||
cheats.startBroadcast(); | ||
greeter = new Greeter(); | ||
greeting = greeter.greeting("john"); | ||
greeter.setAge(123); | ||
cheats.stopBroadcast(); | ||
} | ||
} |