Skip to content

Commit ff7ba8f

Browse files
Merge pull request #530 from mloit/feature/document-1559
2 parents f2f613a + f89cea8 commit ff7ba8f

File tree

3 files changed

+49
-8
lines changed

3 files changed

+49
-8
lines changed

Documentation/README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,35 +74,41 @@ Here are quick references for essential features:
7474

7575
- [x] [EIP-155](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-155.md) (Replay attacks protection) *enforced!*
7676

77+
- [x] [EIP-165](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-165.md) (Standard Interface Detection, also known as ERC-165)
78+
7779
- [x] [EIP-681](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-681.md) (A standard way of representing various transactions, especially payment requests in Ethers and ERC-20 tokens as URLs)
7880

7981
- [x] [EIP-721](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-721.md) (A standard interface for non-fungible tokens, also known as deeds - ERC-721)
8082

81-
- [x] [EIP-165](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-165.md) (Standard Interface Detection, also known as ERC-165)
83+
- [x] [EIP-721x](https://github.com/loomnetwork/erc721x) (An extension of ERC721 that adds support for multi-fungible tokens and batch transfers, while being fully backward-compatible, also known as ERC-721x)
8284

8385
- [x] [EIP-777](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-777.md) (New Advanced Token Standard, also known as ERC-777)
8486

8587
- [x] [EIP-820](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-820.md) (Pseudo-introspection Registry Contract, also known as ERC-820)
8688

8789
- [x] [EIP-888](https://github.com/ethereum/EIPs/issues/888) (MultiDimensional Token Standard, also known as ERC-888)
8890

91+
- [x] [EIP-1155](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-1155.md) (Multi Token Standard, also known as ERC-1155)
92+
93+
- [x] [EIP-1376](https://github.com/ethereum/EIPs/issues/1376) (Service-Friendly Token, also known as ERC-1376)
94+
8995
- [x] [EIP-1400](https://github.com/ethereum/EIPs/issues/1411) (Security Token Standard, also known as ERC-1400)
9096

9197
- [x] [EIP-1410](https://github.com/ethereum/EIPs/issues/1410) (Partially Fungible Token Standard, also known as ERC-1410)
9298

99+
- [x] [EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) (Fee market change for ETH 1.0 chain)
100+
93101
- [x] [EIP-1594](https://github.com/ethereum/EIPs/issues/1594) (Core Security Token Standard, also known as ERC-1594)
94102

103+
- [x] [EIP-1633](https://github.com/ethereum/EIPs/issues/1634) (Re-Fungible Token, also known as ERC-1633)
104+
95105
- [x] [EIP-1643](https://github.com/ethereum/EIPs/issues/1643) (Document Management Standard, also known as ERC-1643)
96106

97107
- [x] [EIP-1644](https://github.com/ethereum/EIPs/issues/1644) (Controller Token Operation Standard, also known as ERC-1644)
98108

99-
- [x] [EIP-1633](https://github.com/ethereum/EIPs/issues/1634) (Re-Fungible Token, also known as ERC-1633)
100-
101-
- [x] [EIP-721x](https://github.com/loomnetwork/erc721x) (An extension of ERC721 that adds support for multi-fungible tokens and batch transfers, while being fully backward-compatible, also known as ERC-721x)
102-
103-
- [x] [EIP-1155](https://github.com/ethereum/EIPs/blob/develop/EIPS/eip-1155.md) (Multi Token Standard, also known as ERC-1155)
109+
- [x] [EIP-2718](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2718.md) (Typed Transaction Envelope)
104110

105-
- [x] [EIP-1376](https://github.com/ethereum/EIPs/issues/1376) (Service-Friendly Token, also known as ERC-1376)
111+
- [x] [EIP-2930](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2930.md) (Optional access lists)
106112

107113
- [x] [ST-20](https://github.com/PolymathNetwork/polymath-core) - ST-20 token is an Ethereum-based token implemented on top of the ERC-20 protocol that adds the ability for tokens to control transfers based on specific rules
108114

Documentation/Usage.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- [Send ERC-20 Token](#send-erc-20-token)
3333
- [Write Transaction and call smart contract method](#write-transaction-and-call-smart-contract-method)
3434
- [Read Transaction to call smart contract method](#read-transaction-to-call-smart-contract-method)
35+
- [Other Transaction Types (EIP-1559)](#other-transaction-types)
3536
- [Send Transaction](#send-transaction)
3637
- [Write](#write)
3738
- [Read](#read)
@@ -355,6 +356,40 @@ let result = try! transaction.send(password: password)
355356
let result = try! transaction.call()
356357
```
357358

359+
##### Other Transaction Types
360+
361+
By default a `legacy` transaction will be created which is compatible across all chains, regardless of which fork.
362+
To create one of the new transaction types introduced with the `london` fork you will need to set some additonal parameters
363+
in the `TransactionOptions` object. Note you should only try to send one of tehse new types of transactions if you are on a chain
364+
that supports them.
365+
366+
To send an EIP-2930 style transacton with an access list you need to set the transaction type, and the access list,
367+
in addition what is shown in the examples above.
368+
```swift
369+
let accessList: [AccessListEntry] = [
370+
AccessListEntry(
371+
address: EthereumAddress("0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae"),
372+
storageKeys: [BigUInt(3), BigUInt(7)]
373+
),
374+
AccessListEntry(
375+
address: EthereumAddress("0xbb9bc244d798123fde783fcc1c72d3bb8c189413"),
376+
storageKeys: []
377+
)
378+
]
379+
380+
options.type = .eip2930
381+
options.accessList = accessList
382+
```
383+
384+
To send an EIP-1559 style transaction you set the transaction type, and the new gas parameters `maxFeePerGas` and `maxPriorityFeePerGas`
385+
(you may also send an AccessList with an EIP-1559 transaction) When sending an EIP-1559 transaction, the older `gasPrice` parameter is ignored.
386+
```swift
387+
options.type = .eip1559
388+
options.maxFeePerGas = .manual(...) // the maximum price per unit of gas, inclusive of baseFee and tip
389+
options.maxPriorityFeePerGas = .manual(...) // the tip to be paid to the miner, per unit of gas
390+
```
391+
Note there is a new `Oracle` object available that can be used to assist with estimating the new gas fees
392+
358393
### Chain state
359394

360395
#### Get Block number

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
- [x]**Literally following the standards** (BIP, EIP, etc):
5858

5959
- [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)**
60-
- [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)
60+
- [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)
6161
- [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
6262

6363
- [x] 🗜 **Batched requests** in concurrent mode

0 commit comments

Comments
 (0)