Skip to content

Commit b8de0b6

Browse files
Merge pull request #595 from skywinder/develop
develop to master merge
2 parents e269630 + a0c7265 commit b8de0b6

File tree

11 files changed

+152
-63
lines changed

11 files changed

+152
-63
lines changed

CHANGELOG.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,70 @@
11
# Changelog
22

3-
## [Unreleased](https://github.com/skywinder/web3swift/tree/HEAD)
3+
## [2.6.5](https://github.com/skywinder/web3swift/tree/2.6.5) (2022-05-26)
44

5-
[Full Changelog](https://github.com/skywinder/web3swift/compare/2.5.0...HEAD)
5+
- correct the decoding key for from in transactionOptions by @mloit in #570
66

7-
**Merged pull requests:**
7+
## [2.6.4](https://github.com/skywinder/web3swift/tree/2.6.4) (2022-05-06)
8+
9+
- Fix ERC-1155 ABI by @mloit in #557
10+
- Fix access level for EIP-712 related objects by @mloit in #555
11+
- Restore public API fromJSON() functions by @mloit in #558
12+
13+
## [2.6.3](https://github.com/skywinder/web3swift/tree/2.6.3) (2022-04-27)
14+
15+
- Feature/automatic gas 1559 by @mloit in #547
16+
- Oracle.suggestGasFeeLegacy method fixup by @yaroslavyaroslav in #551
17+
18+
## [2.6.2](https://github.com/skywinder/web3swift/tree/2.6.2) (2022-04-25)
19+
20+
- Fix #540 by freezing CryptoSwift dependency to last working version (1.4.3) by @yaroslavyaroslav
21+
22+
## [2.6.1](https://github.com/skywinder/web3swift/tree/2.6.1) (2022-04-19)
23+
24+
- Update documentation for EIP-1559 support by @mloit in #530
25+
- Feature/transaction metadata by @mloit in #523
26+
27+
## [2.6.0](https://github.com/skywinder/web3swift/tree/2.6.0) (2022-04-15)
28+
29+
### Features
30+
31+
- Add full EIP-1559 transaction support see
32+
- Add gas prediction support see
33+
34+
### What's Changed
35+
36+
- Remove BrowserViewController if building for anything other than iOS by @mloit in #503
37+
- Feature/pre swiftlint cleanup by @mloit in #495
38+
- Feature/late lint fixups by @mloit in #508
39+
- Fix Base58 Decoding by @mloit in #504
40+
- Swiftlint by @mloit in #499
41+
- ERC1155: Change access control for Interfece-based methods. by @mrklos in #494
42+
- feat: solidity sha3 implementation added by @JeneaVranceanu in #506
43+
- add indentation check [default is 4 spaces per tab-stop] by @mloit in #512
44+
- EIP-1559 support release by @yaroslavyaroslav in #510
45+
- EIP-1559 Gas prediction implementation by @yaroslavyaroslav in #513
46+
- feat: decoding ABI with solidity error types by @JeneaVranceanu in #455
47+
- Gas prediction implementation by @yaroslavyaroslav in #514
48+
- Bug fix/transaction index by @mloit in #521
49+
- EIP-1559 transaction support by @mloit in #509
50+
- Full Changelog: 2.5.1...2.6.0
51+
52+
## [2.5.1](https://github.com/skywinder/web3swift/tree/2.5.1) (2022-03-23)
853

9-
- Syncing with master [\#428](https://github.com/skywinder/web3swift/pull/428) ([yaroslavyaroslav](https://github.com/yaroslavyaroslav))
54+
- Drop Carthage cache files by yaroslavyaroslav
55+
- Drop examples cocoapods cache files by yaroslavyaroslav
56+
- Improve ci/cd pipeline by adding localTests job by yaroslavyaroslav
57+
- Rename tests in swift style name convention (CamelCase) by yaroslavyaroslav
58+
- Enable run ganache util in ci/cd pipeline (required for local tests) by yaroslavyaroslav
59+
- Clear lib warnings on build #437 by Valter4578 & mliot
60+
- Change UINT64_MAX to UInt64.max by mloit
61+
- Update CHANGELOG.md by ZeroCode999
62+
- Fix tokenURI method name for ERC721 and ERC721x tokens #419 by Sarquella
63+
- Provide basic tolerance to EIP-1559 data by mloit
64+
- Fix for buffer overflow in [Data|SECP256K1].randomBytes() #470 by mloit
65+
- Arbitrary clean project code by mloit
66+
- Fix github actions config issue that occasionally cancels running jobs by yaroslavyaroslav
67+
- mini-rollup of several issues by mloit
1068

1169
## [2.5.0](https://github.com/skywinder/web3swift/tree/2.5.0) (2021-12-23)
1270

Cartfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github "attaswift/BigInt" == 5.3.0
2-
github "attaswift/SipHash" == 1.2.2
3-
github "daltoniam/Starscream" == 4.0.4
4-
github "krzyzanowskim/CryptoSwift" == 1.5.1
5-
github "mxcl/PromiseKit" == 6.16.2
1+
github "attaswift/BigInt" ~> 5.3.0
2+
github "attaswift/SipHash" ~> 1.2.2
3+
github "daltoniam/Starscream" ~> 4.0.4
4+
github "krzyzanowskim/CryptoSwift" ~> 1.5.1
5+
github "mxcl/PromiseKit" ~> 6.16.2

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ let package = Package(
2121
],
2222

2323
dependencies: [
24-
.package(url: "https://github.com/attaswift/BigInt.git", .upToNextMinor(from: "5.3.0")),
25-
.package(url: "https://github.com/mxcl/PromiseKit.git", .upToNextMinor(from: "6.16.2")),
26-
.package(url: "https://github.com/daltoniam/Starscream.git", .upToNextMinor(from: "4.0.4")),
27-
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMinor(from: "1.5.1"))
24+
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.3.0"),
25+
.package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.16.2"),
26+
.package(url: "https://github.com/daltoniam/Starscream.git", from: "4.0.4"),
27+
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.5.1")
2828
],
2929
targets: [
3030
.target(name: "secp256k1"),

README.md

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ let tx = contract.write(
217217

218218
#### Write Transaction with your custom contract ABI
219219
#### Requirement : Your custom contract ABI string
220-
```Code
220+
```swift
221221
func contractTransactionMethod(){
222222
let yourCoin = self.yourbalance.text ?? "0.0" //Get token for sending
223223
let userDir = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] //get user directory for keystore
@@ -299,19 +299,19 @@ open ./web3swiftBrowser.xcworkspace
299299
### Default web3swift build
300300

301301
1. Install carthage:
302-
```
302+
```bash
303303
brew install carthage
304304
```
305305
2. Run carthage update:
306-
```
306+
```bash
307307
# Available platforms: `iOS, macOS`
308308
carthage update --platform iOS --use-xcframeworks
309309
```
310310
3. Build project in XCode:
311311
`Command + B`
312312

313313
### Build web3swift into .framework:
314-
```
314+
```bash
315315
carthage build --no-skip-current --platform iOS
316316
```
317317

@@ -346,49 +346,24 @@ Here are quick references for essential features:
346346
- [ENS](https://github.com/skywinder/web3swift/blob/master/Documentation/Usage.md#ens)
347347

348348
## Projects that are using web3swift
349-
350-
If you are using this library in your project, please [add a link](https://github.com/skywinder/web3swift/edit/develop/README.md) to this repo.
351-
352-
* [MyEtherWallet/MEWconnect-iOS](https://github.com/MyEtherWallet/MEWconnect-iOS)
353-
* [Peepeth iOS client](https://github.com/matterinc/PeepethClient)
354-
* [Ethereum & ERC20Tokens Wallet](https://itunes.apple.com/us/app/ethereum-erc20tokens-wallet/id1386738877?ls=1&mt=8)
355-
* [Pay-iOS](https://github.com/BANKEX/Pay-iOS)
356-
* [GeoChain](https://github.com/awallish/GeoChain)
357-
* [NewHorizonLabs/TRX-Wallet](https://github.com/NewHorizonLabs/TRX-Wallet)
358-
* [SteadyAction/EtherWalletKit](https://github.com/SteadyAction/EtherWalletKit)
359-
* [UP Wallet/loopr-ios](https://github.com/Loopring/loopr-ios)
360-
* [MyENS Wallet](https://github.com/barrasso/enswallet)
361-
* [LoanStar](https://github.com/barrasso/loan-star)
362-
* [AlphaWallet](https://github.com/AlphaWallet/alpha-wallet-ios)
363-
* [Follow_iOS](https://github.com/FollowInc/Follow_iOS)
364-
* [Biomedical Data Sharing dApp - Geolocation](https://github.com/HD2i/Geolocation-iOS)
365-
* [Alice Wallet](https://github.com/alicedapp/AliceX)
366-
* [web3-react-native](https://github.com/cawfree/web3-react-native)
367-
* [ProLabArt](https://prolabart.com)
368-
<!-- Add your project below -->
369-
<!-- * [Project Name](link to projext) -->
370-
* [YOUR APP CAN BE THERE (click me)](https://github.com/skywinder/web3swift/edit/develop/README.md) :wink:
371-
372-
*Nothing makes developers happier than seeing someone else use our work and go wild with it.*
349+
Please take a look at [Our costumers](https://github.com/skywinder/web3swift/wiki/Our-Customers) wiki page.
373350

374351
## Support
375352

376-
**[Join our discord](https://discord.gg/8bHCNmhS7x) if you need a support or want to contribute to web3swift development!**
353+
**[Join our discord](https://discord.gg/8bHCNmhS7x) and [Telegram](https://t.me/web3swift) if you need a support or want to contribute to web3swift development!**
377354

378-
- If you **need help**, [open an issue](https://github.com/skywinder/web3swift/issues).
379-
- If you'd like to **see web3swift best practices**, check [Projects that using web3swift](https://github.com/skywinder/web3swift#projects-that-using-web3swift).
355+
- If you **need help**, please take a look at our [FAQ](https://github.com/skywinder/web3swift/wiki/FAQ "") or [open an issue](https://github.com/skywinder/web3swift/issues).
356+
- If you'd like to **see web3swift best practices**, check [Projects that using web3swift](https://github.com/skywinder/web3swift/wiki/Our-Customers).
380357
- If you **found a bug**, [open an issue](https://github.com/skywinder/web3swift/issues).
381358

382359

383360
## Contribute
384-
385361
Want to improve? It's awesome:
386362

387363
Then good news for you: **We are ready to pay for your contribution via [@gitcoin bot](https://gitcoin.co/grants/358/web3swift)!**
388364

389365
- If you **have a feature request**, [open an issue](https://github.com/skywinder/web3swift/issues).
390-
391-
If you **want to contribute**, [submit a pull request](https://github.com/skywinder/web3swift/pulls).
366+
- If you **want to contribute**, [submit a pull request](https://github.com/skywinder/web3swift/pulls).
392367

393368
#### Contribution
394369
0. You are more than welcome to participate and get bounty by contributing! **Your contribution will be paid via [@gitcoin Grant program](https://gitcoin.co/grants/358/web3swift).**
@@ -415,6 +390,7 @@ We want to continue to do everything we can to move the needle forward.
415390
- Alex Vlasov, [@shamatar](https://github.com/shamatar) - for the initial implementation
416391
- Petr Korolev, [@skywinder](https://github.com/skywinder) - botstrap and continous support
417392
- Anton Grigorev, [@baldyash](https://github.com/BaldyAsh) - core contributor, who use it and making a lot of ipmprovments
393+
- Yaroslav Yashin [@yaroslavyaroslav](https://github.com/yaroslavyaroslav) - core contributor of 3.0.0 and later releases.
418394
- Thanks to [web3swift's growing list of contributors](https://github.com/skywinder/web3swift/graphs/contributors).
419395

420396
## Security Disclosure

Sources/web3swift/Contract/ContractProtocol.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ public struct EventFilter {
5858
}
5959
}
6060

61-
public init() { }
62-
63-
public init(fromBlock: Block?, toBlock: Block?,
61+
public init(fromBlock: Block? = nil,
62+
toBlock: Block? = nil,
6463
addresses: [EthereumAddress]? = nil,
6564
parameterFilters: [[EventFilterable]?]? = nil) {
6665
self.fromBlock = fromBlock

Sources/web3swift/KeystoreManager/IBAN.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ public struct ICAP {
1111
public var asset: String
1212
public var institution: String
1313
public var client: String
14+
15+
public init(asset: String, institution: String, client: String) {
16+
self.asset = asset
17+
self.institution = institution
18+
self.client = client
19+
}
1420
}
1521

1622
public struct IBAN {

Sources/web3swift/Tokens/ERC1376/Web3+ERC1376.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ public enum IERC1376DelegateMode: UInt {
1818
}
1919

2020
public struct DirectDebitInfo {
21-
let amount: BigUInt
22-
let startTime: BigUInt
23-
let interval: BigUInt
21+
public let amount: BigUInt
22+
public let startTime: BigUInt
23+
public let interval: BigUInt
2424
}
2525

2626
public struct DirectDebit {
27-
let info: DirectDebitInfo
28-
let epoch: BigUInt
27+
public let info: DirectDebitInfo
28+
public let epoch: BigUInt
2929
}
3030

3131
extension DirectDebit: Hashable {

Sources/web3swift/Transaction/EthereumParameters.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,30 @@ public struct EthereumParameters {
4949

5050
/// access list for contract execution (EIP-2930 and EIP-1559 only)
5151
public var accessList: [AccessListEntry]?
52+
53+
public init(type: TransactionType? = nil,
54+
to: EthereumAddress? = nil,
55+
nonce: BigUInt? = nil,
56+
chainID: BigUInt? = nil,
57+
value: BigUInt? = nil,
58+
data: Data? = nil,
59+
gasLimit: BigUInt? = nil,
60+
gasPrice: BigUInt? = nil,
61+
maxFeePerGas: BigUInt? = nil,
62+
maxPriorityFeePerGas: BigUInt? = nil,
63+
accessList: [AccessListEntry]? = nil) {
64+
self.type = type
65+
self.to = to
66+
self.nonce = nonce
67+
self.chainID = chainID
68+
self.value = value
69+
self.data = data
70+
self.gasLimit = gasLimit
71+
self.gasPrice = gasPrice
72+
self.maxFeePerGas = maxFeePerGas
73+
self.maxPriorityFeePerGas = maxPriorityFeePerGas
74+
self.accessList = accessList
75+
}
5276
}
5377

5478
public extension EthereumParameters {

Sources/web3swift/Web3/Web3+Options.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,32 @@ public struct TransactionOptions {
8888

8989
public var accessList: [AccessListEntry]?
9090

91+
public init(type: TransactionType? = nil,
92+
to: EthereumAddress? = nil,
93+
from: EthereumAddress? = nil,
94+
chainID: BigUInt? = nil,
95+
gasLimit: TransactionOptions.GasLimitPolicy? = nil,
96+
gasPrice: TransactionOptions.GasPricePolicy? = nil,
97+
maxFeePerGas: TransactionOptions.FeePerGasPolicy? = nil,
98+
maxPriorityFeePerGas: TransactionOptions.FeePerGasPolicy? = nil,
99+
value: BigUInt? = nil,
100+
nonce: TransactionOptions.NoncePolicy? = nil,
101+
callOnBlock: TransactionOptions.CallingBlockPolicy? = nil,
102+
accessList: [AccessListEntry]? = nil) {
103+
self.type = type
104+
self.to = to
105+
self.from = from
106+
self.chainID = chainID
107+
self.gasLimit = gasLimit
108+
self.gasPrice = gasPrice
109+
self.maxFeePerGas = maxFeePerGas
110+
self.maxPriorityFeePerGas = maxPriorityFeePerGas
111+
self.value = value
112+
self.nonce = nonce
113+
self.callOnBlock = callOnBlock
114+
self.accessList = accessList
115+
}
116+
91117
public static var defaultOptions: TransactionOptions {
92118
var opts = TransactionOptions()
93119
opts.type = .legacy

Tests/web3swiftTests/remoteTests/ENSTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ class ENSTests: XCTestCase {
2828
let domain = "somename.eth"
2929
let address = try ens?.registry.getResolver(forDomain: domain).resolverContractAddress
3030
print(address as Any)
31-
XCTAssertEqual(address?.address.lowercased(), "0x5ffc014343cd971b7eb70732021e26c35b744cc4")
31+
XCTAssertEqual(address?.address.lowercased(), "0x4976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41")
3232
}
3333

3434
func testResolver() throws {
3535
let web3 = Web3.InfuraMainnetWeb3(accessToken: Constants.infuraToken)
3636
let ens = ENS(web3: web3)
3737
let domain = "somename.eth"
3838
let address = try ens?.getAddress(forNode: domain)
39-
XCTAssertEqual(address?.address.lowercased(), "0x3487acfb1479ad1df6c0eb56ae743d34897798ac")
39+
XCTAssertEqual(address?.address.lowercased(), "0xc1ccfb5fc589b83b9e849c6f9b26efc71419898d")
4040
}
4141

4242
func testSupportsInterface() throws {
@@ -74,7 +74,7 @@ class ENSTests: XCTestCase {
7474
let ens = ENS(web3: web3)
7575
let domain = "somename.eth"
7676
let owner = try ens?.registry.getOwner(node: domain)
77-
XCTAssertEqual("0xc67247454e720328714c4e17bec7640572657bee", owner?.address.lowercased())
77+
XCTAssertEqual("0xc1ccfb5fc589b83b9e849c6f9b26efc71419898d", owner?.address.lowercased())
7878
}
7979

8080
func testTTL() throws {
@@ -91,7 +91,7 @@ class ENSTests: XCTestCase {
9191
let domain = "somename.eth"
9292
let resolver = try ens?.registry.getResolver(forDomain: domain)
9393
let address = try resolver?.getAddress(forNode: domain)
94-
XCTAssertEqual(address?.address.lowercased(), "0x3487acfb1479ad1df6c0eb56ae743d34897798ac")
94+
XCTAssertEqual(address?.address.lowercased(), "0xc1ccfb5fc589b83b9e849c6f9b26efc71419898d")
9595
}
9696

9797
func testGetPubkey() throws {

0 commit comments

Comments
 (0)