-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21cb01f
commit 4b5bdc2
Showing
11 changed files
with
4,478 additions
and
162 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 |
---|---|---|
|
@@ -270,6 +270,5 @@ public extension Web3.Utils { | |
"type": "function" | ||
} | ||
] | ||
""" | ||
} |
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
326 changes: 326 additions & 0 deletions
326
Sources/ZkSync2/Utils/Wrappers/IContractDepoloyer.swift
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,326 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Petar Kopestinskij on 8.6.24.. | ||
// | ||
|
||
import Foundation | ||
#if canImport(web3swift) | ||
import web3swift | ||
import Web3Core | ||
#else | ||
import web3swift_zksync2 | ||
#endif | ||
|
||
public extension Web3.Utils { | ||
static var IContractDepoloyer = """ | ||
[ | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "accountAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "enum IContractDeployer.AccountNonceOrdering", | ||
"name": "nonceOrdering", | ||
"type": "uint8" | ||
} | ||
], | ||
"name": "AccountNonceOrderingUpdated", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "accountAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "enum IContractDeployer.AccountAbstractionVersion", | ||
"name": "aaVersion", | ||
"type": "uint8" | ||
} | ||
], | ||
"name": "AccountVersionUpdated", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "deployerAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "bytes32", | ||
"name": "bytecodeHash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "contractAddress", | ||
"type": "address" | ||
} | ||
], | ||
"name": "ContractDeployed", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_salt", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_bytecodeHash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "_input", | ||
"type": "bytes" | ||
} | ||
], | ||
"name": "create", | ||
"outputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "newAddress", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_salt", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_bytecodeHash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "_input", | ||
"type": "bytes" | ||
} | ||
], | ||
"name": "create2", | ||
"outputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "newAddress", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_salt", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_bytecodeHash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "_input", | ||
"type": "bytes" | ||
}, | ||
{ | ||
"internalType": "enum IContractDeployer.AccountAbstractionVersion", | ||
"name": "_aaVersion", | ||
"type": "uint8" | ||
} | ||
], | ||
"name": "create2Account", | ||
"outputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "newAddress", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_salt", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_bytecodeHash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "_input", | ||
"type": "bytes" | ||
}, | ||
{ | ||
"internalType": "enum IContractDeployer.AccountAbstractionVersion", | ||
"name": "_aaVersion", | ||
"type": "uint8" | ||
} | ||
], | ||
"name": "createAccount", | ||
"outputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "newAddress", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "_address", | ||
"type": "address" | ||
} | ||
], | ||
"name": "getAccountInfo", | ||
"outputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"internalType": "enum IContractDeployer.AccountAbstractionVersion", | ||
"name": "supportedAAVersion", | ||
"type": "uint8" | ||
}, | ||
{ | ||
"internalType": "enum IContractDeployer.AccountNonceOrdering", | ||
"name": "nonceOrdering", | ||
"type": "uint8" | ||
} | ||
], | ||
"internalType": "struct IContractDeployer.AccountInfo", | ||
"name": "info", | ||
"type": "tuple" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "_sender", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "_senderNonce", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "getNewAddressCreate", | ||
"outputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "newAddress", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "pure", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "_sender", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_bytecodeHash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_salt", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "_input", | ||
"type": "bytes" | ||
} | ||
], | ||
"name": "getNewAddressCreate2", | ||
"outputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "newAddress", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "enum IContractDeployer.AccountAbstractionVersion", | ||
"name": "_version", | ||
"type": "uint8" | ||
} | ||
], | ||
"name": "updateAccountVersion", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "enum IContractDeployer.AccountNonceOrdering", | ||
"name": "_nonceOrdering", | ||
"type": "uint8" | ||
} | ||
], | ||
"name": "updateNonceOrdering", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
] | ||
""" | ||
|
||
} |
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,45 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Petar Kopestinskij on 8.6.24.. | ||
// | ||
|
||
import Foundation | ||
#if canImport(web3swift) | ||
import web3swift | ||
import Web3Core | ||
#else | ||
import web3swift_zksync2 | ||
#endif | ||
|
||
public extension Web3.Utils { | ||
static var IERC1271 = """ | ||
[ | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "hash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "signature", | ||
"type": "bytes" | ||
} | ||
], | ||
"name": "isValidSignature", | ||
"outputs": [ | ||
{ | ||
"internalType": "bytes4", | ||
"name": "magicValue", | ||
"type": "bytes4" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] | ||
""" | ||
} |
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 |
---|---|---|
|
@@ -261,6 +261,5 @@ extension Web3.Utils { | |
"type": "function" | ||
} | ||
] | ||
""" | ||
} |
Oops, something went wrong.