Skip to content

Commit aa4d563

Browse files
Fixing review issues.
1 parent 62f3e97 commit aa4d563

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public class ERC20: IERC20, ERC20BaseProperties {
108108
}
109109

110110
public func setAllowance(from: EthereumAddress, to: EthereumAddress, newAmount: String) async throws -> WriteOperation {
111-
let contract = self.contract
112111
self.transaction.from = from
113112
self.transaction.to = self.address
114113
self.transaction.callOnBlock = .latest
@@ -126,7 +125,7 @@ public class ERC20: IERC20, ERC20BaseProperties {
126125
guard let value = Utilities.parseToBigUInt(newAmount, decimals: intDecimals) else {
127126
throw Web3Error.inputError(desc: "Can not parse inputted amount")
128127
}
129-
128+
contract.transaction = transaction
130129
let tx = contract.createWriteOperation("setAllowance", parameters: [to, value] as [AnyObject] )!
131130
return tx
132131
}
@@ -155,7 +154,6 @@ public class ERC20: IERC20, ERC20BaseProperties {
155154
}
156155

157156
public func totalSupply() async throws -> BigUInt {
158-
let contract = self.contract
159157
self.transaction.callOnBlock = .latest
160158
let result = try await contract
161159
.createReadOperation("totalSupply", parameters: [AnyObject](), extraData: Data() )!

0 commit comments

Comments
 (0)