Skip to content

Commit

Permalink
refactor: update contract abis
Browse files Browse the repository at this point in the history
  • Loading branch information
petarTxFusion committed Jun 8, 2024
1 parent 21cb01f commit 4b5bdc2
Show file tree
Hide file tree
Showing 11 changed files with 4,478 additions and 162 deletions.
1 change: 0 additions & 1 deletion Sources/ZkSync2/Utils/Wrappers/ERC20.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,5 @@ public extension Web3.Utils {
"type": "function"
}
]
"""
}
2 changes: 1 addition & 1 deletion Sources/ZkSync2/Utils/Wrappers/IBridgehub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public extension Web3.Utils {
"type": "uint256"
}
],
"name": "getStateTransition",
"name": "getHyperchain",
"outputs": [
{
"internalType": "address",
Expand Down
326 changes: 326 additions & 0 deletions Sources/ZkSync2/Utils/Wrappers/IContractDepoloyer.swift
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"
}
]
"""

}
45 changes: 45 additions & 0 deletions Sources/ZkSync2/Utils/Wrappers/IERC1271.swift
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"
}
]
"""
}
1 change: 0 additions & 1 deletion Sources/ZkSync2/Utils/Wrappers/IEthToken.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,5 @@ extension Web3.Utils {
"type": "function"
}
]
"""
}
Loading

0 comments on commit 4b5bdc2

Please sign in to comment.