-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
srisankethu
committed
Jan 7, 2019
1 parent
d533c0b
commit e8f6e34
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import Foundation | ||
import BigInt | ||
import EthereumAddress | ||
import PromiseKit | ||
|
||
protocol ISecurityToken: IERC20 { | ||
|
||
func decimals() throws -> UInt8 | ||
func totalSupply() throws -> BigUInt | ||
func getBalance(account: EthereumAddress) throws -> BigUInt | ||
func getAllowance(originalOwner: EthereumAddress, delegate: EthereumAddress) throws -> BigUInt | ||
func transfer(from: EthereumAddress, to: EthereumAddress, amount: String) throws -> WriteTransaction | ||
func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String) throws -> WriteTransaction | ||
func approve(from: EthereumAddress, spender: EthereumAddress, amount: String) throws -> WriteTransaction | ||
func decreasedApproval(from: EthereumAddress, spender: EthereumAddress, subtractedValue: String) throws -> WriteTransaction | ||
func increasedApproval(from: EthereumAddress, spender: EthereumAddress, addedValue: String) throws -> WriteTransaction | ||
|
||
func verifyTransfer(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String) throws -> WriteTransaction | ||
func mint(investor: EthereumAddress, amount: String) | ||
func mintWithData(investor: EthereumAddress, amount: String, data: Data) throws -> WriteTransaction | ||
func burnFromWithData(from: EthereumAddress, burner: EthereumAddress, amount: String, data: Data) throws -> WriteTransaction | ||
func burnWithData(burner: EthereumAddress, amount: String, data: Data) throws -> WriteTransaction | ||
func checkPermission(delegate: EthereumAddress, module: EthereumAddress, perm: Data) throws -> WriteTransaction | ||
func getModule(module: EthereumAddress) throws -> [Data, EthereumAddress, Bool, UInt8, BigUInt, BigUInt] | ||
func getModulesByName(name: Data) throws -> EthereumAddress[] | ||
func getModulesByType(type: UInt8) throws -> EthereumAddress[] | ||
func totalSupplyAt(checkpointId: String) throws -> BigUInt | ||
func getBalanceAt(investor: Ethereum, checkpointId: String) throws -> BigUInt | ||
func createCheckpoint() throws -> BigUInt | ||
func getInvestors() throws -> EthereumAddress[] | ||
func getInvestorsAt(checkpointId: String) throws -> EthereumAddress[] | ||
func iterateInvestors(start: String, end: String) throws -> EthereumAddress[] | ||
func currentCheckpointId() throws -> BigUInt | ||
func investors(index: String) throws -> EthereumAddress | ||
func withdrawERC20(tokenContract: EthereumAddress, amount: String) throws -> WriteTransaction | ||
func changeModuleBudget(module: EthereumAddress, budget: String) throws -> WriteTransaction | ||
func updateTokenDetails(newTokenDetails: String) throws -> WriteTransaction | ||
func changeGranularity(granularity: String) throws -> WriteTransaction | ||
func pruneInvestors(start: String, iters: String) throws -> WriteTransaction | ||
func freezeTransfers() throws -> WriteTransaction | ||
func unfreezeTransfers() throws -> WriteTransaction | ||
func freezeMinting() throws -> WriteTransaction | ||
func mintMulti(investors: EthereumAddress[], amounts: String[]) throws -> WriteTransaction | ||
func addModule(moduleFactory: EthereumAddress, data: Data, maxCost: String, budget: String) throws -> WriteTransaction | ||
func archiveModule(module: EthereumAddress) throws -> WriteTransaction | ||
func unarchiveModule(module: EthereumAddress) throws -> WriteTransaction | ||
func removeModule(module: EthereumAddress) throws -> WriteTransaction | ||
func setController(controller: EthereumAddress) throws -> WriteTransaction | ||
func forceTransfer(from: EthereumAddress, to: EthereumAddress, amount: String, data: Data, log: Data) throws -> WriteTransaction | ||
func forceBurn(from: EthereumAddress, amount: String, data: Data, log: Data) throws -> WriteTransaction | ||
func disableController() throws -> WriteTransaction | ||
func getVersion() throws -> UInt8[] | ||
func getInvestorCount() throws -> BigUInt | ||
func transferWithData(to: EthereumAddress, amount: String, data: Data) throws -> WriteTransaction | ||
func transferFromWithData(from: EthereumAddress, to: EthereumAddress, amount: String, data: Data) throws -> WriteTransaction | ||
func granularity() throws -> BigUInt | ||
|
||
} | ||
|
||
public class ST20: ISecurityToken { | ||
func decimals() throws -> UInt8 { | ||
} | ||
func totalSupply() throws -> BigUInt { | ||
} | ||
func getBalance(account: EthereumAddress) throws -> BigUInt { | ||
} | ||
func getAllowance(originalOwner: EthereumAddress, delegate: EthereumAddress) throws -> BigUInt { | ||
} | ||
func transfer(from: EthereumAddress, to: EthereumAddress, amount: String) throws -> WriteTransaction { | ||
} | ||
func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String) throws -> WriteTransaction { | ||
} | ||
func approve(from: EthereumAddress, spender: EthereumAddress, amount: String) throws -> WriteTransaction { | ||
} | ||
func decreasedApproval(from: EthereumAddress, spender: EthereumAddress, subtractedValue: String) throws -> WriteTransaction { | ||
} | ||
func increasedApproval(from: EthereumAddress, spender: EthereumAddress, addedValue: String) throws -> WriteTransaction { | ||
} | ||
} |