Skip to content

Commit e37b606

Browse files
small fix
1 parent b7f3c69 commit e37b606

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

web3swift/PrecompiledContracts/ERC777/Web3+ERC777.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ import BigInt
1111
import PromiseKit
1212
import EthereumAddress
1313

14+
protocol IERC777 {
15+
func getBalance(account: EthereumAddress) throws -> BigUInt
16+
func getAllowance(originalOwner: EthereumAddress, delegate: EthereumAddress) throws -> BigUInt
17+
func transfer(from: EthereumAddress, to: EthereumAddress, amount: String) throws -> WriteTransaction
18+
func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String) throws -> WriteTransaction
19+
func setAllowance(from: EthereumAddress, to: EthereumAddress, newAmount: String) throws -> WriteTransaction
20+
func authorize(from: EthereumAddress, operator user: EthereumAddress) throws -> WriteTransaction
21+
func revoke(from: EthereumAddress, operator user: EthereumAddress) throws -> WriteTransaction
22+
func isOperatorFor(operator user: EthereumAddress, tokenHolder: EthereumAddress) throws -> Bool
23+
func send(from: EthereumAddress, to: EthereumAddress, amount: String, data: [UInt8]) throws -> WriteTransaction
24+
func operatorSend(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String, data: [UInt8], operatorData: [UInt8]) throws -> WriteTransaction
25+
func burn(from: EthereumAddress, amount: String, data: [UInt8]) throws -> WriteTransaction
26+
func operatorBurn(from: EthereumAddress, amount: String, originalOwner: EthereumAddress, data: [UInt8], operatorData: [UInt8]) throws -> WriteTransaction
27+
}
28+
1429
// This namespace contains functions to work with ERC721 tokens.
1530
// can be imperatively read and saved
1631
public class ERC777 {
@@ -144,7 +159,7 @@ public class ERC777 {
144159
}.wait()
145160
}
146161

147-
public func getBalance(account: EthereumAddress) throws -> BigUInt{
162+
public func getBalance(account: EthereumAddress) throws -> BigUInt {
148163
let contract = self.contract
149164
var transactionOptions = TransactionOptions()
150165
transactionOptions.callOnBlock = .latest

0 commit comments

Comments
 (0)