-
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.
Run CodeJar Code Constructors (#164)
* Run CodeJar Code Constructors Okay okay okay, after long last, we do the Solidity thing to feed the Solidity monster. Specifically, here we run CodeJar's constructor code as initCode, instead of returning it via a newly assembled script. This has advantages and drawbacks, specifically: 1. Pro: scripts can be easily verified 2. Pro: scripts can use const immutables 3. Con: scripts are less deterministic 4. Con: scripts can't be raw evm opcodes 5. Con: scripts can be more malicious (e.g. `owner = tx.origin`) Overall it looks like the pros outweigh the cons, esp. when you consider people are only running scripts they truly trust and thus (4) and (5) become pretty nullified. Weirdly aside of a few tests that were pretty degenerative (testing specific nuances of CodeJar itself), every other test case is passing. We'll need to rethink the deeper core CodeJar tests, but the vast majority of things are good with this change. Weird. Patches: * Add a constructor with const immutable check * Check creation code > 0, and add a few more test cases * Lint * Add a variety of test cases for metamorphic contracts and the wackiness they can present * refactor: scriptSource***s***, and rough test fixes--will go back over * chore: forge fmt, but on nightly this time * bugfix+test+hack: try to fix array encoding and add a test case for structhash, but this isn't working very well * chore: forge fmt * test: address FIXMEs and update outdated test cases * Fix Struct Hash Test This fixes struct hash test. As we build the struct hash otherwise in JavaScript, we need to fix a few values, which isn't a problem per se since it's testing the same thing we'd expect. Patches: * Run format * Add true external Eip-712 signature test * Move `stub` to `YulHelper` * refactor/minor: address style comments in QuarkWallet.sol * test: bring back the empty code EIP-1271 signer test case * refactor: remove InvalidScriptAddress and just fall on EmptyCode * minor: fix compiler warning about unused variable * doc: add a TODO for refactoring QuarkOperationHelper * chore: forge fmt * chore: commit new gas snapshot --------- Co-authored-by: fluffywaffles <[email protected]>
- Loading branch information
1 parent
75d28ee
commit 3a4c3f6
Showing
44 changed files
with
888 additions
and
534 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.