import EthUtils from './utils/eth_utils' import AbiManager from './utils/abi_manager' class @contract { @constructor private _ethUtils: EthUtils private _contractAddress: string private _version: number = null constructor(ethUtils: EthUtils, address: string) { this._ethUtils = ethUtils this._contractAddress = address } @functions private async _getAbi(): Promise { let version = await this._getVersion() return AbiManager.getAbiAndBytecode('@contract', version).abi } private async _getVersion(): Promise { if (this._version == null) { let abi = AbiManager.getAbiAndBytecode('Version').abi this._version = await this._ethUtils.call(abi, this._contractAddress, this._contractAddress, '0', 'version', []) } return this._version } } export default @contract