File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Sources/web3swift/Tokens/ERC20 Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ public class ERC20: IERC20, ERC20BaseProperties {
108
108
}
109
109
110
110
public func setAllowance( from: EthereumAddress , to: EthereumAddress , newAmount: String ) async throws -> WriteOperation {
111
- let contract = self . contract
112
111
self . transaction. from = from
113
112
self . transaction. to = self . address
114
113
self . transaction. callOnBlock = . latest
@@ -126,7 +125,7 @@ public class ERC20: IERC20, ERC20BaseProperties {
126
125
guard let value = Utilities . parseToBigUInt ( newAmount, decimals: intDecimals) else {
127
126
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
128
127
}
129
-
128
+ contract . transaction = transaction
130
129
let tx = contract. createWriteOperation ( " setAllowance " , parameters: [ to, value] as [ AnyObject ] ) !
131
130
return tx
132
131
}
@@ -155,7 +154,6 @@ public class ERC20: IERC20, ERC20BaseProperties {
155
154
}
156
155
157
156
public func totalSupply( ) async throws -> BigUInt {
158
- let contract = self . contract
159
157
self . transaction. callOnBlock = . latest
160
158
let result = try await contract
161
159
. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !
You can’t perform that action at this time.
0 commit comments