Skip to content

Commit

Permalink
Merge branch develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavyaroslav committed Jan 21, 2023
2 parents 7219725 + 50d0d83 commit edfe624
Show file tree
Hide file tree
Showing 194 changed files with 3,547 additions and 2,676 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,19 @@ body:
placeholder: Sources/Core/Transaction/CodableTransaction.swift:129 func recoverPublicKey()
validations:
required: true
- type: textarea
id: os-version
attributes:
label: OS version
description: Please specify what platform and os version you are using?
placeholder: macOS 13.0.1 (22A400)
validations:
required: true
- type: textarea
id: lib-version
attributes:
label: Library version
description: Please specify what library version you are using?
placeholder: 3.0.6 or "ef06fbfc735ab687ebf89c937a9d1ffe6d81d37f" commit.
validations:
required: true
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/documentation-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ body:
- type: textarea
id: area
attributes:
label: What area of the framework would you like to have improved the documentation for?
description: Please be very specific and link to the relevant page in the documentation if possible.
placeholder: I would like the documentation for...
label: What piece of the framework are having the lack of docs?
description: Bring the link, either type, either method name that is having the lack of docs
placeholder: "`Sources/Core/EthereumABI.swift:ABIElementPropertiesProtocol` or `ABIElementPropertiesProtocol`"
validations:
required: true
- type: textarea
id: reason
attributes:
label: Why is the current documentation for this area not sufficient?
label: What bit of docs would you like to have?
description: A clear and concise description of why this documentation needs to be improved.
placeholder: The documentation needs to be improved because...
placeholder: There's a lack of docs that covers both the intent of this type and the way how it should be used within client code.
validations:
required: true
21 changes: 7 additions & 14 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature Request
description: Suggest an idea for this project
labels: ['feature']
labels: ['enhancement']
body:
- type: markdown
attributes:
Expand All @@ -9,29 +9,22 @@ body:
- type: textarea
id: problem
attributes:
label: Is your feature request related to a problem?
description: A clear and concise description of what the problem is.
placeholder: Yes, the problem is that...
label: What context is your feature request related to?
description: Short context name, please do not overcomplicate neither over fractionize it.
placeholder: Transaction pipeline enhancement, supported platform list extending, etc.
validations:
required: true
- type: textarea
id: solution
attributes:
label: What solution would you like?
description: A clear and concise description of what you want to happen.
placeholder: I would like that...
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: What alternatives have you considered?
description: A clear and concise description of any alternative solutions or features you've considered.
placeholder: I have considered to...
placeholder: I would like that your lib has a magic "give me money" button, that provides me to just to build it, be uploaded to the AppStore and to get rich.
validations:
required: true
- type: textarea
id: context
attributes:
label: Any additional context?
description: Add any other context or screenshots about the feature request here.
description: If there's some specs either standard for such feature invented already here's the good place to provide those.
placeholder: Here's the pictures of house that i'd wanted to be able to bough after i've got rich and the my future cars list as well.
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## **Summary of Changes**

Fixes # _(if applicable - add the number of issue this PR addresses)_

## **Test Data or Screenshots**

###### _By submitting this pull request, you are confirming the following:_

- I have reviewed the [Contribution Guidelines](https://github.com/web3swift-team/web3swift/blob/develop/CONTRIBUTION.md).
- I have performed a self-review of my own code.
- I have updated my repository to match the `develop` branch.
- I have included test data or screenshots that prove my fix is effective or that my feature works.
- I have checked that all tests work and swiftlint is not throwing any errors/warnings.
11 changes: 10 additions & 1 deletion Example/myWeb3Wallet/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '15.0'

target 'myWeb3Wallet' do
# Comment the next line if you don't want to use dynamic frameworks
Expand All @@ -19,3 +19,12 @@ pod 'web3swift', :git => 'https://github.com/veerChauhan/web3swift.git', :branch
end

end

# set iOS deployment target for every pod to avoid warnings
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
end
4 changes: 2 additions & 2 deletions Example/myWeb3Wallet/myWeb3Wallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = D6018FABA256C0117F85A829 /* Pods-myWeb3Wallet-myWeb3WalletUITests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = VPS9LBWQ55;
Expand All @@ -778,7 +778,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 7574A738941D92CC94F93A9E /* Pods-myWeb3Wallet-myWeb3WalletUITests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = VPS9LBWQ55;
Expand Down
13 changes: 2 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@

import PackageDescription

#if os(macOS)
let excludeFiles = [
"./Browser/BrowserViewController.swift" // Because of inheriting iOS only class failed to build on macOS.
]
#elseif os(iOS)
let excludeFiles: String = []
#endif

let package = Package(
name: "Web3swift",
platforms: [
Expand All @@ -26,13 +18,12 @@ let package = Package(
targets: [
.target(name: "secp256k1"),
.target(
name: "Core",
name: "Web3Core",
dependencies: ["BigInt", "secp256k1", "CryptoSwift"]
),
.target(
name: "web3swift",
dependencies: ["Core", "BigInt", "secp256k1"],
exclude: excludeFiles,
dependencies: ["Web3Core", "BigInt", "secp256k1"],
resources: [
.copy("./Browser/browser.js"),
.copy("./Browser/browser.min.js"),
Expand Down
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
## Social medias
[Join our discord](https://discord.gg/8bHCNmhS7x) or [Telegram](https://t.me/web3swift) if you need support or want to contribute to web3swift development!

![matter-github-swift](https://github.com/skywinder/web3swift/blob/develop/web3swift-logo.png)
[![Web3swift CI](https://github.com/skywinder/web3swift/actions/workflows/ci.yml/badge.svg)](https://github.com/skywinder/web3swift/actions/workflows/ci.yml)
![matter-github-swift](https://github.com/web3swift-team/web3swift/blob/develop/web3swift-logo.png)
[![Web3swift CI](https://github.com/web3swift-team/web3swift/actions/workflows/macOS-12.yml/badge.svg)](https://github.com/web3swift-team/web3swift/actions/workflows/macOS-12.yml)
[![Swift](https://img.shields.io/badge/Swift-5.4-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Platform](https://img.shields.io/cocoapods/p/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3.swift.pod)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/web3.swift.pod.svg?style=flat)](http://cocoapods.org/pods/web3.swift.pod)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3.swift.pod)
[![Platform](https://img.shields.io/cocoapods/p/web3swift?style=flat)](http://cocoapods.org/pods/web3swift)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/web3swift?style=flat)](http://cocoapods.org/pods/web3swift)
[![License](https://img.shields.io/cocoapods/l/web3swift.svg?style=flat)](https://github.com/web3swift-team/web3swift/blob/master/LICENSE.md)
[![support](https://brianmacdonald.github.io/Ethonate/svg/eth-support-blue.svg)](https://brianmacdonald.github.io/Ethonate/address#0xe22b8979739d724343bd002f9f432f5990879901)
[![Stackoverflow](https://img.shields.io/badge/stackoverflow-ask-blue.svg)](https://stackoverflow.com/questions/tagged/web3swift)

Expand Down Expand Up @@ -59,7 +58,7 @@
- [x]**Literally following the standards** (BIP, EIP, etc):
- [x] **[BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) (HD Wallets), [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) (Seed phrases), [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) (Key generation prefixes)**
- [x] **[EIP-20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md)** (Standart interface for tokens - ERC-20), **[EIP-67](https://github.com/ethereum/EIPs/issues/67)** (Standard URI scheme), **[EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md)** (Replay attacks protection), **[EIP-2718](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2718.md)** (Typed Transaction Envelope), **[EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md)** (Gas Fee market change)
- [x] **And many others** *(For details about this EIP's look at [Documentation page](https://github.com/skywinder/web3swift/blob/master/Documentation/))*: EIP-681, EIP-721, EIP-165, EIP-777, EIP-820, EIP-888, EIP-1400, EIP-1410, EIP-1594, EIP-1643, EIP-1644, EIP-1633, EIP-721, EIP-1155, EIP-1376, ST-20
- [x] **And many others** *(For details about this EIP's look at [Documentation page](https://github.com/web3swift-team/web3swift/blob/master/Documentation/))*: EIP-681, EIP-721, EIP-165, EIP-777, EIP-820, EIP-888, EIP-1400, EIP-1410, EIP-1594, EIP-1643, EIP-1644, EIP-1633, EIP-721, EIP-1155, EIP-1376, ST-20
- [x] **RLP encoding**
- [x] Base58 encoding scheme
- [x] Formatting to and from Ethereum Units
Expand Down Expand Up @@ -98,7 +97,7 @@ The [Swift Package Manager](https://swift.org/package-manager/ "") is a tool for
Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
```swift
dependencies: [
.package(url: "https://github.com/skywinder/web3swift.git", .upToNextMajor(from: "3.0.0"))
.package(url: "https://github.com/web3swift-team/web3swift.git", .upToNextMajor(from: "3.0.0"))
]
```

Expand All @@ -107,7 +106,7 @@ In the imports section:

```swift
import web3swift
import Core
import Web3Core
```

### Send Ether
Expand Down Expand Up @@ -151,7 +150,7 @@ func feeHistory(blockCount: UInt, block: BlockNumber, percentiles:[Double]) asyn
## Build from source
### SPM
```bash
git clone https://github.com/skywinder/web3swift.git
git clone https://github.com/web3swift-team/web3swift.git
cd web3swift
swift build
```
Expand All @@ -165,15 +164,15 @@ swift build
Documentation is under construction👷🏻👷🏼‍♀️. We’re trying our best to comment all public API as detailed as we can, but the end it still far to come. But in one of the nearest minor updates we’ll bring DocC support of already done amount of docs. And your PR in such are more than welcome.

## Projects that are using web3swift
Please take a look at [Our customers](https://github.com/skywinder/web3swift/wiki/Our-Customers) wiki page.
Please take a look at [Our customers](https://github.com/web3swift-team/web3swift/wiki/Our-Customers) wiki page.

## Support

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

- 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).
- If you'd like to **see web3swift best practices**, check [Projects that using web3swift](https://github.com/skywinder/web3swift/wiki/Our-Customers).
- If you **found a bug**, [open an issue](https://github.com/skywinder/web3swift/issues).
- If you **need help**, please take a look at our [FAQ](https://github.com/web3swift-team/web3swift/wiki/FAQ "") or [open an issue](https://github.com/web3swift-team/web3swift/issues).
- If you'd like to **see web3swift best practices**, check [Projects that using web3swift](https://github.com/web3swift-team/web3swift/wiki/Our-Customers).
- If you **found a bug**, [open an issue](https://github.com/web3swift-team/web3swift/issues).

## Development
To do local development and run the local tests, we recommend to use [ganache](https://github.com/trufflesuite/ganache) which is also used by CI when running github actions.
Expand All @@ -193,15 +192,15 @@ Make sure that `ganache` is running on its default port `8546`. To change the po
Want to improve? It's awesome:
Then good news for you: **We are ready to pay for your contribution via [@gitcoin bot](https://gitcoin.co/grants/358/web3swift)!**

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

### Contribution
1. 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).**
2. Find or create an [issue](https://github.com/skywinder/web3swift/issues)
2. Find or create an [issue](https://github.com/web3swift-team/web3swift/issues)
3. You can find open bounties in [Gitcoin Bounties](https://gitcoin.co/explorer?applicants=ALL&keywords=web3swift&order_by=-web3_created) list
4. Commita fix or a new feature in branch, push your changes
5. [Submit a pull request to **develop** branch](https://github.com/skywinder/web3swift/pulls)
5. [Submit a pull request to **develop** branch](https://github.com/web3swift-team/web3swift/pulls)
1. Please, provide detailed description to it to help us proceed it faster.

[@skywinder](https://github.com/skywinder) are charged with open-sourсe and do not require money for using web3swift library.
Expand All @@ -218,12 +217,12 @@ We want to continue to do everything we can to move the needle forward.
- Petr Korolev, [@skywinder](https://github.com/skywinder) - bootstrap and continuous support
- Anton Grigorev, [@baldyash](https://github.com/BaldyAsh) - core contributor, who use it and making a lot of improvements
- Yaroslav Yashin [@yaroslavyaroslav](https://github.com/yaroslavyaroslav) - core contributor of 3.0.0 and later releases.
- Thanks to [web3swift's growing list of contributors](https://github.com/skywinder/web3swift/graphs/contributors).
- Thanks to [web3swift's growing list of contributors](https://github.com/web3swift-team/web3swift/graphs/contributors).

## Security Disclosure

If you believe you have identified a security vulnerability with web3swift, you should report it as soon as possible via email to [[email protected]](mailto:[email protected]). Please do not post it to a public issue tracker.

## License

web3swift is available under the Apache License 2.0 license. See the [LICENSE](https://github.com/skywinder/web3swift/blob/master/LICENSE) for details.
web3swift is available under the Apache License 2.0 license. See the [LICENSE](https://github.com/web3swift-team/web3swift/blob/master/LICENSE.md) for details.
2 changes: 0 additions & 2 deletions Sources/Core/EthereumABI/ABIElements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ extension ABI.Element.Function {

let message = String(bytes: data.bytes[68..<(68+len)], encoding: .utf8)!

print("read function aborted by require statement: \(message)")

var returnArray = [String: Any]()

// set infomation
Expand Down
65 changes: 0 additions & 65 deletions Sources/Core/Transaction/Policies.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ public protocol ContractProtocol {
/// - Returns: `true` if event is possibly present, `false` if definitely not present and `nil` if event with given name
/// is not part of the ``EthereumContract/abi``.
func testBloomForEventPresence(eventName: String, bloom: EthereumBloomFilter) -> Bool?

/// Given the transaction data searches for a match in ``ContractProtocol/methods``.
/// - Parameter data: encoded function call used in transaction data field. Must be at least 4 bytes long.
/// - Returns: function decoded from the ABI of this contract or `nil` if nothing was found.
func getFunctionCalled(_ data: Data) -> ABI.Element.Function?
}

// MARK: - Overloaded ContractProtocol's functions
Expand Down Expand Up @@ -263,7 +268,7 @@ extension DefaultContractProtocol {
let method = Data.fromHex(method) == nil ? method : method.addHexPrefix().lowercased()

// MARK: - Encoding ABI Data flow
guard let abiMethod = methods[method]?.first,
guard let abiMethod = methods[method]?.first(where: { $0.inputs.count == parameters.count }),
var encodedData = abiMethod.encodeParameters(parameters) else { return nil }

// Extra data just appends in the end of parameters data
Expand Down Expand Up @@ -333,4 +338,9 @@ extension DefaultContractProtocol {
guard let function = methods[methodSignature]?.first else { return nil }
return function.decodeInputData(Data(data[4 ..< data.count]))
}

public func getFunctionCalled(_ data: Data) -> ABI.Element.Function? {
guard data.count >= 4 else { return nil }
return methods[data[0..<4].toHexString().addHexPrefix()]?.first
}
}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit edfe624

Please sign in to comment.