-
Notifications
You must be signed in to change notification settings - Fork 43
Update gas station SDK with post audit contracts #1089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dbf451b
Update gas station contract addresses and modify intent builder types…
Bijan-Massoumi 56ae522
Update gas station contract addresses and modify intent builder types…
Bijan-Massoumi 44c13b9
Refactor contract condition mapping for improved readability in polic…
Bijan-Massoumi 632d53c
Add new changeset for major update to gas station contract addresses
Bijan-Massoumi 9997e60
Update gas station SDK to reflect audited contract changes, including…
Bijan-Massoumi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,22 @@ | ||
| --- | ||
| "@turnkey/gas-station": major | ||
| --- | ||
|
|
||
| Updated the `@turnkey/gas-station` SDK to align with the audited smart contract changes. The audit resulted in several interface updates: | ||
|
|
||
| **Contract Changes:** | ||
| - **New contract addresses**: Updated both delegate and execution contract addresses to the newly deployed versions | ||
| - **EIP-712 field name changes**: The canonical delegate contract interface uses simplified field names (`to`, `value`, `data`) instead of the previous descriptive names (`outputContract`, `ethAmount`, `arguments`) | ||
|
|
||
| **SDK Updates:** | ||
| - Updated `DEFAULT_EXECUTION_CONTRACT` address from `0x4ece92b06C7d2d99d87f052E0Fca47Fb180c3348` to `0x00000000008c57a1CE37836a5e9d36759D070d8c` | ||
| - Updated `DEFAULT_DELEGATE_CONTRACT` address from `0xC2a37Ee08cAc3778d9d05FF0a93FD5B553C77E3a` to `0x000066a00056CD44008768E2aF00696e19A30084` | ||
| - Updated EIP-712 Execution typehash field names to match the contract's canonical interface | ||
| - Updated EIP-712 ApproveThenExecute typehash field names to match the contract's canonical interface | ||
| - Updated Turnkey policy conditions in `buildIntentSigningPolicy` to reference the new field names (`to`, `value` instead of `outputContract`, `ethAmount`) | ||
| - Updated documentation and examples to reflect the new field names | ||
|
|
||
| **Files Modified:** | ||
| - `packages/gas-station/src/config.ts` - Updated contract addresses | ||
| - `packages/gas-station/src/intentBuilder.ts` - Updated EIP-712 type definitions and message objects | ||
| - `packages/gas-station/src/policyUtils.ts` - Updated policy condition field references and documentation |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -8,9 +8,15 @@ export const gasStationAbi = [ | |
| }, | ||
| { inputs: [], name: "ExecutionFailed", type: "error" }, | ||
| { inputs: [], name: "InvalidFunctionSelector", type: "error" }, | ||
| { inputs: [], name: "NoEthAllowed", type: "error" }, | ||
| { inputs: [], name: "NotDelegated", type: "error" }, | ||
| { stateMutability: "nonpayable", type: "fallback" }, | ||
| { | ||
| inputs: [], | ||
| name: "TK_GAS_DELEGATE", | ||
| outputs: [{ internalType: "address", name: "", type: "address" }], | ||
| stateMutability: "view", | ||
| type: "function", | ||
| }, | ||
| { | ||
| inputs: [ | ||
| { internalType: "address", name: "_target", type: "address" }, | ||
|
|
@@ -152,26 +158,6 @@ export const gasStationAbi = [ | |
| stateMutability: "view", | ||
| type: "function", | ||
| }, | ||
| { | ||
| inputs: [ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we make explicit note of this somewhere? or no need given this wasn't really being used in the first place? |
||
| { internalType: "address", name: "_targetEoA", type: "address" }, | ||
| { internalType: "uint128", name: "_nonce", type: "uint128" }, | ||
| { | ||
| components: [ | ||
| { internalType: "address", name: "to", type: "address" }, | ||
| { internalType: "uint256", name: "value", type: "uint256" }, | ||
| { internalType: "bytes", name: "data", type: "bytes" }, | ||
| ], | ||
| internalType: "struct IBatchExecution.Call[]", | ||
| name: "_calls", | ||
| type: "tuple[]", | ||
| }, | ||
| ], | ||
| name: "hashBatchExecution", | ||
| outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], | ||
| stateMutability: "view", | ||
| type: "function", | ||
| }, | ||
| { | ||
| inputs: [ | ||
| { internalType: "address", name: "_targetEoA", type: "address" }, | ||
|
|
@@ -207,7 +193,6 @@ export const gasStationAbi = [ | |
| inputs: [ | ||
| { internalType: "address", name: "_targetEoA", type: "address" }, | ||
| { internalType: "uint128", name: "_counter", type: "uint128" }, | ||
| { internalType: "address", name: "_sender", type: "address" }, | ||
| ], | ||
| name: "hashBurnSessionCounter", | ||
| outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], | ||
|
|
@@ -248,13 +233,6 @@ export const gasStationAbi = [ | |
| stateMutability: "view", | ||
| type: "function", | ||
| }, | ||
| { | ||
| inputs: [], | ||
| name: "tkGasDelegate", | ||
| outputs: [{ internalType: "address", name: "", type: "address" }], | ||
| stateMutability: "view", | ||
| type: "function", | ||
| }, | ||
| { | ||
| inputs: [ | ||
| { internalType: "address", name: "_targetEoA", type: "address" }, | ||
|
|
@@ -266,5 +244,4 @@ export const gasStationAbi = [ | |
| stateMutability: "view", | ||
| type: "function", | ||
| }, | ||
| { stateMutability: "payable", type: "receive" }, | ||
| ] as const; | ||
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹