From b4b4a30a10b4e99dcb8434d55c145cc21ca69e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Mon, 10 Dec 2018 19:52:04 +0300 Subject: [PATCH 01/21] ci added --- .circleci/config.yml | 50 ++-- tests/build_and_test.sh | 27 ++ tests/confirmation.py | 239 --------------- tests/instrument.py | 625 +++++++++++++++++++++++++++++++++++++++ tests/instrumenttest.py | 232 --------------- tests/managertest.py | 236 --------------- tests/migration.py | 239 --------------- tests/mint.py | 233 --------------- tests/rights_registry.py | 117 ++++++++ tests/rightstest.py | 143 --------- tests/setup.py | 210 +++++++++++++ tests/standard_token.py | 380 ++++++++++++++++++++++++ tests/tokentest.py | 239 --------------- tests/usage_log.py | 116 ++++++++ tests/usagelogtest.py | 146 --------- 15 files changed, 1493 insertions(+), 1739 deletions(-) create mode 100755 tests/build_and_test.sh delete mode 100644 tests/confirmation.py create mode 100644 tests/instrument.py delete mode 100755 tests/instrumenttest.py delete mode 100644 tests/managertest.py delete mode 100644 tests/migration.py delete mode 100755 tests/mint.py create mode 100644 tests/rights_registry.py delete mode 100755 tests/rightstest.py create mode 100644 tests/setup.py create mode 100644 tests/standard_token.py delete mode 100755 tests/tokentest.py create mode 100644 tests/usage_log.py delete mode 100755 tests/usagelogtest.py diff --git a/.circleci/config.yml b/.circleci/config.yml index e9deead..0313a74 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,52 +5,38 @@ version: 2 jobs: build: + working_directory: ~/ore-protocol docker: # specify the version you desire here # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - - image: circleci/python:3.6.1 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - working_directory: ~/repo + - image: bcelebci/ore-protocol + environment: + PIPENV_VENV_IN_PROJECT: true steps: - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "requirements.txt" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: - name: install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r requirements.txt - - - save_cache: - paths: - - ./venv - key: v1-dependencies-{{ checksum "requirements.txt" }} - + # - restore_cache: # restores saved dependency cache if the Branch key template or requirements.txt files have not changed since the previous run + # key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }} + # - run: + # name: install dependencies + # command: | + # ./expect_script.sh + # sudo -H python3 -m pip install -e eosfactory/ + # python3 eosfactory/eosfactory/install.py /opt/eos ~/testeos/contracts # run tests! # this example uses Django's built-in test-runner # other common Python testing frameworks include pytest and nose # https://pytest.org # https://nose.readthedocs.io + # - save_cache: # special step to save dependency cache + # key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }} + # paths: + # - "venv" - run: name: run tests command: | - . venv/bin/activate - python manage.py test + tests/build_and_test.sh - store_artifacts: path: test-reports - destination: test-reports - + destination: test-reports \ No newline at end of file diff --git a/tests/build_and_test.sh b/tests/build_and_test.sh new file mode 100755 index 0000000..11c3849 --- /dev/null +++ b/tests/build_and_test.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +cd ~/Workspace/testeosfactory/contracts + +cd ore.instrument && mkdir build + +eosiocpp -g build/ore.instrument.wast ore.instrument.cpp +eosiocpp -o build/ore.instrument.abi ore.instrument.cpp + +cd ../ore.rights_registry && mkdir build +eosiocpp -g build/ore.rights_registry.wast ore.rights_registry.cpp +eosiocpp -o build/ore.rights_registry.abi ore.rights_registry.cpp + +cd ../ore.usage_log && mkdir build +eosiocpp -g build/ore.usage_log.wast ore.usage_log.cpp +eosiocpp -o build/ore.usage_log.abi ore.usage_log.cpp + +cd ../ore.standard_token && mkdir build +eosiocpp -g build/ore.standard_token.wast ore.standard_token.cpp +eosiocpp -o build/ore.standard_token.abi ore.standard_token.cpp + +cd ../tests + +python3 standard_token.py +python3 rights_registry.py +python3 instrument.py +python3 usage_log.py \ No newline at end of file diff --git a/tests/confirmation.py b/tests/confirmation.py deleted file mode 100644 index 1159227..0000000 --- a/tests/confirmation.py +++ /dev/null @@ -1,239 +0,0 @@ -# python3 ./tests/instrumenttest.py - -import time -import setup -import sys -import json -import eosf -import node -import unittest -from termcolor import cprint - -wallet_name = "" # Enter wallet name -wallet_pass = "" # Enter wallet password - -""" -This flag needs to be set to `True` only for the initial run -or after the contract is changed and re-built -""" -deployment = True - -setup.set_verbose(True) -setup.use_keosd(True) -setup.set_nodeos_URL("https://ore-staging.openrights.exchange:443") -setup.set_json(False) -#setup.set_command_line_mode(True) - -class Test1(unittest.TestCase): - - def run(self, result=None): - """ Stop after first error """ - if not result.failures: - super().run(result) - - @classmethod - def setUpClass(cls): - global contractPath - # set this variable to the local path for the contracts folder - contractPath = "/Users/basar/Workspace/ore-protocol/contracts" - - wallet = eosf.Wallet(wallet_name, wallet_pass) - assert(not wallet.error) - - global account_master - account_master = eosf.AccountMaster() - wallet.import_key(account_master) - assert(not account_master.error) - - global test1 - test1 = eosf.account(account_master, name="test1") - wallet.import_key(test1) - assert(not test1.error) - - global test2 - test2 = eosf.account(account_master, name="test2") - wallet.import_key(test2) - assert(not test2.error) - - global app_apim - app_apim = eosf.account(account_master, name="app.apim") - wallet.import_key(app_apim) - assert(not app_apim.error) - - token_deploy = eosf.account(account_master, name="ore.token") - wallet.import_key(token_deploy) - assert(not token_deploy.error) - - instr_deploy = eosf.account(account_master, name="instr.ore") - wallet.import_key(instr_deploy) - assert(not instr_deploy.error) - - rights_deploy = eosf.account(account_master, name="rights.ore") - wallet.import_key(rights_deploy) - assert(not rights_deploy.error) - - - contract_eosio_bios = eosf.Contract( - account_master, "eosio.bios").deploy() - assert(not contract_eosio_bios.error) - - global token_contract - token_contract = eosf.Contract(token_deploy, contractPath+"/ore.standard_token") - assert(not token_contract.error) - - global instr_ore - instr_ore = eosf.Contract(instr_deploy, contractPath+"/ore.instrument") - assert(not instr_ore.error) - - global rights_ore - rights_ore = eosf.Contract(rights_deploy, contractPath+"/ore.rights_registry") - assert(not rights_ore.error) - - - deployment = token_contract.deploy() - assert(not deployment.error) - - deployment = instr_ore.deploy() - assert(not deployment.error) - - deployment = rights_ore.deploy() - assert(not deployment.error) - - - def setUp(self): - pass - - - def test_01(self): - - cprint(""" -OREINST TOKEN TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("OREINST create") - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 OREINST"}').error) - - cprint(""" -INSTRUMENT CREATE FAIL TEST STARTED - """, 'yellow') - - cprint("instrument contract tries to create a symbol other than OREINST and fails", 'magenta') - self.assertTrue(instr_ore.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 TEST"}').error) - - cprint(""" -Action contract.push_action("OREINST issue") - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "issue", - '{"to":"' + 'instr.ore' - + '", "quantity":"10000000.0000 OREINST", "memo": "OREINST token issued"}', - account_master).error) - - - - def test_02(self): - - cprint(""" -RIGHT SET ACTION TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("upsertright", app_apim) - """, 'magenta') - self.assertFalse(rights_ore.push_action( - "upsertright", - '{"issuer":"' + 'app.apim' - + '","right_name":"cloud.hadron.contest-2018-07","urls":[{"url":"https://contest-hadron-dot-partner-aikon.appspot.com/contest-1","method":"get","matches_params":[],"token_life_span":100,"is_default":1}],"issuer_whitelist":["app.apim"]}' - , app_apim).error) - - def test_03(self): - - cprint(""" -INSTRUMENT MINT TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("mint", app_apim) - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "mint", - '{"minter":"' + 'app.apim' - + '","owner":"' + 'app.apim' - +'","instrument":'+ '{"issuer":"app.apim", "instrument_class":"class", "description":"description", "instrument_template":"template", "security_type":"security",' - + '"rights":[], "parent_instrument_id":"0", "data":[],' - + '"start_time":"0", "end_time":"0"}' - + ',"instrumentId":' + '0' - + '}' - , app_apim).error) - cprint(""" -Assign t1 = instr_ore.table("tokens", "tokens") - """, 'green') - t1 = instr_ore.table("tokens", "instr.ore") - - cprint(""" -Get the OREINST balance as 1.0000 ORE from the accounts table for app.apim) - """,'green') - t2 = instr_ore.table("accounts","app.apim") - - def test_04(self): - - cprint(""" -INSTRUMENT TRANSFER TESTS STARTED - """, 'yellow') - - self.assertFalse(instr_ore.push_action( - "transfer", - '{"sender":"app.apim", "to":"test1", "token_id":0}', app_apim).error) - t3 = instr_ore.table("accounts","app.apim") - t4 = instr_ore.table("accounts","test1") - def test_05(self): - - cprint(""" -INSTRUMENT APPROVE TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("approve", app_apim) - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "approve", - '{"from":"' + 'test1' - + '","to":"' + 'test2' - +'","token_id":'+ '0' - + '}' - , test1).error) - - def test_06(self): - cprint(""" -INSTRUMENT TRANSFERFROM TESTS STARTED - """, 'yellow') - def test_07(self): - cprint(""" -INSTRUMENT BURN TESTS STARTED - """, 'yellow') - - def test_07(self): - cprint(""" -INSTRUMENT BURNFROM TESTS STARTED - """, 'yellow') - def tearDown(self): - pass - - - @classmethod - def tearDownClass(cls): - node.stop() - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/instrument.py b/tests/instrument.py new file mode 100644 index 0000000..32f6e44 --- /dev/null +++ b/tests/instrument.py @@ -0,0 +1,625 @@ +import unittest +from eosfactory.eosf import * + +verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG]) + +class Test(unittest.TestCase): + + def run(self, result=None): + super().run(result) + + + @classmethod + def setUpClass(cls): + SCENARIO(''' + Create a contract from template, then build and deploy it. + ''') + reset() + create_wallet() + create_master_account("master") + + COMMENT(''' + Create test accounts: + ''') + create_account("app", master) + create_account("notminter", master) + + + def setUp(self): + pass + + + def test_01(self): + + create_account("right", master, account_name="rights.ore") + right_contract = Contract(right, "ore.rights_registry") + if(right_contract.is_deployed()): + right_contract.delete() + right_contract.build() + right_contract.deploy() + + create_account("instr", master, account_name="instr.ore") + instr_contract = Contract(instr, "ore.instrument") + if(instr_contract.is_deployed()): + instr_contract.delete() + instr_contract.build() + instr_contract.deploy() + + def test_02(self): + COMMENT(''' + Create and Issue OREINST: + ''') + + instr.push_action( + "create", + { + "issuer": instr, + "maximum_supply": "100000000.0000 OREINST" + }, + permission=(instr, Permission.ACTIVE)) + + instr.push_action( + "issue", + { + "to": instr, + "quantity": "10000000.0000 OREINST", + "memo": "" + }, + permission=(instr, Permission.ACTIVE)) + + def test_03(self): + COMMENT(''' + Register rights: + ''') + + right.push_action( + "upsertright", + { + "owner": app, + "right_name": "apimarket.manager.licenseApi", + "urls": [{ + "base_right": "", + "url": " ore://manager.apim/action/licenseapi", + "method": "post", + "matches_params": [{ + "name": "sla", + "value": "default" + }], + "token_life_span": 100, + "is_default": 1 + }], + "issuer_whitelist": [app] + }, + permission=(app, Permission.ACTIVE)) + + right.push_action( + "upsertright", + { + "owner": app, + "right_name": "apimarket.manager.licenseApi2", + "urls": [{ + "base_right": "", + "url": " ore://manager.apim/action/licenseapi", + "method": "post", + "matches_params": [{ + "name": "sla", + "value": "default" + }], + "token_life_span": 100, + "is_default": 1 + }], + "issuer_whitelist": [] + }, + permission=(app, Permission.ACTIVE)) + + right.push_action( + "upsertright", + { + "owner": app, + "right_name": "apimarket.manager.licenseApi3", + "urls": [{ + "base_right": "", + "url": " ore://manager.apim/action/licenseapi", + "method": "post", + "matches_params": [{ + "name": "sla", + "value": "default" + }], + "token_life_span": 100, + "is_default": 1 + }], + "issuer_whitelist": [] + }, + permission=(app, Permission.ACTIVE)) + + def test_04(self): + COMMENT(''' + Mint: + ''') + + instr.push_action( + "mint", + { + "minter": app, + "owner": app, + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "sample_template", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }, + { + "right_name": "apimarket.manager.licenseApi2", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0, + "instrumentId": 0 + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): # Instrument id exists + instr.push_action( + "mint", + { + "minter": app, + "owner": app, + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0, + "instrumentId": 1 + }, + permission=(app, Permission.ACTIVE)) + + def test_05(self): + COMMENT(''' + Create Instrument: + ''') + + instr.push_action( + "createinst", + { + "minter": app, + "owner": app, + "instrumentId": 2, + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0 + }, + permission=(instr, Permission.ACTIVE)) + + instr.push_action( + "createinst", + { + "minter": app, + "owner": app, + "instrumentId": 5, + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0 + }, + permission=(instr, Permission.ACTIVE)) + + with self.assertRaises(Error): # To account does not exists + instr.push_action( + "createinst", + { + "minter": app, + "owner": "notexist", + "instrumentId": 4, + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0 + }, + permission=(instr, Permission.ACTIVE)) + + + def test_06(self): + COMMENT(''' + Update Instrument: + ''') + + instr.push_action( + "updateinst", + { + "updater": app, + "owner": app, + "instrumentId": 2, + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0 + }, + permission=(instr, Permission.ACTIVE)) + + with self.assertRaises(Error): # To account does not exists + instr.push_action( + "updateinst", + { + "updater": app, + "owner": "notexist", + "instrumentId": 2, + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0 + }, + permission=(instr, Permission.ACTIVE)) + + def test_07(self): + COMMENT(''' + Check Rights: + ''') + + instr.push_action( + "mint", + { + "minter": app, + "owner": app, + "instrument": { + "issuer": app, + "instrument_class": "class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi3", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0, + "instrumentId": 3 + }, + permission=(app, Permission.ACTIVE)) + + instr.push_action( + "checkright", + { + "minter": app, + "issuer": app, + "rightname": "apimarket.manager.licenseApi", + "deferred_transaction_id": 10 + }, + permission=(instr, Permission.ACTIVE)) + + with self.assertRaises(Error): # Right doesn't exist + instr.push_action( + "checkright", + { + "minter": app, + "issuer": app, + "rightname": "nonexistent.right", + "deferred_transaction_id": 0 + }, + permission=(instr, Permission.ACTIVE)) + + with self.assertRaises(Error): # minter neither owns the right nor whitelisted for the right + instr.push_action( + "checkright", + { + "minter": "ownerfails", + "issuer": app, + "rightname": "apimarket.manager.licenseApi", + "deferred_transaction_id": 0 + }, + permission=(instr, Permission.ACTIVE)) + + with self.assertRaises(Error): # instrument issuer neither holds the right nor whitelisted for the right + instr.push_action( + "checkright", + { + "minter": "minter", + "issuer": "issuerfails", + "rightname": "apimarket.manager.licenseApi", + "deferred_transaction_id": 0 + }, + permission=(instr, Permission.ACTIVE)) + + def test_08(self): + COMMENT(''' + Revoke: + ''') + + instr.push_action( + "mint", + { + "minter": app, + "owner": app, + "instrument": { + "issuer": app, + "instrument_class": "class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi3", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0, + "instrumentId": 4 + }, + permission=(app, Permission.ACTIVE)) + + instr.push_action( + "revoke", + { + "revoker": app, + "token_id": 5 + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #token doesn't exist + instr.push_action( + "revoke", + { + "revoker": app, + "token_id": 70 + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): # The revoker account doesn't have authority to revoke the instrument + instr.push_action( + "revoke", + { + "revoker": right, + "token_id": 4 + }, + permission=(right, Permission.ACTIVE)) + + with self.assertRaises(Error): # token is already revoked + instr.push_action( + "revoke", + { + "revoker": app, + "token_id": 5 + }, + permission=(app, Permission.ACTIVE)) + + def test_09(self): + COMMENT(''' + Update: + ''') + + instr.push_action( + "update", + { + "updater": app, + "instrument_template": "", + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "instrument_id": 2, + "start_time": 0, + "end_time": 0 + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Updater acccount doesn't have the authority to change start/edd time of the instrument + instr.push_action( + "update", + { + "updater": right, + "instrument_template": "", + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "instrument_id": 1, + "start_time": 0, + "end_time": 0 + }, + permission=(right, Permission.ACTIVE)) + + def test_10(self): + COMMENT(''' + Transfer: + ''') + + instr.push_action( + "transfer", + { + "sender": app, + "to": right, + "token_id": 2 + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Sender account is not allowed to transfer the instrument + instr.push_action( + "transfer", + { + "sender": app, + "to": right, + "token_id": 2 + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Token doesn't exists + instr.push_action( + "transfer", + { + "sender": app, + "to": right, + "token_id": 99 + }, + permission=(app, Permission.ACTIVE)) + + + # def test_06(self): + # def test_07(self): + # def test_08(self): + + + + + def tearDown(self): + pass + + + @classmethod + def tearDownClass(cls): + stop() + + +if __name__ == "__main__": + unittest.main() \ No newline at end of file diff --git a/tests/instrumenttest.py b/tests/instrumenttest.py deleted file mode 100755 index 6cbbea8..0000000 --- a/tests/instrumenttest.py +++ /dev/null @@ -1,232 +0,0 @@ -# python3 ./tests/instrumenttest.py - -import time -import setup -import sys -import json -import eosf -import node -import unittest -from termcolor import cprint - -setup.set_verbose(True) -setup.set_json(False) -setup.use_keosd(False) -#setup.set_command_line_mode(True) - -class Test1(unittest.TestCase): - - def run(self, result=None): - """ Stop after first error """ - if not result.failures: - super().run(result) - - @classmethod - def setUpClass(cls): - global contractPath - # set this variable to the local path for the contracts folder - contractPath = "/Users/basar/Workspace/ore-protocol/contracts" - - testnet = node.reset() - assert(not testnet.error) - - wallet = eosf.Wallet() - assert(not wallet.error) - - global account_master - account_master = eosf.AccountMaster() - wallet.import_key(account_master) - assert(not account_master.error) - - global test1 - test1 = eosf.account(account_master, name="test1") - wallet.import_key(test1) - assert(not test1.error) - - global test2 - test2 = eosf.account(account_master, name="test2") - wallet.import_key(test2) - assert(not test2.error) - - global app_apim - app_apim = eosf.account(account_master, name="app.apim") - wallet.import_key(app_apim) - assert(not app_apim.error) - - token_deploy = eosf.account(account_master, name="ore.token") - wallet.import_key(token_deploy) - assert(not token_deploy.error) - - instr_deploy = eosf.account(account_master, name="instr.ore") - wallet.import_key(instr_deploy) - assert(not instr_deploy.error) - - rights_deploy = eosf.account(account_master, name="rights.ore") - wallet.import_key(rights_deploy) - assert(not rights_deploy.error) - - - contract_eosio_bios = eosf.Contract( - account_master, "eosio.bios").deploy() - assert(not contract_eosio_bios.error) - - global token_contract - token_contract = eosf.Contract(token_deploy, contractPath+"/ore.standard_token") - assert(not token_contract.error) - - global instr_ore - instr_ore = eosf.Contract(instr_deploy, contractPath+"/ore.instrument") - assert(not instr_ore.error) - - global rights_ore - rights_ore = eosf.Contract(rights_deploy, contractPath+"/ore.rights_registry") - assert(not rights_ore.error) - - - deployment = token_contract.deploy() - assert(not deployment.error) - - deployment = instr_ore.deploy() - assert(not deployment.error) - - deployment = rights_ore.deploy() - assert(not deployment.error) - - - def setUp(self): - pass - - - def test_01(self): - - cprint(""" -OREINST TOKEN TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("OREINST create") - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 OREINST"}').error) - - cprint(""" -INSTRUMENT CREATE FAIL TEST STARTED - """, 'yellow') - - cprint("instrument contract tries to create a symbol other than OREINST and fails", 'magenta') - self.assertTrue(instr_ore.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 TEST"}').error) - - cprint(""" -Action contract.push_action("OREINST issue") - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "issue", - '{"to":"' + 'instr.ore' - + '", "quantity":"10000000.0000 OREINST", "memo": "OREINST token issued"}', - account_master).error) - - - - def test_02(self): - - cprint(""" -RIGHT SET ACTION TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("upsertright", app_apim) - """, 'magenta') - self.assertFalse(rights_ore.push_action( - "upsertright", - '{"issuer":"' + 'app.apim' - + '","right_name":"cloud.hadron.contest-2018-07","urls":[{"url":"https://contest-hadron-dot-partner-aikon.appspot.com/contest-1","method":"get","matches_params":[],"token_life_span":100,"is_default":1}],"issuer_whitelist":["app.apim"]}' - , app_apim).error) - - def test_03(self): - - cprint(""" -INSTRUMENT MINT TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("mint", app_apim) - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "mint", - '{"minter":"' + 'app.apim' - + '","owner":"' + 'app.apim' - +'","instrument":'+ '{"issuer":"app.apim", "instrument_class":"class", "description":"description", "instrument_template":"template", "security_type":"security",' - + '"rights":[], "parent_instrument_id":"0", "data":[],' - + '"start_time":"0", "end_time":"0"}' - + ',"instrumentId":' + '0' - + '}' - , app_apim).error) - cprint(""" -Assign t1 = instr_ore.table("tokens", "tokens") - """, 'green') - t1 = instr_ore.table("tokens", "instr.ore") - - cprint(""" -Get the OREINST balance as 1.0000 ORE from the accounts table for app.apim) - """,'green') - t2 = instr_ore.table("accounts","app.apim") - - def test_04(self): - - cprint(""" -INSTRUMENT TRANSFER TESTS STARTED - """, 'yellow') - - self.assertFalse(instr_ore.push_action( - "transfer", - '{"sender":"app.apim", "to":"test1", "token_id":0}', app_apim).error) - t3 = instr_ore.table("accounts","app.apim") - t4 = instr_ore.table("accounts","test1") - def test_05(self): - - cprint(""" -INSTRUMENT APPROVE TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("approve", app_apim) - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "approve", - '{"from":"' + 'test1' - + '","to":"' + 'test2' - +'","token_id":'+ '0' - + '}' - , test1).error) - - def test_06(self): - cprint(""" -INSTRUMENT TRANSFERFROM TESTS STARTED - """, 'yellow') - def test_07(self): - cprint(""" -INSTRUMENT BURN TESTS STARTED - """, 'yellow') - - def test_07(self): - cprint(""" -INSTRUMENT BURNFROM TESTS STARTED - """, 'yellow') - def tearDown(self): - pass - - - @classmethod - def tearDownClass(cls): - node.stop() - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/managertest.py b/tests/managertest.py deleted file mode 100644 index 8ebd1f2..0000000 --- a/tests/managertest.py +++ /dev/null @@ -1,236 +0,0 @@ -# python3 ./tests/instrumenttest.py - -import time -import setup -import sys -import json -import eosf -import node -import unittest -from termcolor import cprint - -setup.set_verbose(True) -setup.set_json(False) -setup.use_keosd(False) -#setup.set_command_line_mode(True) - -class Test1(unittest.TestCase): - - def run(self, result=None): - """ Stop after first error """ - if not result.failures: - super().run(result) - - @classmethod - def setUpClass(cls): - global contractPath - # set this variable to the local path for the contracts folder - contractPath = "/Users/basar/Workspace/ore-protocol/contracts" - - testnet = node.reset() - assert(not testnet.error) - - wallet = eosf.Wallet() - assert(not wallet.error) - - global account_master - account_master = eosf.AccountMaster() - wallet.import_key(account_master) - assert(not account_master.error) - - global test1 - test1 = eosf.account(account_master, name="test1") - wallet.import_key(test1) - assert(not test1.error) - - global test2 - test2 = eosf.account(account_master, name="test2") - wallet.import_key(test2) - assert(not test2.error) - - global app_apim - app_apim = eosf.account(account_master, name="app.apim") - wallet.import_key(app_apim) - assert(not app_apim.error) - - token_deploy = eosf.account(account_master, name="ore.token") - wallet.import_key(token_deploy) - assert(not token_deploy.error) - - instr_deploy = eosf.account(account_master, name="instr.ore") - wallet.import_key(instr_deploy) - assert(not instr_deploy.error) - - rights_deploy = eosf.account(account_master, name="rights.ore") - wallet.import_key(rights_deploy) - assert(not rights_deploy.error) - - rights_deploy = eosf.account(account_master, name="rights.ore") - wallet.import_key(rights_deploy) - assert(not rights_deploy.error) - - - contract_eosio_bios = eosf.Contract( - account_master, "eosio.bios").deploy() - assert(not contract_eosio_bios.error) - - global token_contract - token_contract = eosf.Contract(token_deploy, contractPath+"/ore.standard_token") - assert(not token_contract.error) - - global instr_ore - instr_ore = eosf.Contract(instr_deploy, contractPath+"/ore.instrument") - assert(not instr_ore.error) - - global rights_ore - rights_ore = eosf.Contract(rights_deploy, contractPath+"/ore.rights_registry") - assert(not rights_ore.error) - - - deployment = token_contract.deploy() - assert(not deployment.error) - - deployment = instr_ore.deploy() - assert(not deployment.error) - - deployment = rights_ore.deploy() - assert(not deployment.error) - - - def setUp(self): - pass - - - def test_01(self): - - cprint(""" -OREINST TOKEN TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("OREINST create") - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 OREINST"}').error) - - cprint(""" -INSTRUMENT CREATE FAIL TEST STARTED - """, 'yellow') - - cprint("instrument contract tries to create a symbol other than OREINST and fails", 'magenta') - self.assertTrue(instr_ore.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 TEST"}').error) - - cprint(""" -Action contract.push_action("OREINST issue") - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "issue", - '{"to":"' + 'instr.ore' - + '", "quantity":"10000000.0000 OREINST", "memo": "OREINST token issued"}', - account_master).error) - - - - def test_02(self): - - cprint(""" -RIGHT SET ACTION TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("upsertright", app_apim) - """, 'magenta') - self.assertFalse(rights_ore.push_action( - "upsertright", - '{"issuer":"' + 'app.apim' - + '","right_name":"cloud.hadron.contest-2018-07","urls":[{"url":"https://contest-hadron-dot-partner-aikon.appspot.com/contest-1","method":"get","matches_params":[],"token_life_span":100,"is_default":1}],"issuer_whitelist":["app.apim"]}' - , app_apim).error) - - def test_03(self): - - cprint(""" -INSTRUMENT MINT TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("mint", app_apim) - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "mint", - '{"minter":"' + 'app.apim' - + '","owner":"' + 'app.apim' - +'","instrument":'+ '{"issuer":"app.apim", "instrument_class":"class", "description":"description", "instrument_template":"template", "security_type":"security",' - + '"rights":[], "parent_instrument_id":"0", "data":[],' - + '"start_time":"0", "end_time":"0"}' - + ',"instrumentId":' + '0' - + '}' - , app_apim).error) - cprint(""" -Assign t1 = instr_ore.table("tokens", "tokens") - """, 'green') - t1 = instr_ore.table("tokens", "instr.ore") - - cprint(""" -Get the OREINST balance as 1.0000 ORE from the accounts table for app.apim) - """,'green') - t2 = instr_ore.table("accounts","app.apim") - - def test_04(self): - - cprint(""" -INSTRUMENT TRANSFER TESTS STARTED - """, 'yellow') - - self.assertFalse(instr_ore.push_action( - "transfer", - '{"sender":"app.apim", "to":"test1", "token_id":0}', app_apim).error) - t3 = instr_ore.table("accounts","app.apim") - t4 = instr_ore.table("accounts","test1") - def test_05(self): - - cprint(""" -INSTRUMENT APPROVE TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("approve", app_apim) - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "approve", - '{"from":"' + 'test1' - + '","to":"' + 'test2' - +'","token_id":'+ '0' - + '}' - , test1).error) - - def test_06(self): - cprint(""" -INSTRUMENT TRANSFERFROM TESTS STARTED - """, 'yellow') - def test_07(self): - cprint(""" -INSTRUMENT BURN TESTS STARTED - """, 'yellow') - - def test_07(self): - cprint(""" -INSTRUMENT BURNFROM TESTS STARTED - """, 'yellow') - def tearDown(self): - pass - - - @classmethod - def tearDownClass(cls): - node.stop() - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/migration.py b/tests/migration.py deleted file mode 100644 index f0362f0..0000000 --- a/tests/migration.py +++ /dev/null @@ -1,239 +0,0 @@ -# python3 ./tests/instrumenttest.py - -import time -import setup -import sys -import json -import eosf -import node -import unittest -from termcolor import cprint - -setup.set_verbose(True) -setup.set_json(False) -setup.use_keosd(False) -#setup.set_command_line_mode(True) - -class Test1(unittest.TestCase): - - def run(self, result=None): - """ Stop after first error """ - if not result.failures: - super().run(result) - - @classmethod - def setUpClass(cls): - global contractPath - # set this variable to the local path for the contracts folder - contractPath = "/Users/basar/Workspace/ore-protocol/contracts" - - testnet = node.reset() - assert(not testnet.error) - - wallet = eosf.Wallet() - assert(not wallet.error) - - global account_master - account_master = eosf.AccountMaster() - wallet.import_key(account_master) - assert(not account_master.error) - - global test1 - test1 = eosf.account(account_master, name="test1") - wallet.import_key(test1) - assert(not test1.error) - - global test2 - test2 = eosf.account(account_master, name="test2") - wallet.import_key(test2) - assert(not test2.error) - - global app_apim - app_apim = eosf.account(account_master, name="app.apim") - wallet.import_key(app_apim) - assert(not app_apim.error) - - token_deploy = eosf.account(account_master, name="ore.token") - wallet.import_key(token_deploy) - assert(not token_deploy.error) - - instrold_deploy = eosf.account(account_master, name="instr.old") - wallet.import_key(instrold_deploy) - assert(not instrold_deploy.error) - - instr_deploy = eosf.account(account_master, name="instr.ore") - wallet.import_key(instr_deploy) - assert(not instr_deploy.error) - - rights_deploy = eosf.account(account_master, name="rights.ore") - wallet.import_key(rights_deploy) - assert(not rights_deploy.error) - - - contract_eosio_bios = eosf.Contract( - account_master, "eosio.bios").deploy() - assert(not contract_eosio_bios.error) - - global token_contract - token_contract = eosf.Contract(token_deploy, contractPath+"/ore.standard_token") - assert(not token_contract.error) - - global instr_ore - instr_ore = eosf.Contract(instr_deploy, contractPath+"/old.instrument") - assert(not instr_ore.error) - - instr_ore = eosf.Contract(instr_deploy, contractPath+"/ore.instrument") - assert(not instr_ore.error) - - global rights_ore - rights_ore = eosf.Contract(rights_deploy, contractPath+"/ore.rights_registry") - assert(not rights_ore.error) - - - deployment = token_contract.deploy() - assert(not deployment.error) - - deployment = instr_ore.deploy() - assert(not deployment.error) - - deployment = rights_ore.deploy() - assert(not deployment.error) - - - def setUp(self): - pass - - - def test_01(self): - - cprint(""" -OREINST TOKEN TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("OREINST create") - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 OREINST"}').error) - - cprint(""" -INSTRUMENT CREATE FAIL TEST STARTED - """, 'yellow') - - cprint("instrument contract tries to create a symbol other than OREINST and fails", 'magenta') - self.assertTrue(instr_ore.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 TEST"}').error) - - cprint(""" -Action contract.push_action("OREINST issue") - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "issue", - '{"to":"' + 'instr.ore' - + '", "quantity":"10000000.0000 OREINST", "memo": "OREINST token issued"}', - account_master).error) - - - - def test_02(self): - - cprint(""" -RIGHT SET ACTION TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("upsertright", app_apim) - """, 'magenta') - self.assertFalse(rights_ore.push_action( - "upsertright", - '{"issuer":"' + 'app.apim' - + '","right_name":"cloud.hadron.contest-2018-07","urls":[{"url":"https://contest-hadron-dot-partner-aikon.appspot.com/contest-1","method":"get","matches_params":[],"token_life_span":100,"is_default":1}],"issuer_whitelist":["app.apim"]}' - , app_apim).error) - - def test_03(self): - - cprint(""" -INSTRUMENT MINT TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("mint", app_apim) - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "mint", - '{"minter":"' + 'app.apim' - + '","owner":"' + 'app.apim' - +'","instrument":'+ '{"issuer":"app.apim", "instrument_class":"class", "description":"description", "instrument_template":"template", "security_type":"security",' - + '"rights":[], "parent_instrument_id":"0", "data":[],' - + '"start_time":"0", "end_time":"0"}' - + ',"instrumentId":' + '0' - + '}' - , app_apim).error) - cprint(""" -Assign t1 = instr_ore.table("tokens", "tokens") - """, 'green') - t1 = instr_ore.table("tokens", "instr.ore") - - cprint(""" -Get the OREINST balance as 1.0000 ORE from the accounts table for app.apim) - """,'green') - t2 = instr_ore.table("accounts","app.apim") - - def test_04(self): - - cprint(""" -INSTRUMENT TRANSFER TESTS STARTED - """, 'yellow') - - self.assertFalse(instr_ore.push_action( - "transfer", - '{"sender":"app.apim", "to":"test1", "token_id":0}', app_apim).error) - t3 = instr_ore.table("accounts","app.apim") - t4 = instr_ore.table("accounts","test1") - def test_05(self): - - cprint(""" -INSTRUMENT APPROVE TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("approve", app_apim) - """, 'magenta') - self.assertFalse(instr_ore.push_action( - "approve", - '{"from":"' + 'test1' - + '","to":"' + 'test2' - +'","token_id":'+ '0' - + '}' - , test1).error) - - def test_06(self): - cprint(""" -INSTRUMENT TRANSFERFROM TESTS STARTED - """, 'yellow') - def test_07(self): - cprint(""" -INSTRUMENT BURN TESTS STARTED - """, 'yellow') - - def test_07(self): - cprint(""" -INSTRUMENT BURNFROM TESTS STARTED - """, 'yellow') - def tearDown(self): - pass - - - @classmethod - def tearDownClass(cls): - node.stop() - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/mint.py b/tests/mint.py deleted file mode 100755 index 49d1db4..0000000 --- a/tests/mint.py +++ /dev/null @@ -1,233 +0,0 @@ -# python3 ./tests/mint.py - -import setup -import eosf -import node -import unittest -from termcolor import cprint - -setup.set_verbose(True) -setup.set_json(False) -setup.use_keosd(False) - -class Test1(unittest.TestCase): - - def run(self, result=None): - """ Stop after first error """ - if not result.failures: - super().run(result) - - - @classmethod - def setUpClass(cls): - global contractPath - # set this variable to the local path for the contracts folder - contractPath = "" - - - testnet = node.reset() - assert(not testnet.error) - - wallet = eosf.Wallet() - assert(not wallet.error) - - global account_master - account_master = eosf.AccountMaster() - wallet.import_key(account_master) - assert(not account_master.error) - - global apim - apim = eosf.account(account_master, name="apim") - wallet.import_key(apim) - assert(not apim.error) - - global test1 - test1 = eosf.account(apim, name="test1.apim") - wallet.import_key(test1) - assert(not test1.error) - - global test2 - test2 = eosf.account(apim, name="test2.apim") - wallet.import_key(test2) - assert(not test2.error) - - global manager_apim - manager_apim = eosf.account(apim, name="manager.apim") - wallet.import_key(manager_apim) - assert(not manager_apim.error) - - global app_apim - app_apim = eosf.account(apim, name="app.apim") - wallet.import_key(app_apim) - assert(not app_apim.error) - - global aikon_apim - aikon_apim = eosf.account(apim, name="aikon.apim") - wallet.import_key(aikon_apim) - assert(not aikon_apim.error) - - global ore - ore = eosf.account(account_master, name="ore") - wallet.import_key(ore) - assert(not ore.error) - - global token_ore - token_ore = eosf.account(ore, name="token.ore") - wallet.import_key(token_ore) - assert(not token_ore.error) - - global instr_ore - instr_ore = eosf.account(ore, name="instr.ore") - wallet.import_key(instr_ore) - assert(not instr_ore.error) - - global rights_ore - rights_ore = eosf.account(ore, name="rights.ore") - wallet.import_key(rights_ore) - assert(not rights_ore.error) - - global usage_log_ore - usage_log_ore = eosf.account(ore, name="usagelog.ore") - wallet.import_key(usage_log_ore) - assert(not usage_log_ore.error) - - contract_eosio_bios = eosf.Contract( - account_master, "eosio.bios").deploy() - assert(not contract_eosio_bios.error) - - global token_contract - token_contract = eosf.Contract(token_ore, contractPath+"/ore.standard_token") - assert(not token_contract.error) - - global instr_contract - instr_contract = eosf.Contract(instr_ore, contractPath+"/ore.instrument") - assert(not instr_contract.error) - - global rights_contract - rights_contract = eosf.Contract(rights_ore, contractPath+"/ore.rights_registry") - assert(not rights_contract.error) - - global usagelog_contract - usagelog_contract = eosf.Contract(usage_log_ore, contractPath+"/ore.usage_log") - assert(not usagelog_contract.error) - - global managerapim_contract - managerapim_contract = eosf.Contract(manager_apim, contractPath+"/apim.manager") - assert(not managerapim_contract.error) - - deployment = token_contract.deploy() - assert(not deployment.error) - - deployment = instr_contract.deploy() - assert(not deployment.error) - - deployment = rights_contract.deploy() - assert(not deployment.error) - - deployment = usagelog_contract.deploy() - assert(not deployment.error) - - deployment = managerapim_contract.deploy() - assert(not deployment.error) - - - def setUp(self): - pass - - - def test_01(self): - - cprint(""" -TOKEN CONTRACT TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("CPU create") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 CPU"}').error) - - cprint(""" -Action contract.push_action("CPU issue") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "issue", - '{"to":"' + str(app_apim) - + '", "quantity":"10000000.0000 CPU", "memo": "CPU token issued"}', - account_master).error) - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 ORE"}').error) - - cprint(""" -Action contract.push_action("ORE issue") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "issue", - '{"to":"' + str(app_apim) - + '", "quantity":"10000000.0000 ORE", "memo": "ORE token issued"}', - account_master).error) - - cprint(""" -Action contract.push_action("OREINST create") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "create", - '{"issuer":"' - + str(account_master) - + '", "maximum_supply":"100000000.0000 OREINST"}').error) - - cprint(""" -Action contract.push_action("OREINST issue") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "issue", - '{"to":"' + str(app_apim) - + '", "quantity":"10000000.0000 OREINST", "memo": "OREINST token issued"}', - account_master, output=True).error) - - def test_02(self): - - cprint(""" -APP APIM ACTIONS TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("upsertright", app_apim) - """, 'magenta') - self.assertFalse(rights_contract.push_action( - "upsertright", - '{"issuer":"' + str(app_apim) - + '","right_name":"cloud.hadron.contest-2018-07","urls":[{"url":"https://contest-hadron-dot-partner-aikon.appspot.com/contest-1","method":"get","matches_params":[],"token_life_span":100,"is_default":1}],"issuer_whitelist":["app.apim"]}' - , app_apim, output=True).error) - - - - cprint(""" -Assign t1 = rights_ore.table("rights.ore", "rights.ore") - """, 'green') - t2 = rights_contract.table("rights", "rights.ore") - - - - def tearDown(self): - pass - - - @classmethod - def tearDownClass(cls): - #node.stop() - pass - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/rights_registry.py b/tests/rights_registry.py new file mode 100644 index 0000000..10f7836 --- /dev/null +++ b/tests/rights_registry.py @@ -0,0 +1,117 @@ +import unittest +from eosfactory.eosf import * + +verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG]) + +class Test(unittest.TestCase): + + def run(self, result=None): + super().run(result) + + + @classmethod + def setUpClass(cls): + SCENARIO(''' + Create a contract from template, then build and deploy it. + ''') + reset() + create_wallet() + create_master_account("master") + + COMMENT(''' + Create test accounts: + ''') + create_account("app", master) + + + def setUp(self): + pass + + + def test_01(self): + COMMENT(''' + Create, build and deploy the contracts: + ''') + + create_account("right", master) + right_contract = Contract(right, "ore.rights_registry") + right_contract.build() + right_contract.deploy() + + def test_02(self): + COMMENT(''' + Register rights: + ''') + + right.push_action( + "upsertright", + { + "owner": app, + "right_name": "apimarket.manager.licenseApi", + "urls": [{ + "base_right": "", + "url": " ore://manager.apim/action/licenseapi", + "method": "post", + "matches_params": [{ + "name": "sla", + "value": "default" + }], + "token_life_span": 100, + "is_default": 1 + }], + "issuer_whitelist": ["app.apim"] + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #You are not the issuer of the existing contract. Update canceled. + right.push_action( + "upsertright", + { + "owner": app, + "right_name": "apimarket.manager.licenseApi", + "urls": [{ + "base_right": "", + "url": " ore://manager.apim/action/licenseapi", + "method": "post", + "matches_params": [{ + "name": "sla", + "value": "default" + }], + "token_life_span": 100, + "is_default": 1 + }], + "issuer_whitelist": ["app.apim"] + }, + permission=(app, Permission.ACTIVE)) + + right.push_action( + "upsertright", + { + "owner": app, + "right_name": "apimarket.manager.licenseApi2", + "urls": [{ + "base_right": "", + "url": " ore://manager.apim/action/licenseapi", + "method": "post", + "matches_params": [{ + "name": "sla", + "value": "default" + }], + "token_life_span": 100, + "is_default": 1 + }], + "issuer_whitelist": ["app.apim"] + }, + permission=(app, Permission.ACTIVE)) + + def tearDown(self): + pass + + + @classmethod + def tearDownClass(cls): + stop() + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/rightstest.py b/tests/rightstest.py deleted file mode 100755 index 20c6f5c..0000000 --- a/tests/rightstest.py +++ /dev/null @@ -1,143 +0,0 @@ -# python3 ./tests/rightstest.py - -import time -import setup -import eosf -import node -import unittest -from termcolor import cprint - -setup.set_verbose(True) -setup.set_json(False) -setup.use_keosd(False) -#setup.set_command_line_mode(True) - -class Test1(unittest.TestCase): - - def run(self, result=None): - """ Stop after first error """ - if not result.failures: - super().run(result) - - - @classmethod - def setUpClass(cls): - global contractPath - # set this variable to the local path for the contracts folder - contractPath = "/Users/basar/Workspace/ore-protocol/contracts" - - testnet = node.reset() - assert(not testnet.error) - - wallet = eosf.Wallet() - assert(not wallet.error) - - global account_master - account_master = eosf.AccountMaster() - wallet.import_key(account_master) - assert(not account_master.error) - - global test1 - test1 = eosf.account(account_master, name="test1") - wallet.import_key(test1) - assert(not test1.error) - - global test2 - test2 = eosf.account(account_master, name="test2") - wallet.import_key(test2) - assert(not test2.error) - - global test3 - test3 = eosf.account(account_master, name="test3") - wallet.import_key(test3) - assert(not test3.error) - - rights_deploy = eosf.account(account_master, name="rights.ore") - wallet.import_key(rights_deploy) - assert(not rights_deploy.error) - - contract_eosio_bios = eosf.Contract( - account_master, "eosio.bios").deploy() - assert(not contract_eosio_bios.error) - - global rights_ore - rights_ore = eosf.Contract(rights_deploy, contractPath+"/ore.rights_registry") - assert(not rights_ore.error) - - - deployment = rights_ore.deploy() - assert(not deployment.error) - - - def setUp(self): - pass - - - def test_01(self): - - cprint(""" -RIGHT REGISTRY TEST STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("upsertright", app_apim) - """, 'magenta') - self.assertFalse(rights_ore.push_action( - "upsertright", - '{"issuer":"' + 'test1' - + '","right_name":"TestRight1","urls":[{"url":"https://url/sample","method":"get","matches_params":[],"token_life_span":100,"is_default":1}],"issuer_whitelist":["test1"]}' - , test1, output=True).error) - - cprint(""" -Assign t1 = rights_ore.table("rights.ore", "rights.ore") - """, 'green') - t1 = rights_ore.table("rights", "rights.ore") - - - cprint(""" -RIGHT UDPDATE TEST STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("upsertright", app_apim) - """, 'magenta') - self.assertFalse(rights_ore.push_action( - "upsertright", - '{"issuer":"' + 'test1' - + '","right_name":"TestRight1","urls":[{"url":"https://url/edited1","method":"get","matches_params":[],"token_life_span":100,"is_default":1}],"issuer_whitelist":["test1", "test2"]}' - , test1, output=True).error) - - cprint(""" -Assign t1 = rights_ore.table("rights.ore", "rights.ore") - """, 'green') - t2 = rights_ore.table("rights", "rights.ore") - - - - cprint(""" -RIGHT UPDATE FAIL TEST STARTED - """, 'yellow') - - cprint("test2 account tries to update TestRight1, which is issued by test1", 'magenta') - self.assertTrue(rights_ore.push_action( - "upsertright", - '{"issuer":"' + 'test2' - + '","right_name":"TestRight1","urls":[{"url":"https://url/edited2","method":"get","matches_params":[],"token_life_span":100,"is_default":1}],"issuer_whitelist":["test1", "test2", "test3"]}' - , test2, output=True).error) - - cprint(""" -Assign t1 = rights_ore.table("rights.ore", "rights.ore") - """, 'green') - t3 = rights_ore.table("rights", "rights.ore") - - def tearDown(self): - pass - - - @classmethod - def tearDownClass(cls): - node.stop() - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/setup.py b/tests/setup.py new file mode 100644 index 0000000..e98a33f --- /dev/null +++ b/tests/setup.py @@ -0,0 +1,210 @@ +import unittest +from eosfactory.eosf import * + +verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG]) + +STANDARD_TOKEN = "~/Workspace/testeos/contracts/ore.standard_token/" +RIGHTS_REGISTRY = "~/Workspace/ore-protocol/contracts/ore.rights_registry/" +INSTRUMENT = "~/Workspace/ore-protocol/contracts/ore.instrument/" +USAGE_LOG = "~/Workspace/ore-protocol/contracts/ore.usage_log/" +APIM_MANAGER = "~/Workspace/ore-protocol/contracts/apim.manager/" + +class Test(unittest.TestCase): + + def run(self, result=None): + super().run(result) + + + @classmethod + def setUpClass(cls): + SCENARIO(''' + Create a contract from template, then build and deploy it. + ''') + reset() + create_wallet() + create_master_account("master") + + COMMENT(''' + Create test accounts: + ''') + create_account("app", master) + + + def setUp(self): + pass + + + def test_01(self): + COMMENT(''' + Create, build and deploy the contracts: + ''') + create_account("token", master) + token_contract = Contract(token, "ore.standard_token") + token_contract.build() + token_contract.deploy() + + create_account("right", master) + right_contract = Contract(right, "ore.rights_registry") + right_contract.build() + right_contract.deploy() + + create_account("instr", master) + instr_contract = Contract(instr, "ore.instrument") + instr_contract.build() + instr_contract.deploy() + + create_account("apim", master) + apim_contract = Contract(apim, "apim.manager") + apim_contract.build() + apim_contract.deploy() + + create_account("usage", master) + usage_contract = Contract(usage, "ore.usage_log") + usage_contract.build() + usage_contract.deploy() + + # token_contract.delete() + # right_contract.delete() + # instr_contract.delete() + # apim_contract.delete() + # usage_contract.delete() + + def test_02(self): + COMMENT(''' + Create and issue tokens: + ''') + + token.push_action( + "create", + { + "issuer": token, + "maximum_supply": "100000000.0000 CPU" + }, + permission=(token, Permission.ACTIVE)) + + token.push_action( + "create", + { + "issuer": token, + "maximum_supply": "100000000.0000 ORE" + }, + permission=(token, Permission.ACTIVE)) + + instr.push_action( + "create", + { + "issuer": instr, + "maximum_supply": "100000000.0000 OREINST" + }, + permission=(instr, Permission.ACTIVE)) + + token.push_action( + "issue", + { + "to": app, + "quantity": "10000000.0000 CPU", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + token.push_action( + "issue", + { + "to": app, + "quantity": "10000000.0000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + instr.push_action( + "issue", + { + "to": instr, + "quantity": "10000000.0000 OREINST", + "memo": "" + }, + permission=(instr, Permission.ACTIVE)) + + def test_03(self): + COMMENT(''' + Register rights: + ''') + + right.push_action( + "upsertright", + { + "owner": apim, + "right_name": "apimarket.manager.licenseApi", + "urls": [{ + "base_right": "", + "url": " ore://manager.apim/action/licenseapi", + "method": "post", + "matches_params": [{ + "name": "sla", + "value": "default" + }], + "token_life_span": 100, + "is_default": 1 + }], + "issuer_whitelist": ["app.apim"] + }, + permission=(apim, Permission.ACTIVE)) + + + + def test_04(self): + COMMENT(''' + Publish and license offers: + ''') + with self.assertRaises(Error): + apim.push_action( + "publishapi", + { + "creator":app, + "issuer":app, + "api_voucher_license_price_in_cpu":"0", + "api_voucher_lifetime_in_seconds": "10", + "api_voucher_start_date": "0", + "api_voucher_end_date": "0", + "api_voucher_mutability": "0", + "api_voucher_security_type":"pass", + "api_voucher_valid_forever": "0", + "right_params": [ + { + "right_name": "apimarket.manager.licenseApi", + "right_description":"description", + "right_price_in_cpu":"100", + "api_name":"apis", + "api_description":"desci", + "api_price_in_cpu":"10", + "api_payment_model":"pass", + "api_additional_url_params":"" + } + ], + "api_voucher_parameter_rules":[], + "offer_mutability": 2, + "offer_security_type": "sec", + "offer_template":"", + "offer_start_time": 0, + "offer_end_time":0, + "offer_override_id":0 + }, + permission=(app, Permission.ACTIVE)) + + + def test_05(self): + COMMENT(''' + Check tables: + ''') + + def tearDown(self): + pass + + + @classmethod + def tearDownClass(cls): + stop() + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/standard_token.py b/tests/standard_token.py new file mode 100644 index 0000000..eeeaea7 --- /dev/null +++ b/tests/standard_token.py @@ -0,0 +1,380 @@ +import unittest +from eosfactory.eosf import * + +verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG]) + +class Test(unittest.TestCase): + + def run(self, result=None): + super().run(result) + + + @classmethod + def setUpClass(cls): + SCENARIO(''' + Create a contract from template, then build and deploy it. + ''') + reset() + create_wallet() + create_master_account("master") + + COMMENT(''' + Create test accounts: + ''') + create_account("app", master) + create_account("nonapp", master) + + + def setUp(self): + pass + + + def test_01(self): + COMMENT(''' + Create, build and deploy the contracts: + ''') + create_account("token", master) + token_contract = Contract(token, "ore.standard_token") + token_contract.build() + token_contract.deploy() + + def test_02(self): + COMMENT(''' + Create tokens: + ''') + + #Valid transaction + token.push_action( + "create", + { + "issuer": token, + "maximum_supply": "100000000.0000 ORE" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Invalid symbol name + token.push_action( + "create", + { + "issuer": token, + "maximum_supply": "100000000.0000 OREEEEEE" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Invalid supply + token.push_action( + "create", + { + "issuer": token, + "maximum_supply": "100000.000000000000000000000000000000 ORA" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Max supply must be positive + token.push_action( + "create", + { + "issuer": token, + "maximum_supply": "-100000000.0000 ORA" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Token symbol already exists + token.push_action( + "create", + { + "issuer": token, + "maximum_supply": "100000000.0000 ORE" + }, + permission=(token, Permission.ACTIVE)) + + + def test_03(self): + COMMENT(''' + Issue tokens: + ''') + #Valid transaction + token.push_action( + "issue", + { + "to": app, + "quantity": "10000000.0000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + token.push_action( + "issue", + { + "to": token, + "quantity": "100.0000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Invalid symbol name + token.push_action( + "issue", + { + "to": app, + "quantity": "100.0000 OREEEEEE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Token symbol does not exists + token.push_action( + "issue", + { + "to": app, + "quantity": "100.0000 ORU", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Memo has more than 256 bytes + token.push_action( + "issue", + { + "to": app, + "quantity": "100.0000 ORE", + "memo": "LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Quantity must be positive + token.push_action( + "issue", + { + "to": app, + "quantity": "-100.0000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Symbol precision mismatch + token.push_action( + "issue", + { + "to": app, + "quantity": "100.000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Quantity exceeds available supply + token.push_action( + "issue", + { + "to": app, + "quantity": "100000000.0000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + def test_04(self): + COMMENT(''' + Approve tokens: + ''') + #Valid transaction + token.push_action( + "approve", + { + "from": app, + "to": nonapp, + "quantity": "10.0000 ORE", + "memo": "" + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Amount being approved is more than the balance of approver account + token.push_action( + "approve", + { + "from": app, + "to": nonapp, + "quantity": "10000001.0000 ORE", + "memo": "" + }, + permission=(app, Permission.ACTIVE)) + + def test_05(self): + COMMENT(''' + Retire tokens: + ''') + #Valid transaction + token.push_action( + "retire", + { + "quantity": "100.0000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Invalid symbol name + token.push_action( + "retire", + { + "quantity": "100.0000 OREEEEEE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Token symbol does not exists + token.push_action( + "retire", + { + "quantity": "100.0000 ORU", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Memo has more than 256 bytes + token.push_action( + "retire", + { + "quantity": "100.0000 ORE", + "memo": "LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Quantity must be positive + token.push_action( + "retire", + { + "quantity": "-100.0000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + with self.assertRaises(Error): #Symbol precision mismatch + token.push_action( + "retire", + { + "quantity": "100.000 ORE", + "memo": "" + }, + permission=(token, Permission.ACTIVE)) + + + def test_06(self): + COMMENT(''' + Transfer tokens: + ''') + #Valid Transaction + token.push_action( + "transfer", + { + "from":app, + "to": nonapp, + "quantity": "10.0000 ORE", + "memo": "" + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Cannot transfer to self + token.push_action( + "transfer", + { + "from":app, + "to": app, + "quantity": "100.0000 ORE", + "memo": "" + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #To account does not exist + token.push_action( + "transfer", + { + "from":app, + "to": "nonexist", + "quantity": "100.0000 ORE", + "memo": "" + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Memo has more than 256 bytes + token.push_action( + "transfer", + { + "from":app, + "to": nonapp, + "quantity": "100.0000 ORE", + "memo": "LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG" + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Invalid quantity + token.push_action( + "transfer", + { + "from":app, + "to": nonapp, + "quantity": "A ORE", + "memo": "" + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Quantity must be positive + + token.push_action( + "transfer", + { + "from":app, + "to": nonapp, + "quantity": "-100.0000 ORE", + "memo": "" + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #Symbol precision mismatch + token.push_action( + "transfer", + { + "from":app, + "to": nonapp, + "quantity": "100.000 ORE", + "memo": "" + }, + permission=(app, Permission.ACTIVE)) + + + def test_07(self): + COMMENT(''' + Transfer From tokens: + ''') + token.push_action( + "transferfrom", + { + "sender": nonapp, + "from":app, + "to": token, + "quantity": "5.0000 ORE", + "memo": "" + }, + permission=(nonapp, Permission.ACTIVE)) + + with self.assertRaises(Error): #The amount being transferred is more than the approved account + token.push_action( + "transferfrom", + { + "sender": nonapp, + "from":app, + "to": token, + "quantity": "6.0000 ORE", + "memo": "" + }, + permission=(nonapp, Permission.ACTIVE)) + + def tearDown(self): + pass + + + @classmethod + def tearDownClass(cls): + stop() + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/tokentest.py b/tests/tokentest.py deleted file mode 100755 index 2ade6b4..0000000 --- a/tests/tokentest.py +++ /dev/null @@ -1,239 +0,0 @@ -# python3 ./tests/mint.py - -import setup -import eosf -import node -import unittest -from termcolor import cprint - -setup.set_verbose(True) -setup.set_json(False) -setup.use_keosd(False) - -class Test1(unittest.TestCase): - - def run(self, result=None): - """ Stop after first error """ - if not result.failures: - super().run(result) - - - @classmethod - def setUpClass(cls): - global contractPath - # set this variable to the local path for the contracts folder - contractPath = "/Users/basar/Workspace/ore-protocol/contracts" - - testnet = node.reset() - assert(not testnet.error) - - wallet = eosf.Wallet() - assert(not wallet.error) - - global account_master - account_master = eosf.AccountMaster() - wallet.import_key(account_master) - assert(not account_master.error) - - global test1 - test1 = eosf.account(account_master, name="test1") - wallet.import_key(test1) - assert(not test1.error) - - global test2 - test2 = eosf.account(account_master, name="test2") - wallet.import_key(test2) - assert(not test2.error) - - global test3 - test3 = eosf.account(account_master, name="test3") - wallet.import_key(test3) - assert(not test3.error) - - contract_deploy = eosf.account(account_master, name="token.ore") - wallet.import_key(contract_deploy) - assert(not contract_deploy.error) - - contract_eosio_bios = eosf.Contract( - account_master, "eosio.bios").deploy() - assert(not contract_eosio_bios.error) - - global token_contract - token_contract = eosf.Contract(contract_deploy, contractPath+"/ore.standard_token") - assert(not token_contract.error) - - deployment = token_contract.deploy() - assert(not deployment.error) - - - def setUp(self): - pass - - - def test_01(self): - - cprint(""" -TOKEN CREATE TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertTrue(token_contract.push_action( - "create", - '{"issuer":"' - + 'test1' - + '", "maximum_supply":"100000000.0000 ORERERERERE"}').error) - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertTrue(token_contract.push_action( - "create", - '{"issuer":"' - + 'test1' - + '", "maximum_supply":"-100000000.0000 OREE"}').error) - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "create", - '{"issuer":"' - + 'test1' - + '", "maximum_supply":"100000000.0000 ORE"}').error) - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertTrue(token_contract.push_action( - "create", - '{"issuer":"' - + 'test1' - + '", "maximum_supply":"100000000.0000 ORE"}').error) - - cprint(""" -Action contract.push_action("ORE transfer") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "issue", - '{"to":"test1", "quantity":"10000000.0000 ORE", "memo": "ORE token issued"}', - test1).error) - - cprint(""" -Action contract.push_action("ORE transfer") - """, 'magenta') - self.assertTrue(token_contract.push_action( - "issue", - '{"to":"test1", "quantity":"100000000000000.0000 ORE", "memo": "ORE token issued"}', - test1).error) - - cprint(""" -Action contract.push_action("ORE transfer") - """, 'magenta') - self.assertTrue(token_contract.push_action( - "issue", - '{"to":"test2", "quantity":"1000000.0000 ORE", "memo": "ORE token issued"}', - test2).error) - - def test_02(self): - - cprint(""" -TOKEN TRANSFER TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("ORE transfer") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "transfer", - '{"from":"test1", "to":"test2", "quantity":"100.0000 ORE", "memo":"transfer1"}', test1).error) - - cprint(""" -Action contract.push_action("ORE transfer") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "transfer", - '{"from":"test2", "to":"test3", "quantity":"50.0000 ORE", "memo":"transfer1"}', test2).error) - - cprint(""" -Action contract.push_action("ORE transfer") - """, 'magenta') - self.assertTrue(token_contract.push_action( - "transfer", - '{"from":"test2", "to":"test3", "quantity":"60.0000 ORE", "memo":"transfer1"}', test2).error) - - def test_03(self): - - cprint(""" -TOKEN APPROVAL TESTS STARTED - """, 'yellow') - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "approve", - '{"from":"test1", "to":"test3", "quantity":"100.0000 ORE", "memo":"transfer1"}', test1).error) - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertTrue(token_contract.push_action( - "approve", - '{"from":"test2", "to":"test3", "quantity":"100.0000 ORE", "memo":"transfer1"}', test1).error) - - def test_04(self): - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertFalse(token_contract.push_action( - "transferfrom", - '{"sender":"test3", "from":"test1", "to":"test2", "quantity":"100.0000 ORE"}', test3).error) - - cprint(""" -Action contract.push_action("ORE create") - """, 'magenta') - self.assertTrue(token_contract.push_action( - "transferfrom", - '{"sender":"test3", "from":"test1", "to":"test2", "quantity":"100.0000 ORE"}', test3).error) - - def test_05(self): - - cprint(""" -TOKEN TABLE TESTS STARTED - """, 'yellow') - - cprint(""" -Assign t1 = token_contract.table("rights.ore", "rights.ore") - """, 'green') - t1 = token_contract.table("accounts", "test1") - - cprint(""" -Assign t1 = token_contract.table("rights.ore", "rights.ore") - """, 'green') - t2 = token_contract.table("accounts", "test2") - - cprint(""" -Assign t1 = token_contract.table("rights.ore", "rights.ore") - """, 'green') - t2 = token_contract.table("accounts", "test3") - - cprint(""" -Assign t1 = token_contract.table("rights.ore", "rights.ore") - """, 'green') - t3 = token_contract.table("allowances", "test1") - - - def tearDown(self): - pass - - - @classmethod - def tearDownClass(cls): - pass - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/usage_log.py b/tests/usage_log.py new file mode 100644 index 0000000..7a800a9 --- /dev/null +++ b/tests/usage_log.py @@ -0,0 +1,116 @@ +import unittest +from eosfactory.eosf import * + +verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG]) + +class Test(unittest.TestCase): + + def run(self, result=None): + super().run(result) + + + @classmethod + def setUpClass(cls): + SCENARIO(''' + Create a contract from template, then build and deploy it. + ''') + reset() + create_wallet() + create_master_account("master") + + COMMENT(''' + Create test accounts: + ''') + create_account("app", master) + + + def setUp(self): + pass + + + def test_01(self): + COMMENT(''' + Create, build and deploy the contracts: + ''') + + create_account("usage", master) + usage_contract = Contract(usage, "ore.usage_log") + usage_contract.build() + usage_contract.deploy() + + def test_02(self): + COMMENT(''' + Create Log: + ''') + + usage.push_action( + "createlog", + { + "instrument_id": 1, + "right_name": "right1", + "token_hash": "tokenhash1", + "timestamp": 100 + + }, + permission=(app, Permission.ACTIVE)) + + usage.push_action( + "createlog", + { + "instrument_id": 2, + "right_name": "right2", + "token_hash": "tokenhash2", + "timestamp": 100 + + }, + permission=(app, Permission.ACTIVE)) + + def test_03(self): + COMMENT(''' + Delete Log: + ''') + usage.push_action( + "deletelog", + { + "instrument_id": 2, + "token_hash": "tokenhash2" + + }, + permission=(app, Permission.ACTIVE)) + + with self.assertRaises(Error): #No log exist for the given pair or right and instrument + usage.push_action( + "deletelog", + { + "instrument_id": 2, + "token_hash": "tokenhash2" + + }, + permission=(app, Permission.ACTIVE)) + + def test_04(self): + COMMENT(''' + Update Count: + ''') + + usage.push_action( + "updatecount", + { + "instrument_id": 1, + "right_name": "right1", + "cpu": "1.0000 CPU" + + }, + permission=(app, Permission.ACTIVE)) + + def tearDown(self): + pass + + + @classmethod + def tearDownClass(cls): + stop() + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/usagelogtest.py b/tests/usagelogtest.py deleted file mode 100755 index c8c053a..0000000 --- a/tests/usagelogtest.py +++ /dev/null @@ -1,146 +0,0 @@ -# python3 ./tests/mint.py - -import time -import setup -import eosf -import node -import unittest -from termcolor import cprint - -setup.set_verbose(True) -setup.set_json(False) -setup.use_keosd(False) -#setup.set_command_line_mode(True) - -class Test1(unittest.TestCase): - - def run(self, result=None): - """ Stop after first error """ - if not result.failures: - super().run(result) - - - @classmethod - def setUpClass(cls): - global contractPath - # set this variable to the local path for the contracts folder - contractPath = "/Users/basar/Workspace/ore-protocol/contracts" - - testnet = node.reset() - assert(not testnet.error) - - wallet = eosf.Wallet() - assert(not wallet.error) - - global account_master - account_master = eosf.AccountMaster() - wallet.import_key(account_master) - assert(not account_master.error) - - usage_deploy = eosf.account(account_master, name="usagelog") - wallet.import_key(usage_deploy) - assert(not usage_deploy.error) - - contract_eosio_bios = eosf.Contract( - account_master, "eosio.bios").deploy() - assert(not contract_eosio_bios.error) - - global usagelog_ore - usagelog_ore = eosf.Contract(usage_deploy, contractPath+"/ore.usage_log") - assert(not usagelog_ore.error) - - - deployment = usagelog_ore.deploy() - assert(not deployment.error) - - - def setUp(self): - pass - - - def test_01(self): - - cprint(""" -USAGE LOG TESTS STARTED - """, 'yellow') - - cprint(""" -Action usagelog_ore.push_action("LOG CREATE") - """, 'magenta') - self.assertFalse(usagelog_ore.push_action( - "createlog", - '{"instrument_id": 0, "token_hash":"tokenhash", "timestamp":12345678 }').error) - cprint(""" -Action usagelog_ore.push_action("LOG CREATE") - """, 'magenta') - self.assertFalse(usagelog_ore.push_action( - "createlog", - '{"instrument_id": 1, "token_hash":"tokenhash", "timestamp":12345678 }').error) - cprint(""" -Action usagelog_ore.push_action("LOG CREATE") - """, 'magenta') - self.assertFalse(usagelog_ore.push_action( - "createlog", - '{"instrument_id": 2, "token_hash":"tokenhash", "timestamp":12345678 }').error) - cprint(""" -Action usagelog_ore.push_action("LOG CREATE") - """, 'magenta') - self.assertTrue(usagelog_ore.push_action( - "createlog", - '{"instrument_id": 2, "token_hash":"tokenhash", "timestamp":12345678 }').error) - - cprint(""" -Assign t1 = usagelog_ore.table("logs", "usagelog") - """, 'green') - t1 = usagelog_ore.table("logs", "usagelog") - - def test_02(self): - - cprint(""" -USAGE COUNT TESTS STARTED - """, 'yellow') - - cprint(""" -Action usagelog_ore.push_action("LOG CREATE") - """, 'magenta') - self.assertFalse(usagelog_ore.push_action( - "updatecount", - '{"instrument_id": 0, "right_name":"rightname", "cpu":"10.0000 CPU" }').error) - - time.sleep(1) - - cprint(""" -Action usagelog_ore.push_action("LOG CREATE") - """, 'magenta') - self.assertFalse(usagelog_ore.push_action( - "updatecount", - '{"instrument_id": 0, "right_name":"rightname", "cpu":"10.0000 CPU" }').error) - - time.sleep(1) - - cprint(""" -Action usagelog_ore.push_action("LOG CREATE") - """, 'magenta') - self.assertFalse(usagelog_ore.push_action( - "updatecount", - '{"instrument_id": 0, "right_name":"rightname", "cpu":"10.0000 CPU" }').error) - - time.sleep(1) - - cprint(""" -Assign t1 = usagelog_ore.table("counts", "usagelog") - """, 'green') - t1 = usagelog_ore.table("counts", "0") - - - def tearDown(self): - pass - - - @classmethod - def tearDownClass(cls): - pass - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file From 3e4aa30232ab641582208c9136165773d406a08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Mon, 10 Dec 2018 19:54:55 +0300 Subject: [PATCH 02/21] ci added --- tests/build_and_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/build_and_test.sh b/tests/build_and_test.sh index 11c3849..7a2e00a 100755 --- a/tests/build_and_test.sh +++ b/tests/build_and_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -cd ~/Workspace/testeosfactory/contracts +cd ~/ore-protocol/contracts cd ore.instrument && mkdir build From 71c231f9956a7678a17aa96917aecb4a4c872d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Mon, 10 Dec 2018 19:57:49 +0300 Subject: [PATCH 03/21] ci added --- tests/build_and_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/build_and_test.sh b/tests/build_and_test.sh index 7a2e00a..16ae1e4 100755 --- a/tests/build_and_test.sh +++ b/tests/build_and_test.sh @@ -19,7 +19,7 @@ cd ../ore.standard_token && mkdir build eosiocpp -g build/ore.standard_token.wast ore.standard_token.cpp eosiocpp -o build/ore.standard_token.abi ore.standard_token.cpp -cd ../tests +cd ../../tests python3 standard_token.py python3 rights_registry.py From 7612a7fd45a4c235cef77e5704e47aaa31f35e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Mon, 10 Dec 2018 20:02:42 +0300 Subject: [PATCH 04/21] ci added --- tests/instrument.py | 4 ++-- tests/rights_registry.py | 2 +- tests/standard_token.py | 2 +- tests/usage_log.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/instrument.py b/tests/instrument.py index 32f6e44..5a247a1 100644 --- a/tests/instrument.py +++ b/tests/instrument.py @@ -32,14 +32,14 @@ def setUp(self): def test_01(self): create_account("right", master, account_name="rights.ore") - right_contract = Contract(right, "ore.rights_registry") + right_contract = Contract(right, "/root/ore-protocol/contracts/ore.rights_registry") if(right_contract.is_deployed()): right_contract.delete() right_contract.build() right_contract.deploy() create_account("instr", master, account_name="instr.ore") - instr_contract = Contract(instr, "ore.instrument") + instr_contract = Contract(instr, "/root/ore-protocol/contracts/ore.instrument") if(instr_contract.is_deployed()): instr_contract.delete() instr_contract.build() diff --git a/tests/rights_registry.py b/tests/rights_registry.py index 10f7836..114f4a0 100644 --- a/tests/rights_registry.py +++ b/tests/rights_registry.py @@ -34,7 +34,7 @@ def test_01(self): ''') create_account("right", master) - right_contract = Contract(right, "ore.rights_registry") + right_contract = Contract(right, "/root/ore-protocol/contracts/ore.rights_registry") right_contract.build() right_contract.deploy() diff --git a/tests/standard_token.py b/tests/standard_token.py index eeeaea7..6ca6b6b 100644 --- a/tests/standard_token.py +++ b/tests/standard_token.py @@ -34,7 +34,7 @@ def test_01(self): Create, build and deploy the contracts: ''') create_account("token", master) - token_contract = Contract(token, "ore.standard_token") + token_contract = Contract(token, "/root/ore-protocol/contracts/ore.standard_token") token_contract.build() token_contract.deploy() diff --git a/tests/usage_log.py b/tests/usage_log.py index 7a800a9..35f0333 100644 --- a/tests/usage_log.py +++ b/tests/usage_log.py @@ -34,7 +34,7 @@ def test_01(self): ''') create_account("usage", master) - usage_contract = Contract(usage, "ore.usage_log") + usage_contract = Contract(usage, "/root/ore-protocol/contracts/ore.usage_log") usage_contract.build() usage_contract.deploy() From 6d4313736d252b6d7542a77b4e622e2449d693a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Mon, 10 Dec 2018 20:07:53 +0300 Subject: [PATCH 05/21] instrument update --- .circleci/config.yml | 5 ++++- tests/build_and_test.sh | 9 +-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0313a74..8c42475 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,10 @@ jobs: - run: name: run tests command: | - tests/build_and_test.sh + python3 tests/standard_token.py + python3 tests/rights_registry.py + python3 tests/instrument.py + python3 tests/usage_log.py - store_artifacts: path: test-reports diff --git a/tests/build_and_test.sh b/tests/build_and_test.sh index 16ae1e4..b736589 100755 --- a/tests/build_and_test.sh +++ b/tests/build_and_test.sh @@ -17,11 +17,4 @@ eosiocpp -o build/ore.usage_log.abi ore.usage_log.cpp cd ../ore.standard_token && mkdir build eosiocpp -g build/ore.standard_token.wast ore.standard_token.cpp -eosiocpp -o build/ore.standard_token.abi ore.standard_token.cpp - -cd ../../tests - -python3 standard_token.py -python3 rights_registry.py -python3 instrument.py -python3 usage_log.py \ No newline at end of file +eosiocpp -o build/ore.standard_token.abi ore.standard_token.cpp \ No newline at end of file From 76e65cfabce2314789ea2f33a566ce02b29a7a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Mon, 10 Dec 2018 20:12:49 +0300 Subject: [PATCH 06/21] instrument update --- contracts/ore.instrument/ore.instrument.cpp | 91 +++++++++++++-------- 1 file changed, 55 insertions(+), 36 deletions(-) diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp index 3c6b72a..8e4de6a 100644 --- a/contracts/ore.instrument/ore.instrument.cpp +++ b/contracts/ore.instrument/ore.instrument.cpp @@ -65,7 +65,7 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i transaction create_instrument{}; // create an unique id for the deferred transaction - uint64_t create_transaction_id = now(); + uint64_t create_transaction_id = instrumentId; // Adding createinst action to the deferred transaction to add the new instrument to the tokens table create_instrument.actions.emplace_back( @@ -79,7 +79,7 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i create_transaction_id)); // send deferred transaction - create_instrument.send(create_transaction_id, minter); + create_instrument.send(instrumentId, minter); } else { @@ -112,7 +112,7 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i end_time)); // send deferred transaction - deferred_instrument.send(deferred_trx_id, minter); + deferred_instrument.send(instrumentId, minter); } } @@ -163,6 +163,34 @@ void instrument::createinst(account_name minter, account_name owner, uint64_t in add_balance(owner, asset(10000, symbol_type(S(4, OREINST))), _self); } +void instrument::updateinst(account_name updater, account_name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) +{ + require_auth(_self); + auto accountitr = _account.find(owner); + + auto tokenitr = _tokens.find(instrumentId); + + // writing to tokens table + _tokens.modify(tokenitr, 0, [&](auto &a) { + a.id = instrumentId; + a.owner = owner; + a.minted_by = a.minted_by; + a.minted_at = time(0); + a.instrument = instrument; + a.revoked = false; + a.start_time = start_time; + a.end_time = end_time; + a.template_hash = hashStringToInt(instrument.instrument_template); + a.class_hash = hashStringToInt(instrument.instrument_class); + }); + + print("minter", name{updater}); + + print("action:update instrument:", instrumentId, " to:", name{owner}, "\n"); + + eosio_assert(is_account(owner), "to account does not exist"); +} + void instrument::checkright(account_name minter, account_name issuer, string rightname, uint64_t deferred_transaction_id = 0) { @@ -280,42 +308,33 @@ void instrument::update(account_name updater, string instrument_template, instru item.instrument.encrypted_by = instrument.encrypted_by; item.instrument.mutability = instrument.mutability; - // Checking if the issuer is the owner of the rights - for (int i = 0; i < instrument.rights.size(); i++) - { - auto rightitr = rights_contract.find_right_by_name(instrument.rights[i].right_name); - if (rightitr.owner == 0) - eosio_assert(false, "right doesn't exist"); - - if (rightitr.owner != instrument.issuer) - { - auto updaterOwnsRight = rightitr.owner == updater; + transaction deferred_instrument{}; - auto positionInWhitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), updater); - auto updaterWhitelistedForRight = positionInWhitelist != rightitr.issuer_whitelist.end(); + uint64_t deferred_trx_id = instrument_id; - //check if updater has to authorization over the rights - if (positionInWhitelist == rightitr.issuer_whitelist.end()) - { - eosio_assert((updaterOwnsRight), "updater doesn't own the right and is not on issuer's whitelist"); - } - } + for (int i = 0; i < item.instrument.rights.size(); i++) + { + deferred_instrument.actions.emplace_back( + permission_level{N(instr.ore), N(active)}, _self, N(checkright), + std::make_tuple( + updater, + instrument.issuer, + instrument.rights[i].right_name, + deferred_trx_id)); } - auto tokenitr = _tokens.find(item.id); - // update the instrument token in the tokens table - _tokens.modify(tokenitr, 0, [&](auto &a) { - a.id = item.id; - a.owner = item.owner; - a.minted_by = updater; - a.minted_at = time(0); - a.instrument = item.instrument; - a.revoked = false; - a.start_time = new_start; - a.end_time = new_end; - a.template_hash = hashStringToInt(instrument.instrument_template); - a.class_hash = hashStringToInt(instrument.instrument_class); - }); + // Adding createinst action to the deferred transaction to add the new instrument to the tokens table + deferred_instrument.actions.emplace_back( + permission_level{N(instr.ore), N(active)}, _self, N(updateinst), + std::make_tuple(updater, + item.owner, + instrument_id, + instrument, + start_time, + end_time)); + + // send deferred transaction + deferred_instrument.send(deferred_trx_id, updater); } print("updater", name{updater}); @@ -538,4 +557,4 @@ void instrument::add_balance(account_name owner, asset value, account_name ram_p } } -EOSIO_ABI(instrument, (transfer)(mint)(checkright)(createinst)(update)(revoke)(burn)(create)(issue)) +EOSIO_ABI(instrument, (transfer)(mint)(checkright)(createinst)(updateinst)(update)(revoke)(burn)(create)(issue)) From 14d7cbb0d0e623101a03bb60beb178e01f90e227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Mon, 10 Dec 2018 20:15:47 +0300 Subject: [PATCH 07/21] instrument update --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c42475..eb596de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ jobs: - run: name: run tests command: | + tests/build_and_test.sh python3 tests/standard_token.py python3 tests/rights_registry.py python3 tests/instrument.py From 24db720e1c8fcbe34e9147471b46ff14d919aae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Mon, 10 Dec 2018 20:19:57 +0300 Subject: [PATCH 08/21] instrument update --- contracts/ore.instrument/ore.instrument.cpp | 10 +++++----- contracts/ore.instrument/ore.instrument.hpp | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp index 8e4de6a..3b245d7 100644 --- a/contracts/ore.instrument/ore.instrument.cpp +++ b/contracts/ore.instrument/ore.instrument.cpp @@ -79,7 +79,7 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i create_transaction_id)); // send deferred transaction - create_instrument.send(instrumentId, minter); + create_instrument.send(create_transaction_id, minter); } else { @@ -87,7 +87,7 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i transaction deferred_instrument{}; // create an unique id for the deferred transaction - uint64_t deferred_trx_id = now(); + uint64_t deferred_trx_id = instrumentId; // checking if the issuer is the owner of the rights for (int i = 0; i < instrument.rights.size(); i++) @@ -112,7 +112,7 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i end_time)); // send deferred transaction - deferred_instrument.send(instrumentId, minter); + deferred_instrument.send(deferred_trx_id, minter); } } @@ -310,7 +310,7 @@ void instrument::update(account_name updater, string instrument_template, instru transaction deferred_instrument{}; - uint64_t deferred_trx_id = instrument_id; + uint64_t deferred_trx_id = item.id; for (int i = 0; i < item.instrument.rights.size(); i++) { @@ -334,7 +334,7 @@ void instrument::update(account_name updater, string instrument_template, instru end_time)); // send deferred transaction - deferred_instrument.send(deferred_trx_id, updater); + deferred_instrument.send(deferred_trx_id, _self); } print("updater", name{updater}); diff --git a/contracts/ore.instrument/ore.instrument.hpp b/contracts/ore.instrument/ore.instrument.hpp index 7108746..8b5f258 100644 --- a/contracts/ore.instrument/ore.instrument.hpp +++ b/contracts/ore.instrument/ore.instrument.hpp @@ -146,6 +146,7 @@ class instrument : public eosio::contract void burn(account_name burner, uint64_t token_id); void create(account_name issuer, asset maximum_supply); void createinst(account_name minter, account_name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); + void updateinst(account_name updater, account_name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); void issue(account_name to, asset quantity, string memo); }; From ab51f969ea1c7350734e77ecdd38d7441d95dbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 11 Dec 2018 03:31:38 +0300 Subject: [PATCH 09/21] eosio.cdt added --- contracts/ore.instrument/ore.instrument.cpp | 381 +- contracts/ore.instrument/ore.instrument.hpp | 131 +- .../ore.rights_registry.cpp | 35 +- .../ore.rights_registry.hpp | 34 +- .../ore.standard_token/ore.standard_token.abi | 191 - .../ore.standard_token/ore.standard_token.cpp | 120 +- .../ore.standard_token/ore.standard_token.hpp | 118 +- .../ore.standard_token.wasm | Bin 27593 -> 0 bytes .../ore.standard_token.wast | 17866 ---------------- contracts/ore.usage_log/ore.usage_log.cpp | 54 +- contracts/ore_types/ore_types.hpp | 4 +- tests/build_and_test.sh | 16 +- 12 files changed, 463 insertions(+), 18487 deletions(-) delete mode 100644 contracts/ore.standard_token/ore.standard_token.abi delete mode 100644 contracts/ore.standard_token/ore.standard_token.wasm delete mode 100644 contracts/ore.standard_token/ore.standard_token.wast diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp index 3b245d7..f0ecdc0 100644 --- a/contracts/ore.instrument/ore.instrument.cpp +++ b/contracts/ore.instrument/ore.instrument.cpp @@ -1,25 +1,35 @@ #include "ore.instrument.hpp" using namespace eosio; -// transaction id for deferred transaction -account_name RIGHTS_CONTRACT_NAME = N(rights.ore); - -// Creates new instrument -// NOTE: this should result in changes in the following tables : -// tokens - add new token -// account - instrument owner's list of owned instruments get updated -// accounts - OREINST symbol balance gets updated - -// mint action internally calls a deferred transaction with 2 types of actions: -// checkright - for each right in the instrument object, mint instrument calls check right within a deferred transaction -// createinst - once all the rights are checked, the last action in the deferred transaction is createinst which adds the instrument to the tokens table -// NOTE: if any of the checkright action fails, it will cancel the deferred transaction and the creatinst action will not be called. Hence no instrument will be created. -void instrument::mint(account_name minter, account_name owner, instrument_data instrument, +/* + Creates new instrument + NOTE: this should result in changes in the following tables : + tokens - add new token + account - instrument owner's list of owned instruments get updated + accounts - OREINST symbol balance gets updated + + mint action internally calls a deferred transaction with 2 types of actions: + checkright - for each right in the instrument object, mint instrument calls check right within a deferred transaction + createinst - once all the rights are checked, the last action in the deferred transaction is createinst which adds the instrument to the tokens table + NOTE: if any of the checkright action fails, it will cancel the deferred transaction and the creatinst action will not be called. Hence no instrument will be created. + + owner - owner of the new instrument + minter - account authorized to mint the instrument's rights + either the minter or the owner should own the right (or be whitelisted by the owner of the right) + */ +ACTION instrument::mint(name minter, name owner, instrument_data instrument, uint64_t start_time, uint64_t end_time, uint64_t instrumentId = 0) { // Checking if the minter has the required authorization require_auth(minter); - auto hashtable = _tokens.get_index(); + + string msg = "owner account does not exist " + owner.to_string(); + eosio_assert(is_account(owner), msg.c_str()); + + // if an instrument_template name is passed-in, look from an instrument with the same name on the chain + // ...if one exists, the new instrument will be a copy of that one + // All instruments with the same template name will have the same data - only the dates may be different + auto hashtable = _tokens.get_index<"templatehash"_n>(); auto item = hashtable.find(hashStringToInt(instrument.instrument_template)); if (instrument.rights.size() == 0) @@ -28,12 +38,12 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i } // If instrumentId value passed as 0, next available primate key will be automatically assigned as instrumentId - // This mean, you can not set instrumentId specifically to 0, because it means pick the next available key. + // So, instrumentId can't be set to 0 if (instrumentId == 0) { - if (_tokens.available_primary_key() == 0) + if (_tokens.available_primary_key() == 0) //first instrument created { - instrumentId = 1; // assigning the available key + instrumentId = 1; } else { @@ -47,7 +57,10 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i eosio_assert(institr == _tokens.end(), "instrumentId exists!"); } - // If an instrument already exists with the given template name, get the instrument data from the existing instrument + // ------- Copy an existing intstrument from a template + // If an instrument already exists with the given template name + // ... copy the instrument data from the existing instrument + // ... the owner of the new instrument is the same as existing instrument (you can't make a copy of someone else's template) if (instrument.instrument_template != "" && item != hashtable.end()) { instrument.issuer = item->instrument.issuer; @@ -65,45 +78,50 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i transaction create_instrument{}; // create an unique id for the deferred transaction - uint64_t create_transaction_id = instrumentId; + uint64_t transaction_id = instrumentId; // Adding createinst action to the deferred transaction to add the new instrument to the tokens table create_instrument.actions.emplace_back( - permission_level{N(instr.ore), N(active)}, _self, N(createinst), + permission_level{"instr.ore"_n, "active"_n}, "instr.ore"_n, "createinst"_n, std::make_tuple(minter, owner, instrumentId, instrument, start_time, end_time, - create_transaction_id)); + transaction_id)); // send deferred transaction - create_instrument.send(create_transaction_id, minter); + create_instrument.send(transaction_id, minter); } else { + // ------- Create a new intstrument // create a deferred transaction object to check rights and add instrument to the tokens table transaction deferred_instrument{}; // create an unique id for the deferred transaction - uint64_t deferred_trx_id = instrumentId; + // this deferred_transaction_id is different than the actual completed transaction Id + uint64_t deferred_transaction_id = instrumentId; + + // The creation of this instrument is a series of steps grouped into one deferred transaction - // checking if the issuer is the owner of the rights + // Step 1 - add one action for each right to check if the issuer is approved to issue an instrument with that right for (int i = 0; i < instrument.rights.size(); i++) { deferred_instrument.actions.emplace_back( - permission_level{N(instr.ore), N(active)}, _self, N(checkright), + permission_level{"instr.ore"_n, "active"_n}, _self, "checkright"_n, std::make_tuple( minter, instrument.issuer, instrument.rights[i].right_name, - deferred_trx_id)); + deferred_transaction_id)); } - // Adding createinst action to the deferred transaction to add the new instrument to the tokens table + // Step 2 - if all the prior actions are sucessful (did not cancel because a right was invalid) + // ... create the instrument as the last step in the transaction chain (using the createinst action) deferred_instrument.actions.emplace_back( - permission_level{N(instr.ore), N(active)}, _self, N(createinst), + permission_level{"instr.ore"_n, "active"_n}, _self, "createinst"_n, std::make_tuple(minter, owner, instrumentId, @@ -111,17 +129,23 @@ void instrument::mint(account_name minter, account_name owner, instrument_data i start_time, end_time)); - // send deferred transaction - deferred_instrument.send(deferred_trx_id, minter); + // Step 3 - send deferred transaction + deferred_instrument.send(deferred_transaction_id, minter); } } -void instrument::createinst(account_name minter, account_name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) +/* + createinst creates a row in the instruments table + This is called by the mint action - as the last step in the list of deferred transactions + This can only be called within the instrument contract (requires _self for instr.ore) +*/ +ACTION instrument::createinst(name minter, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) { require_auth(_self); - auto accountitr = _account.find(owner); + auto accountitr = _account.find(owner.value); - // check if account is already registered to accounts table + // We track every instrumentId a user owns in the accounts table - along with total count (balance) for each user + // The first time a user creates an instrument, create a record in the accounts table in this contract if (accountitr == _account.end()) { _account.emplace(_self, [&](auto &a) { @@ -129,15 +153,15 @@ void instrument::createinst(account_name minter, account_name owner, uint64_t in a.balance = 0; print("new instrument account: ", a.primary_key(), "\n"); }); - accountitr = _account.find(owner); + accountitr = _account.find(owner.value); } - // writing to tokens table + // all instruments are stored in the tokens table _tokens.emplace(_self, [&](auto &a) { a.id = instrumentId; a.owner = owner; a.minted_by = minter; - a.minted_at = time(0); + a.minted_at = now();; a.instrument = instrument; a.revoked = false; a.start_time = start_time; @@ -147,31 +171,33 @@ void instrument::createinst(account_name minter, account_name owner, uint64_t in }); // increasing the account balance (total token count) - _account.modify(accountitr, 0, [&](auto &a) { + _account.modify(accountitr, same_payer, [&](auto &a) { a.balance++; a.instruments.push_back(instrumentId); }); - print("minter", name{minter}); - - print("action:mint instrument:", instrumentId, " to:", name{owner}, "\n"); - - eosio_assert(is_account(owner), "to account does not exist"); + print("action:mint Created new instrument: type: " + instrument.instrument_class + " id: " + to_string(instrumentId) + " for: " + owner.to_string() + "\n"); // transfer 1 OREINST from the issuer account for OREINST to the owner account of instrument - sub_balance(_self, asset(10000, symbol_type(S(4, OREINST)))); - add_balance(owner, asset(10000, symbol_type(S(4, OREINST))), _self); + sub_balance(_self, asset(10000, symbol(symbol_code("OREINST"),4))); + add_balance(owner, asset(10000, symbol(symbol_code("OREINST"),4)), _self); } -void instrument::updateinst(account_name updater, account_name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) +/* + updateinst modifies a row in the instruments table + This is called by the update action - as the last step in the list of deferred transactions + This can only be called within the instrument contract (requires _self for instr.ore) +*/ + +ACTION instrument::updateinst(name updater, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) { require_auth(_self); - auto accountitr = _account.find(owner); + auto accountitr = _account.find(owner.value); auto tokenitr = _tokens.find(instrumentId); // writing to tokens table - _tokens.modify(tokenitr, 0, [&](auto &a) { + _tokens.modify(tokenitr, same_payer, [&](auto &a) { a.id = instrumentId; a.owner = owner; a.minted_by = a.minted_by; @@ -191,24 +217,31 @@ void instrument::updateinst(account_name updater, account_name owner, uint64_t i eosio_assert(is_account(owner), "to account does not exist"); } -void instrument::checkright(account_name minter, account_name issuer, string rightname, uint64_t deferred_transaction_id = 0) +/* + Checks that the issuer and owner are authorized to issue an instrument that includes this right (either the owner or in whitelist) + This is called by the mint action - as part of a deferred transaction during the minting process + This is called once for each right to be added to the instrument + This can only be called within the instrument contract (requires _self for instr.ore) +*/ +ACTION instrument::checkright(name minter, name issuer, string rightname, uint64_t deferred_transaction_id = 0) { - require_auth(_self); - //instantiating rights.ore contract - rights_registry rights_contract = rights_registry(RIGHTS_CONTRACT_NAME); + string msg; - print("action:checkright:", rightname, "\n"); + rights_registry rights_contract(_self,_code,_ds); + // check that right exists in the rights registry auto rightitr = rights_contract.find_right_by_name(rightname); - if (rightitr.owner == 0) + + if (rightitr.owner.value == 0) { if (deferred_transaction_id != 0) { - cancel_deferred(deferred_transaction_id); + cancel_deferred(deferred_transaction_id); } - eosio_assert(false, "right doesn't exist"); + msg = "right:" + rightname + " doesn't exist"; + eosio_assert(rightitr.owner.value != 0, msg.c_str()); } // check if the minter of the instrument is the issuer of the right @@ -216,31 +249,46 @@ void instrument::checkright(account_name minter, account_name issuer, string rig if (!minter_owns_right) { auto position_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), minter); - eosio_assert(position_in_whitelist != rightitr.issuer_whitelist.end(), "minter neither owns the right nor whitelisted for the right"); + + //if minter is not in whitelist, cancel the entire mint transaction + if (position_in_whitelist == rightitr.issuer_whitelist.end()) + { + if (deferred_transaction_id != 0) + { + cancel_deferred(deferred_transaction_id); + } + msg = "Attempt to create instrument with right: " + rightname + " by minter: " + minter.to_string() + " who isn't whitelisted or owner of right"; + eosio_assert(position_in_whitelist != rightitr.issuer_whitelist.end(), msg.c_str()); + } } + // check if the issuer of the instrument is the owner of the right bool issuer_owns_right = rightitr.owner == issuer; if (!issuer_owns_right) { auto issuer_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), issuer); + //if issuer is not in whitelist, cancel the entire mint transaction if (issuer_in_whitelist == rightitr.issuer_whitelist.end()) { if (deferred_transaction_id != 0) { cancel_deferred(deferred_transaction_id); } - eosio_assert(true, "instrument issuer neither holds the right nor whitelisted for the right"); + msg = "Attempt to create instrument with right: " + rightname + " by issuer: " + issuer.to_string() + " who isn't whitelisted or owner of right"; + eosio_assert(issuer_in_whitelist != rightitr.issuer_whitelist.end(), msg.c_str()); } } } -// updates an instrument -// NOTE: this should result in changes in the following table : -// tokens - the instrument token gets updated depending on the mutabiility -// if mutability is 1, start_time and/or end_time can be updated -// if mutability is 2, everything except the owner can be updated -void instrument::update(account_name updater, string instrument_template, instrument_data instrument = {}, +/* + updates an instrument (in the tokens table) + the instrument token gets updated depending on the mutabiility + mutability = 0 - completely immutable + mutability = 1 - start_time and/or end_time can be updated + mutability = 2 - everything mutable except the owner can't be updated +*/ +ACTION instrument::update(name updater, string instrument_template, instrument_data instrument = {}, uint64_t instrument_id = 0, uint64_t start_time = 0, uint64_t end_time = 0) { require_auth(updater); @@ -248,6 +296,8 @@ void instrument::update(account_name updater, string instrument_template, instru uint64_t new_end; instrument::token item; + + //find existing instrument by id or template if (instrument_id != 0) { item = find_token_by_id(instrument_id); @@ -263,7 +313,7 @@ void instrument::update(account_name updater, string instrument_template, instru eosio_assert(item.instrument.mutability == 1 || item.instrument.mutability == 2, "the instrument to be updated is immutable"); - rights_registry rights_contract = rights_registry(RIGHTS_CONTRACT_NAME); + rights_registry rights_contract = rights_registry(_self,_code,_ds); auto tokenitr = _tokens.find(item.id); @@ -287,15 +337,18 @@ void instrument::update(account_name updater, string instrument_template, instru new_end = item.end_time; } + // mutability = 1 - update dates if (item.instrument.mutability == 1) { // update the instrument token in the tokens table - _tokens.modify(tokenitr, 0, [&](auto &a) { + _tokens.modify(tokenitr, same_payer, [&](auto &a) { a.start_time = new_start; a.end_time = new_end; }); } - else + + // mutability = 2 - update anything + if (item.instrument.mutability == 2) { item.instrument.issuer = instrument.issuer; item.instrument.instrument_class = instrument.instrument_class; @@ -342,116 +395,112 @@ void instrument::update(account_name updater, string instrument_template, instru print("action:update instrument:", instrument_id, "\n"); } -// transfers an instrument -// NOTE: this should result in changes in the following tables : -// tokens - owner field of the token gets updated -// account - instrument owner's list of owned instruments get updated -// accounts - OREINST symbol balance gets updated -void instrument::transfer(account_name sender, account_name to, uint64_t token_id) +/* + transfers an instrument (owner field for the instrument gets updated to the new owner in the tokens table) + */ +ACTION instrument::transfer(name sender, name to, uint64_t instrument_id) { + require_auth(sender); + string msg; + //find token - auto tokenitr = _tokens.find(token_id); - - eosio_assert(tokenitr->owner == sender, "Sender account is not allowed to transfer the instrument"); - - eosio_assert(tokenitr->revoked == false, "token is revoked"); - - eosio_assert(tokenitr != _tokens.end(), "Token doesn't exists"); - - // NOTE: Use in future if required - // Allows an "allowed" account from the allowance table to be able to do transfer on the instrument owner's behalf - // bool is_approved_sender = false; - // if (tokenitr->owner != sender) - // { - // allowances _allowances(_self, tokenitr->owner); - // auto allowanceitr = _allowances.find(token_id); - // eosio_assert(allowanceitr->to == sender, "Sender is not allowed"); - // _allowances.erase(allowanceitr); - // is_approved_sender = true; - // } - // increment/decrement balances - // if (is_approved_sender) - // { - // transfer_balances(sender, tokenitr->owner, to, token_id); - // sub_balance_from(sender, tokenitr->owner, asset(10000, symbol_type(S(4, OREINST)))); - // add_balance(to, asset(10000, symbol_type(S(4, OREINST))), sender); - // } - // else - // { - // transfer_balances(sender, sender, to, token_id); - // sub_balance(sender, asset(10000, symbol_type(S(4, OREINST)))); - // add_balance(to, asset(10000, symbol_type(S(4, OREINST))), sender); - // } - - transfer_balances(sender, to, token_id); - sub_balance(sender, asset(10000, symbol_type(S(4, OREINST)))); - add_balance(to, asset(10000, symbol_type(S(4, OREINST))), sender); - _tokens.modify(tokenitr, 0, [&](auto &a) { + auto tokenitr = _tokens.find(instrument_id); + + msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; + eosio_assert(tokenitr != _tokens.end(), msg.c_str()); + + msg = "Sender account is not allowed to transfer the instrument " + sender.to_string(); + eosio_assert(tokenitr->owner == sender, msg.c_str()); + + msg = "Instrument Id " + to_string(instrument_id) + " has been previously revoked"; + eosio_assert(tokenitr->revoked == false, msg.c_str()); + + // transfer balance in the accounts table + transfer_balances(sender, to, instrument_id); + + // transfer OREINST balance + sub_balance(sender, asset(10000, symbol(symbol_code("OREINST"),4))); + add_balance(to, asset(10000, symbol(symbol_code("OREINST"),4)), sender); + _tokens.modify(tokenitr, same_payer, [&](auto &a) { a.owner = to; }); } -void instrument::revoke(account_name revoker, uint64_t token_id) +// revokes an instrument - A revoked instrument is no longer active and cannot be used +ACTION instrument::revoke(name revoker, uint64_t instrument_id) { require_auth(revoker); + string msg; + //Checking if the token exists. - auto tokenitr = _tokens.find(token_id); - eosio_assert(tokenitr != _tokens.end(), "Token doesn't exists"); + auto tokenitr = _tokens.find(instrument_id); + + msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; + eosio_assert(tokenitr != _tokens.end(), msg.c_str()); - eosio_assert(tokenitr->owner == revoker, "The revoker account doesn't have authority to revoke the instrument"); + msg = "The account " + revoker.to_string() + "doesn't have authority to revoke the instrument"; + eosio_assert(tokenitr->owner == revoker, msg.c_str()); - eosio_assert(tokenitr->revoked == false, "Token is already revoked"); + msg = "Instrument Id" + to_string(instrument_id) + "has been previously revoked"; + eosio_assert(tokenitr->revoked == false, msg.c_str()); - _tokens.modify(tokenitr, 0, [&](auto &t) { + _tokens.modify(tokenitr, same_payer, [&](auto &t) { t.revoked = true; }); } -// delets an instrument only if it's mutability is 2 -// NOTE: this should result in changes in the following tables : -// tokens - burnt token gets removed from the table -// account - instrument owner's list of owned instruments get updated -// accounts - OREINST symbol balance gets updated -void instrument::burn(account_name burner, uint64_t token_id) +/* + deletes an instrument (from the tokens table) + deletes only if it's mutability is 2 ( as mutability 2 means we can change anything) +*/ +ACTION instrument::burn(name burner, uint64_t instrument_id) { require_auth(burner); + + string msg; bool from = false; // Checking if the token exists. - auto tokenitr = _tokens.find(token_id); - eosio_assert(tokenitr != _tokens.end(), "Token doesn't exists"); + auto tokenitr = _tokens.find(instrument_id); + + msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; + eosio_assert(tokenitr != _tokens.end(), msg.c_str()); - eosio_assert(tokenitr->owner == burner, "The burner account doesn't have authority to delete the instrument"); + msg = "The account " + burner.to_string() + "doesn't have authority to burn the instrument"; + eosio_assert(tokenitr->owner == burner, msg.c_str()); - eosio_assert(tokenitr->instrument.mutability == 2, "Instrument is not mutable"); + msg = "Instrument Id" + to_string(instrument_id) + "is not mutable and cannot be burned."; + eosio_assert(tokenitr->instrument.mutability == 2, msg.c_str()); - transfer_balances(burner, 0, token_id); - sub_balance(burner, asset(10000, symbol_type(S(4, OREINST)))); + transfer_balances(burner, same_payer, instrument_id); + sub_balance(burner, asset(10000, symbol(symbol_code("OREINST"),4))); _tokens.erase(tokenitr); } -// -CUSTOM_CODE-it replicates the create function of ore.standard_token -// Creates a new currency OREINST -void instrument::create(account_name issuer, +/* + -CUSTOM_CODE- it replicates the create function of ore.standard_token + creates a new currency OREINST +*/ +ACTION instrument::create(name issuer, asset maximum_supply) { require_auth(_self); // Symbol is hardcoded here to prevent creating any other symbol than OREINST // auto sym = "maximum_supply.symbol"; - eosio::symbol_type sym = eosio::string_to_symbol(4, "OREINST"); + eosio::symbol sym = symbol(symbol_code("OREINST"),4); eosio_assert(maximum_supply.symbol == sym, "symbol name must be ORINST"); eosio_assert(sym.is_valid(), "invalid symbol name"); eosio_assert(maximum_supply.is_valid(), "invalid supply"); eosio_assert(maximum_supply.amount > 0, "max-supply must be positive"); - stats statstable(_self, sym.name()); - auto existing = statstable.find(sym.name()); + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); eosio_assert(existing == statstable.end(), "token with symbol already exists"); statstable.emplace(_self, [&](auto &s) { @@ -461,17 +510,18 @@ void instrument::create(account_name issuer, }); } -// -CUSTOM_CODE-it replicates the issue function of ore.standard_token except the inline transfer action present in ore.standard_token -// issue OREINST to an account -void instrument::issue(account_name to, asset quantity, string memo) +/* + -CUSTOM_CODE-it replicates the issue function of ore.standard_token except the inline transfer action present in ore.standard_token + issue OREINST to an account +*/ +ACTION instrument::issue(name to, asset quantity, string memo) { auto sym = quantity.symbol; eosio_assert(sym.is_valid(), "invalid symbol name"); eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); - auto sym_name = sym.name(); - stats statstable(_self, sym_name); - auto existing = statstable.find(sym_name); + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); eosio_assert(existing != statstable.end(), "token with symbol does not exist, create token before issue"); const auto &st = *existing; @@ -482,7 +532,7 @@ void instrument::issue(account_name to, asset quantity, string memo) eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); eosio_assert(quantity.amount <= st.max_supply.amount - st.supply.amount, "quantity exceeds available supply"); - statstable.modify(st, 0, [&](auto &s) { + statstable.modify(st, same_payer, [&](auto &s) { s.supply += quantity; }); @@ -495,12 +545,15 @@ void instrument::issue(account_name to, asset quantity, string memo) } } -// -CUSTOM_CODE-it replicates the sub_balance function of ore.standard_token -void instrument::sub_balance(account_name owner, asset value) +/* + -CUSTOM_CODE-it replicates the sub_balance function of ore.standard_token + removes OREINST from an account + */ +void instrument::sub_balance(name owner, asset value) { - accounts from_acnts(_self, owner); + accounts from_acnts(_self, owner.value); - const auto &from = from_acnts.get(value.symbol.name(), "no balance object found"); + const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); if (from.balance.amount == value.amount) @@ -515,34 +568,14 @@ void instrument::sub_balance(account_name owner, asset value) } } -// -CUSTOM_CODE-it replicates the sub_balance_from function of ore.standard_token -// NOTE: Uncomment and use in future if required -// It is used by transfer_from account to specify the RAM payer as the "sender" account and not the "owner" account as in the sub_balance function -// NOTE: used by instrument::approve action -// void instrument::sub_balance_from(account_name sender, account_name owner, asset value) -// { -// accounts from_acnts(_self, owner); - -// const auto &from = from_acnts.get(value.symbol.name(), "no balance object found"); -// eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); - -// if (from.balance.amount == value.amount) -// { -// from_acnts.erase(from); -// } -// else -// { -// from_acnts.modify(from, sender, [&](auto &a) { -// a.balance -= value; -// }); -// } -// } - -// -CUSTOM_CODE-it replicates the add_balance function of ore.standard_token -void instrument::add_balance(account_name owner, asset value, account_name ram_payer) +/* + -CUSTOM_CODE-it replicates the add_balance function of ore.standard_token + adds OREINST to an account +*/ +void instrument::add_balance(name owner, asset value, name ram_payer) { - accounts to_acnts(_self, owner); - auto to = to_acnts.find(value.symbol.name()); + accounts to_acnts(_self, owner.value); + auto to = to_acnts.find(value.symbol.code().raw()); if (to == to_acnts.end()) { to_acnts.emplace(ram_payer, [&](auto &a) { @@ -551,10 +584,10 @@ void instrument::add_balance(account_name owner, asset value, account_name ram_p } else { - to_acnts.modify(to, 0, [&](auto &a) { + to_acnts.modify(to, same_payer, [&](auto &a) { a.balance += value; }); } } -EOSIO_ABI(instrument, (transfer)(mint)(checkright)(createinst)(updateinst)(update)(revoke)(burn)(create)(issue)) +EOSIO_DISPATCH(instrument, (transfer)(mint)(checkright)(createinst)(update)(revoke)(burn)(create)(issue)) diff --git a/contracts/ore.instrument/ore.instrument.hpp b/contracts/ore.instrument/ore.instrument.hpp index 8b5f258..eb8c1ab 100644 --- a/contracts/ore.instrument/ore.instrument.hpp +++ b/contracts/ore.instrument/ore.instrument.hpp @@ -4,23 +4,24 @@ #include #include -#include -#include -#include +#include "eosiolib/eosio.hpp" +#include "eosiolib/asset.hpp" +#include "eosiolib/print.hpp" +#include "eosiolib/transaction.hpp" +#include "eosiolib/time.hpp" #include "../ore.rights_registry/ore.rights_registry.hpp" using namespace eosio; using namespace std; -class instrument : public eosio::contract +class [[eosio::contract("ore.instrument")]] instrument : public eosio::contract { public: - instrument(account_name self) - : contract(self), _account(_self, _self), _tokens(_self, _self) {} + instrument( name receiver, name code, datastream ds): contract(receiver, code, ds), _account(receiver, receiver.value), _tokens(receiver, receiver.value) {} struct instrument_data { - account_name issuer; + name issuer; string instrument_class; string description; string instrument_template; @@ -35,13 +36,12 @@ class instrument : public eosio::contract uint8_t mutability; // 0- immutable, 1- only datesi 2- all }; - //@abi table tokens i64 - struct token + TABLE token { //721 standard properties uint64_t id; - account_name owner; - account_name minted_by; + name owner; + name minted_by; uint64_t minted_at; //instrument properties @@ -54,82 +54,68 @@ class instrument : public eosio::contract uint64_t class_hash; uint64_t primary_key() const { return id; } - uint64_t by_owner() const { return owner; } + uint64_t by_owner() const { return owner.value; } uint64_t by_template() const { return template_hash; } uint64_t by_class() const { return class_hash; } EOSLIB_SERIALIZE(token, (id)(owner)(minted_by)(minted_at)(instrument)(revoked)(start_time)(end_time)(template_hash)(class_hash)) }; - eosio::multi_index>, - indexed_by>, - indexed_by>> - _tokens; + typedef eosio::multi_index<"tokens"_n, token, + indexed_by<"owner"_n, const_mem_fun>, + indexed_by<"templatehash"_n, const_mem_fun>, + indexed_by<"classhash"_n, const_mem_fun> + >tokenindex; - //@abi table account i64 - struct accountdata + tokenindex _tokens; + + TABLE accountdata { - account_name owner; + name owner; uint64_t balance; vector instruments; - uint64_t primary_key() const { return owner; } + uint64_t primary_key() const { return owner.value; } EOSLIB_SERIALIZE(accountdata, (owner)(balance)(instruments)) }; - eosio::multi_index _account; + typedef eosio::multi_index<"account"_n, accountdata> accountindex; - // NOTE: Uncomment and use in future if required - // Schema for allowance feature like in ERC-721 - //@abi table allowances i64 - // struct allowancedata - // { - // uint64_t token_id; - // account_name to; - - // uint64_t primary_key() const { return token_id; } - - // EOSLIB_SERIALIZE(allowancedata, (token_id)(to)) - // }; - - // typedef eosio::multi_index allowances; + accountindex _account; private: - //@abi table accounts i64 - struct account + TABLE accountbalance { asset balance; - uint64_t primary_key() const { return balance.symbol.name(); } + uint64_t primary_key() const { return balance.symbol.code().raw(); } }; - //@abi table stat i64 - struct currencystat + TABLE currencystat { asset supply; asset max_supply; - account_name issuer; + name issuer; - uint64_t primary_key() const { return supply.symbol.name(); } + uint64_t primary_key() const { return supply.symbol.code().raw(); } }; - typedef eosio::multi_index accounts; - typedef eosio::multi_index stats; + typedef eosio::multi_index<"accounts"_n, accountbalance> accounts; + typedef eosio::multi_index<"stat"_n, currencystat> stats; - void sub_balance(account_name owner, asset value); - void sub_balance_from(account_name sender, account_name owner, asset value); - void add_balance(account_name owner, asset value, account_name ram_payer); - void transfer_balances(account_name from, account_name to, uint64_t instrument_id, int64_t amount = 1); + void sub_balance(name owner, asset value); + void sub_balance_from(name sender, name owner, asset value); + void add_balance(name owner, asset value, name ram_payer); + void transfer_balances(name from, name to, uint64_t instrument_id, int64_t amount = 1); public: //public utility functions token find_token_by_id(uint64_t id); bool isToken(uint64_t id); token find_token_by_template(string instrument_template); - bool _owns(account_name claimant, uint64_t token_id); + bool _owns(name claimant, uint64_t token_id); uint64_t total_supply(); - uint64_t balance_of(account_name owner); - account_name owner_of(uint64_t token_id); + uint64_t balance_of(name owner); + name owner_of(uint64_t token_id); inline static uint64_t hashStringToInt(const string &strkey) { @@ -137,17 +123,16 @@ class instrument : public eosio::contract } //actions - void approve(account_name from, account_name to, uint64_t token_id); - void mint(account_name minter, account_name owner, instrument_data instrument, uint64_t start_time, uint64_t end_time, uint64_t instrumentId); - void checkright(account_name minter, account_name issuer, string rightname, uint64_t deferred_transaction_id); - void update(account_name updater, string instrument_template, instrument_data instrument, uint64_t instrument_id, uint64_t start_time, uint64_t end_time); - void transfer(account_name sender, account_name to, uint64_t token_id); - void revoke(account_name revoker, uint64_t token_id); - void burn(account_name burner, uint64_t token_id); - void create(account_name issuer, asset maximum_supply); - void createinst(account_name minter, account_name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); - void updateinst(account_name updater, account_name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); - void issue(account_name to, asset quantity, string memo); + ACTION approve(name from, name to, uint64_t token_id); + ACTION mint(name minter, name owner, instrument_data instrument, uint64_t start_time, uint64_t end_time, uint64_t instrumentId); + ACTION checkright(name minter, name issuer, string rightname, uint64_t deferred_transaction_id); + ACTION update(name updater, string instrument_template, instrument_data instrument, uint64_t instrument_id, uint64_t start_time, uint64_t end_time); + ACTION transfer(name sender, name to, uint64_t token_id); + ACTION revoke(name revoker, uint64_t token_id); + ACTION burn(name burner, uint64_t token_id); + ACTION create(name issuer, asset maximum_supply); + ACTION createinst(name minter, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); + ACTION issue(name to, asset quantity, string memo); }; instrument::token instrument::find_token_by_id(uint64_t id) @@ -182,7 +167,7 @@ bool instrument::isToken(uint64_t id) instrument::token instrument::find_token_by_template(string instrument_template) { - auto hashtable = _tokens.get_index(); + auto hashtable = _tokens.get_index<"templatehash"_n>(); auto item = hashtable.find(hashStringToInt(instrument_template)); if (item == hashtable.end()) eosio_assert(false, "instrument with given template not found"); @@ -199,14 +184,14 @@ instrument::token instrument::find_token_by_template(string instrument_template) } // Return an account's total balance -uint64_t instrument::balance_of(account_name owner) +uint64_t instrument::balance_of(name owner) { - auto account = _account.find(owner); + auto account = _account.find(owner.value); return account->balance; } // Returns who owns a token -account_name instrument::owner_of(uint64_t token_id) +name instrument::owner_of(uint64_t token_id) { auto token = _tokens.find(token_id); return token->owner; @@ -226,28 +211,28 @@ uint64_t instrument::total_supply() } // Check if account owns the token -bool instrument::_owns(account_name claimant, uint64_t token_id) +bool instrument::_owns(name claimant, uint64_t token_id) { return owner_of(token_id) == claimant; } -void instrument::transfer_balances(account_name from, account_name to, uint64_t instrument_id, int64_t amount) +void instrument::transfer_balances(name from, name to, uint64_t instrument_id, int64_t amount) { - auto fromitr = _account.find(from); + auto fromitr = _account.find(from.value); eosio_assert(fromitr != _account.end(), "Sender account doesn't exists"); eosio_assert(fromitr->balance > 0, "Sender account's balance is 0"); - _account.modify(fromitr, 0, [&](auto &a) { + _account.modify(fromitr, same_payer, [&](auto &a) { a.balance -= amount; a.instruments.erase(std::remove(a.instruments.begin(), a.instruments.end(), instrument_id), a.instruments.end()); }); - auto toitr = _account.find(to); + auto toitr = _account.find(to.value); if (toitr != _account.end()) { - _account.modify(toitr, 0, [&](auto &a) { + _account.modify(toitr, same_payer, [&](auto &a) { a.balance += amount; a.instruments.push_back(instrument_id); }); diff --git a/contracts/ore.rights_registry/ore.rights_registry.cpp b/contracts/ore.rights_registry/ore.rights_registry.cpp index 51e6bec..5d2c9d5 100644 --- a/contracts/ore.rights_registry/ore.rights_registry.cpp +++ b/contracts/ore.rights_registry/ore.rights_registry.cpp @@ -3,17 +3,15 @@ using namespace eosio; // transfer action -void rights_registry::upsertright(account_name owner, string &right_name, vector urls, vector issuer_whitelist) +ACTION rights_registry::upsertright(name owner, string &right_name, vector urls, vector issuer_whitelist) { require_auth(owner); - right_registration_index right_registration(_self, _self); + auto itr = _rights.find(hashStr(right_name)); - auto itr = right_registration.find(hashStr(right_name)); - - if (itr == right_registration.end()) + if (itr == _rights.end()) { - right_registration.emplace(owner, [&](auto &end) { + _rights.emplace(owner, [&](auto &end) { end.id = hashStr(right_name); end.right_name = right_name; end.owner = owner; @@ -21,30 +19,33 @@ void rights_registry::upsertright(account_name owner, string &right_name, vector end.issuer_whitelist = issuer_whitelist; }); - print("emplaces"); + print("action:upsertright Right: " + right_name + " added:" + " by: " + owner.to_string() + "\n"); + } else { - eosio_assert(itr->owner == owner, "You are not the issuer of the existing right name. Update canceled!"); - right_registration.modify(itr, owner, [&](auto &end) { + string msg = "The account " + owner.to_string() + " is not the owner of the right " + right_name + " and cannot modify it."; + eosio_assert(itr->owner == owner, msg.c_str()); + + _rights.modify(itr, owner, [&](auto &end) { end.urls = urls; end.issuer_whitelist = issuer_whitelist; }); - print("modified"); + + print("action:upsertright Right: " + right_name + " modified by: " + owner.to_string() + "\n"); } } -void rights_registry::deleteright(account_name owner, string &right_name) +ACTION rights_registry::deleteright(name owner, string &right_name) { require_auth(owner); - right_registration_index right_registration(_self, _self); + auto itr = _rights.find(hashStr(right_name)); - auto itr = right_registration.find(hashStr(right_name)); + string msg = "The right " + right_name + " doesn't exist "; - eosio_assert(itr != right_registration.end(), "There is no right with that name"); - - right_registration.erase(itr); + eosio_assert(itr != _rights.end(), msg.c_str()); + _rights.erase(itr); } -EOSIO_ABI(rights_registry, (upsertright)(deleteright)) +EOSIO_DISPATCH(rights_registry, (upsertright)(deleteright)) diff --git a/contracts/ore.rights_registry/ore.rights_registry.hpp b/contracts/ore.rights_registry/ore.rights_registry.hpp index 04e021f..602a962 100644 --- a/contracts/ore.rights_registry/ore.rights_registry.hpp +++ b/contracts/ore.rights_registry/ore.rights_registry.hpp @@ -3,37 +3,41 @@ * @copyright defined in eos/LICENSE.txt */ #pragma once +#include -#include +#include "eosiolib/eosio.hpp" #include "../ore_types/ore_types.hpp" + using namespace eosio; using namespace std; -class rights_registry : public contract +class [[eosio::contract("ore.rights_registry")]] rights_registry : public eosio::contract { public: - //@abi table rights i64 - struct right_reg + using contract::contract; + rights_registry( name receiver, name code, datastream ds): contract(receiver, code, ds), _rights(receiver, receiver.value){} + + TABLE right_reg { uint64_t id; string right_name; - account_name owner; + name owner; vector urls; - vector issuer_whitelist; + vector issuer_whitelist; uint64_t primary_key() const { return id; } EOSLIB_SERIALIZE(right_reg, (id)(right_name)(owner)(urls)(issuer_whitelist)) }; - typedef multi_index right_registration_index; - + typedef eosio::multi_index<"rights"_n, right_reg>right_registration_index; + public: - rights_registry(account_name self) - : contract(self) {} + right_registration_index _rights; - void upsertright(account_name owner, string &right_name, vector urls, vector issuer_whitelist); - void deleteright(account_name owner, string &right_name); + ACTION upsertright(name owner, string &right_name, vector urls, vector issuer_whitelist); + + ACTION deleteright(name owner, string &right_name); inline static uint64_t hashStr(const string &strkey) { @@ -42,11 +46,9 @@ class rights_registry : public contract right_reg find_right_by_name(string right_name) { - right_registration_index _endpoints(_self, _self); - - auto rightitr = _endpoints.find(hashStr(right_name)); + auto rightitr = _rights.find(hashStr(right_name)); - if (rightitr == _endpoints.end()) + if (rightitr == _rights.end()) { return right_reg{0}; } diff --git a/contracts/ore.standard_token/ore.standard_token.abi b/contracts/ore.standard_token/ore.standard_token.abi deleted file mode 100644 index 033b53c..0000000 --- a/contracts/ore.standard_token/ore.standard_token.abi +++ /dev/null @@ -1,191 +0,0 @@ -{ - "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-09-25T20:49:23", - "version": "eosio::abi/1.0", - "types": [], - "structs": [{ - "name": "account", - "base": "", - "fields": [{ - "name": "balance", - "type": "asset" - } - ] - },{ - "name": "currencystat", - "base": "", - "fields": [{ - "name": "supply", - "type": "asset" - },{ - "name": "max_supply", - "type": "asset" - },{ - "name": "issuer", - "type": "name" - } - ] - },{ - "name": "allowance", - "base": "", - "fields": [{ - "name": "to", - "type": "name" - },{ - "name": "quantity", - "type": "asset" - } - ] - },{ - "name": "create", - "base": "", - "fields": [{ - "name": "issuer", - "type": "name" - },{ - "name": "maximum_supply", - "type": "asset" - } - ] - },{ - "name": "issue", - "base": "", - "fields": [{ - "name": "to", - "type": "name" - },{ - "name": "quantity", - "type": "asset" - },{ - "name": "memo", - "type": "string" - } - ] - },{ - "name": "retire", - "base": "", - "fields": [{ - "name": "quantity", - "type": "asset" - },{ - "name": "memo", - "type": "string" - } - ] - },{ - "name": "transfer", - "base": "", - "fields": [{ - "name": "from", - "type": "name" - },{ - "name": "to", - "type": "name" - },{ - "name": "quantity", - "type": "asset" - },{ - "name": "memo", - "type": "string" - } - ] - },{ - "name": "approve", - "base": "", - "fields": [{ - "name": "from", - "type": "name" - },{ - "name": "to", - "type": "name" - },{ - "name": "quantity", - "type": "asset" - },{ - "name": "memo", - "type": "string" - } - ] - },{ - "name": "transferfrom", - "base": "", - "fields": [{ - "name": "sender", - "type": "name" - },{ - "name": "from", - "type": "name" - },{ - "name": "to", - "type": "name" - },{ - "name": "quantity", - "type": "asset" - },{ - "name": "memo", - "type": "string" - } - ] - } - ], - "actions": [{ - "name": "create", - "type": "create", - "ricardian_contract": "" - },{ - "name": "issue", - "type": "issue", - "ricardian_contract": "" - },{ - "name": "retire", - "type": "retire", - "ricardian_contract": "" - },{ - "name": "transfer", - "type": "transfer", - "ricardian_contract": "" - },{ - "name": "approve", - "type": "approve", - "ricardian_contract": "" - },{ - "name": "transferfrom", - "type": "transferfrom", - "ricardian_contract": "" - } - ], - "tables": [{ - "name": "accounts", - "index_type": "i64", - "key_names": [ - "balance" - ], - "key_types": [ - "asset" - ], - "type": "account" - },{ - "name": "stat", - "index_type": "i64", - "key_names": [ - "supply" - ], - "key_types": [ - "asset" - ], - "type": "currencystat" - },{ - "name": "allowances", - "index_type": "i64", - "key_names": [ - "to" - ], - "key_types": [ - "name" - ], - "type": "allowance" - } - ], - "ricardian_clauses": [], - "error_messages": [], - "abi_extensions": [] -} \ No newline at end of file diff --git a/contracts/ore.standard_token/ore.standard_token.cpp b/contracts/ore.standard_token/ore.standard_token.cpp index 7c11dcd..2d70bd6 100644 --- a/contracts/ore.standard_token/ore.standard_token.cpp +++ b/contracts/ore.standard_token/ore.standard_token.cpp @@ -13,12 +13,12 @@ * in the implementation of the same functions in ore.instrument contract. */ -#include +#include "ore.standard_token.hpp" namespace eosio { -void token::create(account_name issuer, +ACTION token::create(name issuer, asset maximum_supply) { require_auth(_self); @@ -28,8 +28,8 @@ void token::create(account_name issuer, eosio_assert(maximum_supply.is_valid(), "invalid supply"); eosio_assert(maximum_supply.amount > 0, "max-supply must be positive"); - stats statstable(_self, sym.name()); - auto existing = statstable.find(sym.name()); + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); eosio_assert(existing == statstable.end(), "token with symbol already exists"); statstable.emplace(_self, [&](auto &s) { @@ -40,27 +40,26 @@ void token::create(account_name issuer, } // The approve action is called by "from" account to authorize "to" account to call the transferfrom function on it's behalf -void token::approve(account_name from, account_name to, asset quantity, string memo) +ACTION token::approve(name from, name to, asset quantity, string memo) { require_auth(from); - accounts from_acnts(_self, from); + accounts from_acnts(_self, from.value); - const auto &from_account = from_acnts.get(quantity.symbol.name(), "no balance object found"); + const auto &from_account = from_acnts.get(quantity.symbol.code().raw(), "no balance object found"); eosio_assert(from_account.balance.amount >= quantity.amount, "amount being approved is more than the balance of the approver account"); set_allowance(from, to, quantity, true); } -void token::issue(account_name to, asset quantity, string memo) +ACTION token::issue(name to, asset quantity, string memo) { auto sym = quantity.symbol; eosio_assert(sym.is_valid(), "invalid symbol name"); eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); - auto sym_name = sym.name(); - stats statstable(_self, sym_name); - auto existing = statstable.find(sym_name); + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); eosio_assert(existing != statstable.end(), "token with symbol does not exist, create token before issue"); const auto &st = *existing; @@ -71,7 +70,7 @@ void token::issue(account_name to, asset quantity, string memo) eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); eosio_assert(quantity.amount <= st.max_supply.amount - st.supply.amount, "quantity exceeds available supply"); - statstable.modify(st, 0, [&](auto &s) { + statstable.modify(st, same_payer, [&](auto &s) { s.supply += quantity; }); @@ -79,19 +78,18 @@ void token::issue(account_name to, asset quantity, string memo) if (to != st.issuer) { - SEND_INLINE_ACTION(*this, transfer, {st.issuer, N(active)}, {st.issuer, to, quantity, memo}); + SEND_INLINE_ACTION(*this, transfer, {st.issuer, "active"_n}, {st.issuer, to, quantity, memo}); } } -void token::retire(asset quantity, string memo) +ACTION token::retire(asset quantity, string memo) { auto sym = quantity.symbol; eosio_assert(sym.is_valid(), "invalid symbol name"); eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); - auto sym_name = sym.name(); - stats statstable(_self, sym_name); - auto existing = statstable.find(sym_name); + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); eosio_assert(existing != statstable.end(), "token with symbol does not exist"); const auto &st = *existing; @@ -101,24 +99,24 @@ void token::retire(asset quantity, string memo) eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); - statstable.modify(st, 0, [&](auto &s) { + statstable.modify(st, same_payer, [&](auto &s) { s.supply -= quantity; }); sub_balance(st.issuer, quantity); } -void token::transfer(account_name from, - account_name to, +ACTION token::transfer(name from, + name to, asset quantity, string memo) { eosio_assert(from != to, "cannot transfer to self"); require_auth(from); eosio_assert(is_account(to), "to account does not exist"); - auto sym = quantity.symbol.name(); - stats statstable(_self, sym); - const auto &st = statstable.get(sym); + auto sym = quantity.symbol.code(); + stats statstable(_self, sym.raw()); + const auto &st = statstable.get(sym.raw()); require_recipient(from); require_recipient(to); @@ -128,12 +126,14 @@ void token::transfer(account_name from, eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); + auto payer = has_auth(to) ? to : from; + sub_balance(from, quantity); - add_balance(to, quantity, from); + add_balance(to, quantity, payer); } // This action is called by the approved "sender" account on behalf of the "from" account to transfer "quantity" to "to" account -void token::transferfrom(account_name sender, account_name from, account_name to, asset quantity, string memo) +ACTION token::transferfrom(name sender, name from, name to, asset quantity, string memo) { require_auth(sender); @@ -153,18 +153,13 @@ void token::transferfrom(account_name sender, account_name from, account_name to } // eosio.token standard sub_balance function -void token::sub_balance(account_name owner, asset value) +void token::sub_balance(name owner, asset value) { - accounts from_acnts(_self, owner); + accounts from_acnts(_self, owner.value); - const auto &from = from_acnts.get(value.symbol.name(), "no balance object found"); + const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); - if (from.balance.amount == value.amount) - { - from_acnts.erase(from); - } - else { from_acnts.modify(from, owner, [&](auto &a) { a.balance -= value; @@ -173,29 +168,22 @@ void token::sub_balance(account_name owner, asset value) } // It is used by transfer_from account to specify the RAM payer as the "sender" account and not the "owner" account as in the sub_balance function -void token::sub_balance_from(account_name sender, account_name owner, asset value) +void token::sub_balance_from(name sender, name owner, asset value) { - accounts from_acnts(_self, owner); + accounts from_acnts(_self, owner.value); - const auto &from = from_acnts.get(value.symbol.name(), "no balance object found"); + const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); - if (from.balance.amount == value.amount) - { - from_acnts.erase(from); - } - else - { - from_acnts.modify(from, sender, [&](auto &a) { - a.balance -= value; - }); - } + from_acnts.modify(from, sender, [&](auto &a) { + a.balance -= value; + }); } -void token::add_balance(account_name owner, asset value, account_name ram_payer) +void token::add_balance(name owner, asset value, name ram_payer) { - accounts to_acnts(_self, owner); - auto to = to_acnts.find(value.symbol.name()); + accounts to_acnts(_self, owner.value); + auto to = to_acnts.find(value.symbol.code().raw()); if (to == to_acnts.end()) { to_acnts.emplace(ram_payer, [&](auto &a) { @@ -204,12 +192,42 @@ void token::add_balance(account_name owner, asset value, account_name ram_payer) } else { - to_acnts.modify(to, 0, [&](auto &a) { + to_acnts.modify(to, same_payer, [&](auto &a) { a.balance += value; }); } } +ACTION token::open(name owner, const symbol &symbol, name ram_payer) +{ + require_auth(ram_payer); + + auto sym_code_raw = symbol.code().raw(); + + stats statstable(_self, sym_code_raw); + const auto &st = statstable.get(sym_code_raw, "symbol does not exist"); + eosio_assert(st.supply.symbol == symbol, "symbol precision mismatch"); + + accounts acnts(_self, owner.value); + auto it = acnts.find(sym_code_raw); + if (it == acnts.end()) + { + acnts.emplace(ram_payer, [&](auto &a) { + a.balance = asset{0, symbol}; + }); + } +} + +ACTION token::close(name owner, const symbol &symbol) +{ + require_auth(owner); + accounts acnts(_self, owner.value); + auto it = acnts.find(symbol.code().raw()); + eosio_assert(it != acnts.end(), "Balance row already deleted or never existed. Action won't have any effect."); + eosio_assert(it->balance.amount == 0, "Cannot close because the balance is not zero."); + acnts.erase(it); +} + } // namespace eosio -EOSIO_ABI(eosio::token, (create)(issue)(transfer)(approve)(transferfrom)(retire)) \ No newline at end of file +EOSIO_DISPATCH( eosio::token, (create)(issue)(transfer)(approve)(transferfrom)(open)(close)(retire)) \ No newline at end of file diff --git a/contracts/ore.standard_token/ore.standard_token.hpp b/contracts/ore.standard_token/ore.standard_token.hpp index 60faa08..2aa875f 100644 --- a/contracts/ore.standard_token/ore.standard_token.hpp +++ b/contracts/ore.standard_token/ore.standard_token.hpp @@ -4,8 +4,8 @@ */ #pragma once -#include -#include +#include "eosiolib/asset.hpp" +#include "eosiolib/eosio.hpp" #include @@ -19,111 +19,105 @@ namespace eosio using std::string; -class token : public contract +class[[eosio::contract("ore.standard_token")]] token : public contract { public: - token(account_name self) : contract(self) {} + using contract::contract; - void create(account_name issuer, - asset maximum_supply); + ACTION create(name issuer, asset maximum_supply); - void issue(account_name to, asset quantity, string memo); + ACTION issue(name to, asset quantity, string memo); - void retire(asset quantity, string memo); + ACTION retire(asset quantity, string memo); - void transfer(account_name from, - account_name to, - asset quantity, - string memo); + ACTION transfer(name from, name to, asset quantity, string memo); - void approve(account_name from, account_name to, asset quantity, string memo); + ACTION approve(name from, name to, asset quantity, string memo); - void transferfrom(account_name sender, account_name from, account_name to, asset quantity, string memo); + ACTION transferfrom(name sender, name from, name to, asset quantity, string memo); - inline asset get_supply(symbol_name sym) const; + ACTION open(name owner, const symbol &symbol, name ram_payer); - inline asset get_balance(account_name owner, symbol_name sym) const; + ACTION close(name owner, const symbol &symbol); - inline asset allowance_of(account_name from, account_name to); + static asset get_supply( name token_contract_account, symbol_code sym_code ) + { + stats statstable( token_contract_account, sym_code.raw() ); + const auto& st = statstable.get( sym_code.raw() ); + return st.supply; + } + + static asset get_balance( name token_contract_account, name owner, symbol_code sym_code ) + { + accounts accountstable( token_contract_account, owner.value ); + const auto& ac = accountstable.get( sym_code.raw() ); + return ac.balance; + } + + inline asset allowance_of(name from, name to); private: - inline void set_allowance(account_name from, account_name to, asset quantity, bool increment = false); + inline void set_allowance(name from, name to, asset quantity, bool increment = false); - //@abi table accounts i64 - struct account + TABLE account { asset balance; - uint64_t primary_key() const { return balance.symbol.name(); } + uint64_t primary_key() const { return balance.symbol.code().raw(); } }; - //@abi table stat i64 - struct currencystat + + TABLE currencystat { asset supply; asset max_supply; - account_name issuer; + name issuer; - uint64_t primary_key() const { return supply.symbol.name(); } + uint64_t primary_key() const { return supply.symbol.code().raw(); } }; - //@abi table allowances i64 - struct allowance + TABLE allowance { - account_name to; + name to; asset quantity; - uint64_t primary_key() const { return to; } + uint64_t primary_key() const { return to.value; } EOSLIB_SERIALIZE(allowance, (to)(quantity)) }; - typedef eosio::multi_index _allowances; - typedef eosio::multi_index accounts; - typedef eosio::multi_index stats; + typedef eosio::multi_index<"allowances"_n, allowance> _allowances; + typedef eosio::multi_index<"accounts"_n, account> accounts; + typedef eosio::multi_index<"stat"_n, currencystat> stats; - void sub_balance(account_name owner, asset value); - void sub_balance_from(account_name sender, account_name owner, asset value); - void add_balance(account_name owner, asset value, account_name ram_payer); + void sub_balance(name owner, asset value); + void sub_balance_from(name sender, name owner, asset value); + void add_balance(name owner, asset value, name ram_payer); public: struct transfer_args { - account_name from; - account_name to; + name from; + name to; asset quantity; string memo; }; }; -asset token::get_supply(symbol_name sym) const -{ - stats statstable(_self, sym); - const auto &st = statstable.get(sym); - return st.supply; -} - -asset token::get_balance(account_name owner, symbol_name sym) const -{ - accounts accountstable(_self, owner); - const auto &ac = accountstable.get(sym); - return ac.balance; -} - -void token::set_allowance(account_name from, account_name to, asset quantity, bool increment) +void token::set_allowance(name from, name to, asset quantity, bool increment) { - auto sym = quantity.symbol.name(); - stats statstable(_self, sym); - const auto &st = statstable.get(sym); + auto sym = quantity.symbol.code(); + stats statstable(_self, sym.raw()); + const auto &st = statstable.get(sym.raw()); eosio_assert(quantity.is_valid(), "invalid quantity"); eosio_assert(quantity.amount >= 0, "must transfer positive quantity"); eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); - account_name key = to; + name key = to; - _allowances allowances(_self, from); + _allowances allowances(_self, from.value); - auto allowanceitr = allowances.find(key); + auto allowanceitr = allowances.find(key.value); if (allowanceitr == allowances.end()) { @@ -134,7 +128,7 @@ void token::set_allowance(account_name from, account_name to, asset quantity, bo } else { - allowances.modify(allowanceitr, 0, [&](auto &a) { + allowances.modify(allowanceitr, same_payer, [&](auto &a) { if (!increment) a.quantity = quantity; else @@ -143,11 +137,11 @@ void token::set_allowance(account_name from, account_name to, asset quantity, bo } } -asset token::allowance_of(account_name from, account_name to) +asset token::allowance_of(name from, name to) { - _allowances allowances(_self, from); + _allowances allowances(_self, from.value); - auto allowanceitr = allowances.find(to); + auto allowanceitr = allowances.find(to.value); eosio_assert(allowanceitr != allowances.end(), "no allowance approved for this account"); diff --git a/contracts/ore.standard_token/ore.standard_token.wasm b/contracts/ore.standard_token/ore.standard_token.wasm deleted file mode 100644 index baf356cf76e3ae33e49188789523056d382227fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27593 zcmeI5e~cXGdEe*P?(FW|9)}VwpGhX39jo=pptQcS}l4DDng=vHBkiv_O!e2oazb>Q*RQG=*Up#idmMqlgoxwo#`jTDC}Sx9A@P znzkuWME!i9cV>3)ct^!QU^_tc<96nq_s8=-zu)J1X4jipIq!R(=l{09^F(;<>NStQ z*ZAAKcJ=C2T{O7RXT(E3JpS{qo(Qg9^-lQwAJ{YcUiGh?XzKIYHLf%XA3h^|J@NRT zuGYk#h{rtAg6>WWYXxSEs`Xgd8Vx8W_JY3^J`na7E;VLOE-nwehOX0@*}>f6!tqlx zgPG$ibHCE}wpsJ+#pUJx!r=IFf3`n&slV(s)jU=;59ZGIT~l)E2J6wLW0?=$VL?-gDW z|Kdk?J$kUWr}MjC@uw3n^D@84($5@DMz6bdd*K~PI;fE8wby@k_043Q2M>kzrsTEeVV`15(Ih>v!?Bq{t}bF^hF zpv~(wldM^wc67<40N~|~X|1MzK5=E572QAHXSzTRkOtb12C%(pJ8MjPpDxxsuG&Rw zzR2baZz}Mz_Vl#_;RGMvfiTP3hQ&NS5Vp9E4uq+&m&I8$y=wpb$rm2aqBH^>9_X;C zvR1l#GMKdM$BWynpzV$MLRBjPS2uhX6%~6?)`l`^aICmRTX8UbHgBarwKHQeV47l* zRu*dQR0@U;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&s9o19vdJMhD5S^0l7EMM~)l)2|=XQ3Z)B-u^?CwP<6yL_>v~ zA`k=tOK=yq%ik?LKE>I8RSu+VhX5Oyc=i4e!dEp^A z)FAmEK*BOvu)P79^%M}5_vc%&=VnNiResl& z29NOS1*P@_ciNCY$UKeW&w1aM@+SKVK+wP!kS5F#F$eq5|4#y9k?4DO?W={BY?eqw zC7MmGgkdo%RPj^jOSy&n9y>!z_X750MVvYZbBOlcDAU<`ZHL<$QX3w-;Tq?@{nO3D zyv!YM4!V8amx12Ugzn@eB!NOZ+NjmO8&hA1%(cDMYN`O`uENq5AA-;w??pE#X_16v zTOu4gOn=$8?}Bx40t;`47CK-`mAE^MGT}pkMH0Xrwx{G*_)p#Bn}m$TW$1-|fqcEG^vLDGDA8A!BNknB4@^U}iH;NmIQU%w8K&79Y7eAK%-*I!x5 z24`j#vi*N^YCpqn2g!T;%gc+)nSkOaA?l6sa5YRCYSvO=GO@6jmA}ML0+^j?;zB)%SL+Lj*^`vGc4&xMf5Wp89%pier7NW(-fK z`=?g2nM*Ts=Zuw{cr(>%JBjtPG$z{D+nY(~ddL{F)=qxfmUllfvg!J_+sWP$Qt>kx zCZ_K~uj`%UfvW39lHKei?-_kILbY3+YSJmM zdN7*)F8x(&HmC2j=6Di(n9u8c+FE>4PesjV@rSCImr;I9Jyd$P z$CK9Lf@xxg-WgAt_CrCMep_;=d_sT8^#>VIXFJnAavPPS4^~hbBlE9q zOCo+xN?`txmwd+kIE(#$3x5z5Bi5<@%G^r}&c4~~*uh!gr)B0e_AWbqra!Y}U1t~1 SFP-ZT`hZaWP*DGr_x}N9Y$!ee diff --git a/contracts/ore.standard_token/ore.standard_token.wast b/contracts/ore.standard_token/ore.standard_token.wast deleted file mode 100644 index 7edfda5..0000000 --- a/contracts/ore.standard_token/ore.standard_token.wast +++ /dev/null @@ -1,17866 +0,0 @@ -(module - (type $FUNCSIG$viji (func (param i32 i64 i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$vijjjii (func (param i32 i64 i64 i64 i32 i32))) - (type $FUNCSIG$vijjii (func (param i32 i64 i64 i32 i32))) - (type $FUNCSIG$vijii (func (param i32 i64 i32 i32))) - (type $FUNCSIG$v (func)) - (type $FUNCSIG$j (func (result i64))) - (type $FUNCSIG$vjj (func (param i64 i64))) - (type $FUNCSIG$vj (func (param i64))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$ijjjj (func (param i64 i64 i64 i64) (result i32))) - (type $FUNCSIG$ijjjjii (func (param i64 i64 i64 i64 i32 i32) (result i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$ij (func (param i64) (result i32))) - (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "abort" (func $abort)) - (import "env" "action_data_size" (func $action_data_size (result i32))) - (import "env" "current_receiver" (func $current_receiver (result i64))) - (import "env" "current_time" (func $current_time (result i64))) - (import "env" "db_find_i64" (func $db_find_i64 (param i64 i64 i64 i64) (result i32))) - (import "env" "db_get_i64" (func $db_get_i64 (param i32 i32 i32) (result i32))) - (import "env" "db_remove_i64" (func $db_remove_i64 (param i32))) - (import "env" "db_store_i64" (func $db_store_i64 (param i64 i64 i64 i64 i32 i32) (result i32))) - (import "env" "db_update_i64" (func $db_update_i64 (param i32 i64 i32 i32))) - (import "env" "eosio_assert" (func $eosio_assert (param i32 i32))) - (import "env" "is_account" (func $is_account (param i64) (result i32))) - (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) - (import "env" "printi" (func $printi (param i64))) - (import "env" "printn" (func $printn (param i64))) - (import "env" "prints" (func $prints (param i32))) - (import "env" "prints_l" (func $prints_l (param i32 i32))) - (import "env" "printui" (func $printui (param i64))) - (import "env" "read_action_data" (func $read_action_data (param i32 i32) (result i32))) - (import "env" "require_auth" (func $require_auth (param i64))) - (import "env" "require_auth2" (func $require_auth2 (param i64 i64))) - (import "env" "require_recipient" (func $require_recipient (param i64))) - (import "env" "send_inline" (func $send_inline (param i32 i32))) - (table 7 7 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $_ZN5eosio5token12transferfromEyyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE $_ZN5eosio5token6createEyNS_5assetE $_ZN5eosio5token6retireENS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE $_ZN5eosio5token8transferEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE $_ZN5eosio5token7approveEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE $_ZN5eosio5token5issueEyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE) - (memory $0 1) - (data (i32.const 4) "\f0h\00\00") - (data (i32.const 16) "invalid symbol name\00") - (data (i32.const 48) "invalid supply\00") - (data (i32.const 64) "max-supply must be positive\00") - (data (i32.const 96) "object passed to iterator_to is not in multi_index\00") - (data (i32.const 160) "token with symbol already exists\00") - (data (i32.const 208) "cannot create objects in table of another contract\00") - (data (i32.const 272) "write\00") - (data (i32.const 288) "magnitude of asset amount must be less than 2^62\00") - (data (i32.const 352) "error reading iterator\00") - (data (i32.const 384) "read\00") - (data (i32.const 400) "no balance object found\00") - (data (i32.const 432) "amount being approved is more than the balance of the approver account\00") - (data (i32.const 512) "unable to find key\00") - (data (i32.const 544) "invalid quantity\00") - (data (i32.const 576) "must transfer positive quantity\00") - (data (i32.const 608) "symbol precision mismatch\00") - (data (i32.const 640) "cannot pass end iterator to modify\00") - (data (i32.const 688) "object passed to modify is not in multi_index\00") - (data (i32.const 736) "cannot modify objects in table of another contract\00") - (data (i32.const 800) "attempt to add asset with different symbol\00") - (data (i32.const 848) "addition underflow\00") - (data (i32.const 880) "addition overflow\00") - (data (i32.const 912) "updater cannot change primary key when modifying an object\00") - (data (i32.const 976) "memo has more than 256 bytes\00") - (data (i32.const 1008) "token with symbol does not exist, create token before issue\00") - (data (i32.const 1072) "must issue positive quantity\00") - (data (i32.const 1104) "quantity exceeds available supply\00") - (data (i32.const 1152) "active\00") - (data (i32.const 1168) "token with symbol does not exist\00") - (data (i32.const 1216) "must retire positive quantity\00") - (data (i32.const 1248) "attempt to subtract asset with different symbol\00") - (data (i32.const 1296) "subtraction underflow\00") - (data (i32.const 1328) "subtraction overflow\00") - (data (i32.const 1360) "overdrawn balance\00") - (data (i32.const 1392) "object passed to erase is not in multi_index\00") - (data (i32.const 1440) "cannot erase objects in table of another contract\00") - (data (i32.const 1504) "attempt to remove object that was not in multi_index\00") - (data (i32.const 1568) "cannot transfer to self\00") - (data (i32.const 1600) "to account does not exist\00") - (data (i32.const 1632) "The approved account \00") - (data (i32.const 1664) " is transferring \00") - (data (i32.const 1696) " from \00") - (data (i32.const 1712) " to \00") - (data (i32.const 1728) "the amount being transferred is more than the approved amount\00") - (data (i32.const 1792) ".\00") - (data (i32.const 1808) " \00") - (data (i32.const 1824) ",\00") - (data (i32.const 1840) "no allowance approved for this account\00") - (data (i32.const 1888) "onerror\00") - (data (i32.const 1904) "eosio\00") - (data (i32.const 1920) "onerror action\'s are only valid from the \"eosio\" system account\00") - (data (i32.const 1984) "get\00") - (data (i32.const 10384) "malloc_from_freed was designed to only be called after _heap was completely allocated\00") - (export "memory" (memory $0)) - (export "_ZeqRK11checksum256S1_" (func $_ZeqRK11checksum256S1_)) - (export "_ZeqRK11checksum160S1_" (func $_ZeqRK11checksum160S1_)) - (export "_ZneRK11checksum160S1_" (func $_ZneRK11checksum160S1_)) - (export "now" (func $now)) - (export "_ZN5eosio12require_authERKNS_16permission_levelE" (func $_ZN5eosio12require_authERKNS_16permission_levelE)) - (export "_ZN5eosio5token6createEyNS_5assetE" (func $_ZN5eosio5token6createEyNS_5assetE)) - (export "_ZN5eosio5token7approveEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE" (func $_ZN5eosio5token7approveEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE)) - (export "_ZN5eosio5token5issueEyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE" (func $_ZN5eosio5token5issueEyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE)) - (export "_ZN5eosio5token11add_balanceEyNS_5assetEy" (func $_ZN5eosio5token11add_balanceEyNS_5assetEy)) - (export "_ZN5eosio5token6retireENS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE" (func $_ZN5eosio5token6retireENS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE)) - (export "_ZN5eosio5token11sub_balanceEyNS_5assetE" (func $_ZN5eosio5token11sub_balanceEyNS_5assetE)) - (export "_ZN5eosio5token8transferEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE" (func $_ZN5eosio5token8transferEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE)) - (export "_ZN5eosio5token12transferfromEyyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE" (func $_ZN5eosio5token12transferfromEyyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE)) - (export "_ZN5eosio5token16sub_balance_fromEyyNS_5assetE" (func $_ZN5eosio5token16sub_balance_fromEyyNS_5assetE)) - (export "apply" (func $apply)) - (export "malloc" (func $malloc)) - (export "free" (func $free)) - (export "memcmp" (func $memcmp)) - (func $_ZeqRK11checksum256S1_ (param $0 i32) (param $1 i32) (result i32) - (i32.eqz - (call $memcmp - (get_local $0) - (get_local $1) - (i32.const 32) - ) - ) - ) - (func $_ZeqRK11checksum160S1_ (param $0 i32) (param $1 i32) (result i32) - (i32.eqz - (call $memcmp - (get_local $0) - (get_local $1) - (i32.const 32) - ) - ) - ) - (func $_ZneRK11checksum160S1_ (param $0 i32) (param $1 i32) (result i32) - (i32.ne - (call $memcmp - (get_local $0) - (get_local $1) - (i32.const 32) - ) - (i32.const 0) - ) - ) - (func $now (result i32) - (i32.wrap/i64 - (i64.div_u - (call $current_time) - (i64.const 1000000) - ) - ) - ) - (func $_ZN5eosio12require_authERKNS_16permission_levelE (param $0 i32) - (call $require_auth2 - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (func $_ZN5eosio5token6createEyNS_5assetE (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i32) - (local $7 i64) - (local $8 i32) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 128) - ) - ) - ) - (call $require_auth - (i64.load - (get_local $0) - ) - ) - (set_local $8 - (i32.const 0) - ) - (set_local $7 - (tee_local $4 - (i64.shr_u - (tee_local $3 - (i64.load offset=8 - (get_local $2) - ) - ) - (i64.const 8) - ) - ) - ) - (block $label$0 - (block $label$1 - (loop $label$2 - (br_if $label$1 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $7) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $6 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $6 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 16) - ) - (set_local $6 - (i32.const 0) - ) - (block $label$5 - (br_if $label$5 - (i64.gt_u - (i64.add - (tee_local $5 - (i64.load - (get_local $2) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $8 - (i32.const 0) - ) - (set_local $7 - (get_local $4) - ) - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $7) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.ne - (i64.and - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$9 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$9 - (i32.lt_s - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $6 - (i32.const 1) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$5) - ) - ) - (set_local $6 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 48) - ) - (call $eosio_assert - (i64.gt_s - (get_local $5) - (i64.const 0) - ) - (i32.const 64) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i64.store offset=24 - (get_local $9) - (i64.const -1) - ) - (i64.store offset=32 - (get_local $9) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $9) - (tee_local $7 - (i64.load - (get_local $0) - ) - ) - ) - (i64.store offset=16 - (get_local $9) - (get_local $4) - ) - (block $label$10 - (block $label$11 - (br_if $label$11 - (i32.lt_s - (tee_local $8 - (call $db_find_i64 - (get_local $7) - (get_local $4) - (i64.const -4157508551318700032) - (get_local $4) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=40 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_5token12currencystatEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $9) - (i32.const 8) - ) - (get_local $8) - ) - ) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (i32.const 96) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$10) - ) - (set_local $8 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $8) - (i32.const 160) - ) - (set_local $4 - (i64.load - (get_local $0) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $9) - ) - (call $current_receiver) - ) - (i32.const 208) - ) - (drop - (call $_ZN5eosio5token12currencystatC2Ev - (tee_local $8 - (call $_Znwj - (i32.const 56) - ) - ) - ) - ) - (i32.store offset=40 - (get_local $8) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (i64.store offset=8 - (get_local $8) - (get_local $3) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 28) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 20) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (i32.store offset=16 - (get_local $8) - (i32.load - (get_local $2) - ) - ) - (i64.store offset=32 - (get_local $8) - (get_local $1) - ) - (i32.store offset=96 - (get_local $9) - (i32.add - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.const 40) - ) - ) - (i32.store offset=92 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (i32.store offset=88 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (i32.store offset=104 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 88) - ) - ) - (i32.store offset=116 - (get_local $9) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (i32.store offset=112 - (get_local $9) - (get_local $8) - ) - (i32.store offset=120 - (get_local $9) - (i32.add - (get_local $8) - (i32.const 32) - ) - ) - (call $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRKN5eosio5assetES8_RKyEEEZNS5_lsINS5_10datastreamIPcEENS5_5token12currencystatELPv0EEERT_SK_RKT0_EUlRKSJ_E_JLj0ELj1ELj2EEEEvSK_OSL_NSt3__116integer_sequenceIjJXspT1_EEEENSS_17integral_constantIbLb0EEE - (i32.add - (get_local $9) - (i32.const 112) - ) - (i32.add - (get_local $9) - (i32.const 104) - ) - ) - (i32.store offset=44 - (get_local $8) - (tee_local $6 - (call $db_store_i64 - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i64.const -4157508551318700032) - (get_local $4) - (tee_local $7 - (i64.shr_u - (i64.load offset=8 - (get_local $8) - ) - (i64.const 8) - ) - ) - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.const 40) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i64.lt_u - (get_local $7) - (i64.load - (tee_local $2 - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $2) - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - ) - (i32.store offset=112 - (get_local $9) - (get_local $8) - ) - (i64.store offset=48 - (get_local $9) - (tee_local $7 - (i64.shr_u - (i64.load - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=88 - (get_local $9) - (get_local $6) - ) - (block $label$13 - (block $label$14 - (br_if $label$14 - (i32.ge_u - (tee_local $2 - (i32.load - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 28) - ) - ) - ) - (i32.load - (i32.add - (get_local $9) - (i32.const 40) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $2) - (get_local $7) - ) - (i32.store offset=16 - (get_local $2) - (get_local $6) - ) - (i32.store offset=112 - (get_local $9) - (i32.const 0) - ) - (i32.store - (get_local $2) - (get_local $8) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 36) - ) - (i32.add - (get_local $2) - (i32.const 24) - ) - ) - (br $label$13) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy14289235522390851584ENS1_5token12currencystatEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $9) - (i32.const 32) - ) - (i32.add - (get_local $9) - (i32.const 112) - ) - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.add - (get_local $9) - (i32.const 88) - ) - ) - ) - (set_local $8 - (i32.load offset=112 - (get_local $9) - ) - ) - (i32.store offset=112 - (get_local $9) - (i32.const 0) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (get_local $8) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (tee_local $6 - (i32.load offset=32 - (get_local $9) - ) - ) - ) - ) - (block $label$17 - (block $label$18 - (br_if $label$18 - (i32.eq - (tee_local $8 - (i32.load - (tee_local $0 - (i32.add - (get_local $9) - (i32.const 36) - ) - ) - ) - ) - (get_local $6) - ) - ) - (loop $label$19 - (set_local $2 - (i32.load - (tee_local $8 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (block $label$20 - (br_if $label$20 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$19 - (i32.ne - (get_local $6) - (get_local $8) - ) - ) - ) - (set_local $8 - (i32.load - (i32.add - (get_local $9) - (i32.const 32) - ) - ) - ) - (br $label$17) - ) - (set_local $8 - (get_local $6) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 128) - ) - ) - ) - (func $_ZNK5eosio11multi_indexILy14289235522390851584ENS_5token12currencystatEJEE31load_object_by_primary_iteratorEl (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (set_local $8 - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $9) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - (tee_local $2 - (i32.load offset=24 - (get_local $0) - ) - ) - ) - ) - (set_local $3 - (i32.sub - (i32.const 0) - (get_local $2) - ) - ) - (set_local $6 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (loop $label$1 - (br_if $label$0 - (i32.eq - (i32.load - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (get_local $1) - ) - ) - (set_local $7 - (get_local $6) - ) - (set_local $6 - (tee_local $4 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $4) - (get_local $3) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $7) - (get_local $2) - ) - ) - (set_local $6 - (i32.load - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - (br $label$2) - ) - (call $eosio_assert - (i32.xor - (i32.shr_u - (tee_local $6 - (call $db_get_i64 - (get_local $1) - (i32.const 0) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.const 1) - ) - (i32.const 352) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.lt_u - (get_local $6) - (i32.const 513) - ) - ) - (set_local $4 - (call $malloc - (get_local $6) - ) - ) - (br $label$4) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $4 - (i32.sub - (get_local $9) - (i32.and - (i32.add - (get_local $6) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $db_get_i64 - (get_local $1) - (get_local $4) - (get_local $6) - ) - ) - (i32.store offset=12 - (get_local $8) - (get_local $4) - ) - (i32.store offset=8 - (get_local $8) - (get_local $4) - ) - (i32.store offset=16 - (get_local $8) - (i32.add - (get_local $4) - (get_local $6) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.lt_u - (get_local $6) - (i32.const 513) - ) - ) - (call $free - (get_local $4) - ) - ) - (drop - (call $_ZN5eosio5token12currencystatC2Ev - (tee_local $6 - (call $_Znwj - (i32.const 56) - ) - ) - ) - ) - (i32.store offset=40 - (get_local $6) - (get_local $0) - ) - (i32.store offset=24 - (get_local $8) - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - (i32.store offset=36 - (get_local $8) - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (i32.store offset=32 - (get_local $8) - (get_local $6) - ) - (i32.store offset=40 - (get_local $8) - (i32.add - (get_local $6) - (i32.const 32) - ) - ) - (call $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRN5eosio5assetES7_RyEEEZNS5_rsINS5_10datastreamIPKcEENS5_5token12currencystatELPv0EEERT_SJ_RT0_EUlSJ_E_JLj0ELj1ELj2EEEEvSJ_OSK_NSt3__116integer_sequenceIjJXspT1_EEEENSO_17integral_constantIbLb0EEE - (i32.add - (get_local $8) - (i32.const 32) - ) - (i32.add - (get_local $8) - (i32.const 24) - ) - ) - (i32.store offset=44 - (get_local $6) - (get_local $1) - ) - (i32.store offset=24 - (get_local $8) - (get_local $6) - ) - (i64.store offset=32 - (get_local $8) - (tee_local $5 - (i64.shr_u - (i64.load offset=8 - (get_local $6) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=4 - (get_local $8) - (tee_local $7 - (i32.load offset=44 - (get_local $6) - ) - ) - ) - (block $label$7 - (block $label$8 - (br_if $label$8 - (i32.ge_u - (tee_local $4 - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $4) - (get_local $5) - ) - (i32.store offset=16 - (get_local $4) - (get_local $7) - ) - (i32.store offset=24 - (get_local $8) - (i32.const 0) - ) - (i32.store - (get_local $4) - (get_local $6) - ) - (i32.store - (get_local $1) - (i32.add - (get_local $4) - (i32.const 24) - ) - ) - (br $label$7) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy14289235522390851584ENS1_5token12currencystatEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 32) - ) - (i32.add - (get_local $8) - (i32.const 4) - ) - ) - ) - (set_local $4 - (i32.load offset=24 - (get_local $8) - ) - ) - (i32.store offset=24 - (get_local $8) - (i32.const 0) - ) - (br_if $label$2 - (i32.eqz - (get_local $4) - ) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 48) - ) - ) - (get_local $6) - ) - (func $_ZN5eosio5token12currencystatC2Ev (param $0 i32) (result i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (i64.store offset=8 - (get_local $0) - (i64.const 1398362884) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $1 - (i64.shr_u - (i64.load offset=8 - (get_local $0) - ) - (i64.const 8) - ) - ) - (set_local $2 - (i32.const 0) - ) - (block $label$0 - (block $label$1 - (loop $label$2 - (br_if $label$1 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $1) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $3 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $3 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $3) - (i32.const 16) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 1398362884) - ) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $1 - (i64.shr_u - (i64.load - (get_local $2) - ) - (i64.const 8) - ) - ) - (set_local $2 - (i32.const 0) - ) - (block $label$5 - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $1) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.ne - (i64.and - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$9 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$9 - (i32.lt_s - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $3 - (i32.const 1) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$5) - ) - ) - (set_local $3 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $3) - (i32.const 16) - ) - (get_local $0) - ) - (func $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRKN5eosio5assetES8_RKyEEEZNS5_lsINS5_10datastreamIPcEENS5_5token12currencystatELPv0EEERT_SK_RKT0_EUlRKSJ_E_JLj0ELj1ELj2EEEEvSK_OSL_NSt3__116integer_sequenceIjJXspT1_EEEENSS_17integral_constantIbLb0EEE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (set_local $3 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (tee_local $2 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $2) - ) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $2) - ) - (get_local $3) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $4 - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $2) - ) - (get_local $4) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $2) - ) - (i32.add - (get_local $3) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (set_local $3 - (i32.load offset=4 - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (tee_local $2 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $2) - ) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $2) - ) - (get_local $3) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $4 - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $2) - ) - (get_local $4) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $2) - ) - (i32.add - (get_local $3) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (set_local $0 - (i32.load offset=8 - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (tee_local $2 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $2) - ) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $2) - ) - (get_local $0) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy14289235522390851584ENS1_5token12currencystatEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $5 - (i32.add - (tee_local $4 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $0) - ) - (tee_local $6 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 24) - ) - ) - (i32.const 1) - ) - ) - (i32.const 178956971) - ) - ) - (set_local $7 - (i32.const 178956970) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $6 - (i32.div_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $6) - ) - (i32.const 24) - ) - ) - (i32.const 89478484) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $7 - (select - (get_local $5) - (tee_local $7 - (i32.shl - (get_local $6) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $5) - ) - ) - ) - ) - ) - ) - (set_local $6 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 24) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $6 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $5 - (i32.load - (get_local $1) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i32.store - (tee_local $1 - (i32.add - (get_local $6) - (i32.mul - (get_local $4) - (i32.const 24) - ) - ) - ) - (get_local $5) - ) - (i64.store offset=8 - (get_local $1) - (i64.load - (get_local $2) - ) - ) - (i32.store offset=16 - (get_local $1) - (i32.load - (get_local $3) - ) - ) - (set_local $4 - (i32.add - (get_local $6) - (i32.mul - (get_local $7) - (i32.const 24) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $6 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.load - (get_local $0) - ) - ) - ) - ) - (loop $label$6 - (set_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -24) - ) - (get_local $3) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -8) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -12) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -12) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -16) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -16) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const -24) - ) - ) - (set_local $6 - (get_local $2) - ) - (br_if $label$6 - (i32.ne - (get_local $7) - (get_local $2) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $6 - (i32.load - (get_local $0) - ) - ) - (br $label$4) - ) - (set_local $6 - (get_local $7) - ) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $5) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $4) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $7) - (get_local $6) - ) - ) - (loop $label$8 - (set_local $1 - (i32.load - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (br_if $label$8 - (i32.ne - (get_local $6) - (get_local $7) - ) - ) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (get_local $6) - ) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - ) - (func $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRN5eosio5assetES7_RyEEEZNS5_rsINS5_10datastreamIPKcEENS5_5token12currencystatELPv0EEERT_SJ_RT0_EUlSJ_E_JLj0ELj1ELj2EEEEvSJ_OSK_NSt3__116integer_sequenceIjJXspT1_EEEENSO_17integral_constantIbLb0EEE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (set_local $3 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $2 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $2) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $3) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $4 - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $2) - ) - (get_local $4) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (set_local $3 - (i32.load offset=4 - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $2 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $2) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $3) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $4 - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $2) - ) - (get_local $4) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (set_local $0 - (i32.load offset=8 - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $2 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $2) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $0) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - ) - (func $_ZN5eosio5token7approveEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE (type $FUNCSIG$vijjii) (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i32) (param $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 80) - ) - ) - ) - (call $require_auth - (get_local $1) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 72) - ) - (i32.const 0) - ) - (i64.store offset=48 - (get_local $8) - (get_local $1) - ) - (i64.store offset=56 - (get_local $8) - (i64.const -1) - ) - (i64.store offset=64 - (get_local $8) - (i64.const 0) - ) - (i64.store offset=40 - (get_local $8) - (i64.load - (get_local $0) - ) - ) - (call $eosio_assert - (i64.ge_s - (i64.load - (call $_ZNK5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE3getEyPKc - (i32.add - (get_local $8) - (i32.const 40) - ) - (i64.shr_u - (i64.load offset=8 - (get_local $3) - ) - (i64.const 8) - ) - (i32.const 400) - ) - ) - (i64.load - (get_local $3) - ) - ) - (i32.const 432) - ) - (i64.store - (tee_local $5 - (i32.add - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i64.load offset=8 - (get_local $3) - ) - ) - (set_local $6 - (i64.load - (get_local $3) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.load - (get_local $5) - ) - ) - (i64.store offset=24 - (get_local $8) - (get_local $6) - ) - (i32.store offset=12 - (get_local $8) - (i32.load offset=28 - (get_local $8) - ) - ) - (i32.store offset=8 - (get_local $8) - (i32.load offset=24 - (get_local $8) - ) - ) - (call $_ZN5eosio5token13set_allowanceEyyNS_5assetEb - (get_local $0) - (get_local $1) - (get_local $2) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 1) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $5 - (i32.load offset=64 - (get_local $8) - ) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.eq - (tee_local $3 - (i32.load - (tee_local $7 - (i32.add - (get_local $8) - (i32.const 68) - ) - ) - ) - ) - (get_local $5) - ) - ) - (loop $label$3 - (set_local $0 - (i32.load - (tee_local $3 - (i32.add - (get_local $3) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $3) - (i32.const 0) - ) - (block $label$4 - (br_if $label$4 - (i32.eqz - (get_local $0) - ) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (br_if $label$3 - (i32.ne - (get_local $5) - (get_local $3) - ) - ) - ) - (set_local $3 - (i32.load - (i32.add - (get_local $8) - (i32.const 64) - ) - ) - ) - (br $label$1) - ) - (set_local $3 - (get_local $5) - ) - ) - (i32.store - (get_local $7) - (get_local $5) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 80) - ) - ) - ) - (func $_ZNK5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE3getEyPKc (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - (tee_local $3 - (i32.load offset=24 - (get_local $0) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (set_local $4 - (i32.sub - (i32.const 0) - (get_local $3) - ) - ) - (loop $label$1 - (br_if $label$0 - (i64.eq - (i64.shr_u - (i64.load offset=8 - (i32.load - (get_local $6) - ) - ) - (i64.const 8) - ) - (get_local $1) - ) - ) - (set_local $7 - (get_local $6) - ) - (set_local $6 - (tee_local $5 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $5) - (get_local $4) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $7) - (get_local $3) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (tee_local $6 - (i32.load - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (get_local $0) - ) - (i32.const 96) - ) - (br $label$2) - ) - (set_local $6 - (i32.const 0) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $5 - (call $db_find_i64 - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - (i64.const 3607749779137757184) - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (tee_local $6 - (call $_ZNK5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE31load_object_by_primary_iteratorEl - (get_local $0) - (get_local $5) - ) - ) - ) - (get_local $0) - ) - (i32.const 96) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $6) - (i32.const 0) - ) - (get_local $2) - ) - (get_local $6) - ) - (func $_ZN5eosio5token13set_allowanceEyyNS_5assetEb (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i32) (param $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i64) - (local $8 i32) - (local $9 i64) - (local $10 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $10 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (i64.store offset=104 - (get_local $10) - (get_local $2) - ) - (i32.store8 offset=103 - (get_local $10) - (get_local $4) - ) - (set_local $5 - (i64.load offset=8 - (get_local $3) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 56) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i64.store offset=64 - (get_local $10) - (tee_local $9 - (i64.shr_u - (get_local $5) - (i64.const 8) - ) - ) - ) - (i64.store offset=72 - (get_local $10) - (i64.const -1) - ) - (i64.store offset=80 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=56 - (get_local $10) - (i64.load - (get_local $0) - ) - ) - (set_local $6 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_5token12currencystatEJEE3getEyPKc - (i32.add - (get_local $10) - (i32.const 56) - ) - (get_local $9) - (i32.const 512) - ) - ) - (set_local $8 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (tee_local $7 - (i64.load - (get_local $3) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$1 - (loop $label$2 - (br_if $label$1 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $9) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $9 - (i64.shr_u - (get_local $9) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $9 - (i64.shr_u - (get_local $9) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $8 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $8 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $8) - (i32.const 544) - ) - (call $eosio_assert - (i32.xor - (i32.wrap/i64 - (i64.shr_u - (get_local $7) - (i64.const 63) - ) - ) - (i32.const 1) - ) - (i32.const 576) - ) - (call $eosio_assert - (i64.eq - (get_local $5) - (i64.load offset=8 - (get_local $6) - ) - ) - (i32.const 608) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 16) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i64.store offset=32 - (get_local $10) - (i64.const -1) - ) - (i64.store offset=40 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $10) - (tee_local $9 - (i64.load - (get_local $0) - ) - ) - ) - (i64.store offset=24 - (get_local $10) - (get_local $1) - ) - (block $label$5 - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.lt_s - (tee_local $4 - (call $db_find_i64 - (get_local $9) - (get_local $1) - (i64.const 3774946787993190400) - (get_local $2) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=24 - (tee_local $4 - (call $_ZNK5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $10) - (i32.const 16) - ) - (get_local $4) - ) - ) - ) - (i32.add - (get_local $10) - (i32.const 16) - ) - ) - (i32.const 96) - ) - (i32.store offset=12 - (get_local $10) - (get_local $3) - ) - (i32.store offset=8 - (get_local $10) - (i32.add - (get_local $10) - (i32.const 103) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 640) - ) - (call $_ZN5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE6modifyIZNS1_13set_allowanceEyyNS_5assetEbEUlRT_E0_EEvRKS2_yOS6_ - (i32.add - (get_local $10) - (i32.const 16) - ) - (get_local $4) - (i64.const 0) - (i32.add - (get_local $10) - (i32.const 8) - ) - ) - (br_if $label$6 - (tee_local $3 - (i32.load offset=40 - (get_local $10) - ) - ) - ) - (br $label$5) - ) - (i32.store offset=12 - (get_local $10) - (get_local $3) - ) - (i32.store offset=8 - (get_local $10) - (i32.add - (get_local $10) - (i32.const 104) - ) - ) - (call $_ZN5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE7emplaceIZNS1_13set_allowanceEyyNS_5assetEbEUlRT_E_EENS3_14const_iteratorEyOS6_ - (get_local $10) - (i32.add - (get_local $10) - (i32.const 16) - ) - (get_local $1) - (i32.add - (get_local $10) - (i32.const 8) - ) - ) - (br_if $label$5 - (i32.eqz - (tee_local $3 - (i32.load offset=40 - (get_local $10) - ) - ) - ) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eq - (tee_local $4 - (i32.load - (tee_local $0 - (i32.add - (get_local $10) - (i32.const 44) - ) - ) - ) - ) - (get_local $3) - ) - ) - (loop $label$10 - (set_local $8 - (i32.load - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $8) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$10 - (i32.ne - (get_local $3) - (get_local $4) - ) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $10) - (i32.const 40) - ) - ) - ) - (br $label$8) - ) - (set_local $4 - (get_local $3) - ) - ) - (i32.store - (get_local $0) - (get_local $3) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $3 - (i32.load offset=80 - (get_local $10) - ) - ) - ) - ) - (block $label$13 - (block $label$14 - (br_if $label$14 - (i32.eq - (tee_local $4 - (i32.load - (tee_local $0 - (i32.add - (get_local $10) - (i32.const 84) - ) - ) - ) - ) - (get_local $3) - ) - ) - (loop $label$15 - (set_local $8 - (i32.load - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (get_local $8) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$15 - (i32.ne - (get_local $3) - (get_local $4) - ) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $10) - (i32.const 80) - ) - ) - ) - (br $label$13) - ) - (set_local $4 - (get_local $3) - ) - ) - (i32.store - (get_local $0) - (get_local $3) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 112) - ) - ) - ) - (func $_ZNK5eosio11multi_indexILy14289235522390851584ENS_5token12currencystatEJEE3getEyPKc (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - (tee_local $3 - (i32.load offset=24 - (get_local $0) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (set_local $4 - (i32.sub - (i32.const 0) - (get_local $3) - ) - ) - (loop $label$1 - (br_if $label$0 - (i64.eq - (i64.shr_u - (i64.load offset=8 - (i32.load - (get_local $6) - ) - ) - (i64.const 8) - ) - (get_local $1) - ) - ) - (set_local $7 - (get_local $6) - ) - (set_local $6 - (tee_local $5 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $5) - (get_local $4) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $7) - (get_local $3) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=40 - (tee_local $6 - (i32.load - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (get_local $0) - ) - (i32.const 96) - ) - (br $label$2) - ) - (set_local $6 - (i32.const 0) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $5 - (call $db_find_i64 - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - (i64.const -4157508551318700032) - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=40 - (tee_local $6 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_5token12currencystatEJEE31load_object_by_primary_iteratorEl - (get_local $0) - (get_local $5) - ) - ) - ) - (get_local $0) - ) - (i32.const 96) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $6) - (i32.const 0) - ) - (get_local $2) - ) - (get_local $6) - ) - (func $_ZNK5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE31load_object_by_primary_iteratorEl (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 i32) - (local $11 i32) - (set_local $10 - (tee_local $11 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $11) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $8 - (i32.load - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - (tee_local $3 - (i32.load offset=24 - (get_local $0) - ) - ) - ) - ) - (set_local $4 - (i32.sub - (i32.const 0) - (get_local $3) - ) - ) - (set_local $7 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - (loop $label$1 - (br_if $label$0 - (i32.eq - (i32.load - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $1) - ) - ) - (set_local $8 - (get_local $7) - ) - (set_local $7 - (tee_local $5 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $5) - (get_local $4) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $8) - (get_local $3) - ) - ) - (set_local $5 - (i32.load - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - ) - (br $label$2) - ) - (call $eosio_assert - (i32.xor - (i32.shr_u - (tee_local $8 - (call $db_get_i64 - (get_local $1) - (i32.const 0) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.const 1) - ) - (i32.const 352) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.le_u - (get_local $8) - (i32.const 512) - ) - ) - (drop - (call $db_get_i64 - (get_local $1) - (tee_local $3 - (call $malloc - (get_local $8) - ) - ) - (get_local $8) - ) - ) - (call $free - (get_local $3) - ) - (br $label$4) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $3 - (i32.sub - (get_local $11) - (i32.and - (i32.add - (get_local $8) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - (drop - (call $db_get_i64 - (get_local $1) - (get_local $3) - (get_local $8) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.store offset=16 - (tee_local $5 - (call $_Znwj - (i32.const 40) - ) - ) - (i64.const 1398362884) - ) - (i64.store offset=8 - (get_local $5) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $11 - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - (set_local $6 - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - (set_local $9 - (i64.const 5462355) - ) - (set_local $7 - (i32.const 0) - ) - (block $label$6 - (block $label$7 - (loop $label$8 - (br_if $label$7 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $9) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$9 - (br_if $label$9 - (i64.ne - (i64.and - (tee_local $9 - (i64.shr_u - (get_local $9) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$10 - (br_if $label$7 - (i64.ne - (i64.and - (tee_local $9 - (i64.shr_u - (get_local $9) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$10 - (i32.lt_s - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - (br_if $label$8 - (i32.lt_s - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$6) - ) - ) - (set_local $4 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 16) - ) - (i32.store offset=24 - (get_local $5) - (get_local $0) - ) - (call $eosio_assert - (i32.gt_u - (get_local $8) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $3) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (tee_local $7 - (i32.and - (get_local $8) - (i32.const -8) - ) - ) - (i32.const 8) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $6) - (i32.add - (get_local $3) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $7) - (i32.const 16) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $11) - (i32.add - (get_local $3) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store offset=28 - (get_local $5) - (get_local $1) - ) - (i32.store offset=24 - (get_local $10) - (get_local $5) - ) - (i64.store offset=16 - (get_local $10) - (tee_local $9 - (i64.load - (get_local $5) - ) - ) - ) - (i32.store offset=12 - (get_local $10) - (tee_local $8 - (i32.load offset=28 - (get_local $5) - ) - ) - ) - (block $label$11 - (block $label$12 - (br_if $label$12 - (i32.ge_u - (tee_local $7 - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $7) - (get_local $9) - ) - (i32.store offset=16 - (get_local $7) - (get_local $8) - ) - (i32.store offset=24 - (get_local $10) - (i32.const 0) - ) - (i32.store - (get_local $7) - (get_local $5) - ) - (i32.store - (get_local $1) - (i32.add - (get_local $7) - (i32.const 24) - ) - ) - (br $label$11) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy3774946787993190400ENS1_5token9allowanceEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ - (get_local $2) - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.add - (get_local $10) - (i32.const 16) - ) - (i32.add - (get_local $10) - (i32.const 12) - ) - ) - ) - (set_local $7 - (i32.load offset=24 - (get_local $10) - ) - ) - (i32.store offset=24 - (get_local $10) - (i32.const 0) - ) - (br_if $label$2 - (i32.eqz - (get_local $7) - ) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - (get_local $5) - ) - (func $_ZN5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE6modifyIZNS1_13set_allowanceEyyNS_5assetEbEUlRT_E0_EEvRKS2_yOS6_ (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i32) - (local $9 i32) - (set_local $8 - (tee_local $9 - (i32.load offset=4 - (i32.const 0) - ) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=24 - (get_local $1) - ) - (get_local $0) - ) - (i32.const 688) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 736) - ) - (set_local $6 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $3) - ) - ) - (set_local $4 - (i64.load - (get_local $1) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.load8_u - (i32.load - (get_local $3) - ) - ) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $5) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i32.const 800) - ) - (i64.store - (get_local $6) - (tee_local $7 - (i64.add - (i64.load - (get_local $6) - ) - (i64.load - (get_local $5) - ) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $7) - (i64.const -4611686018427387904) - ) - (i32.const 848) - ) - (call $eosio_assert - (i64.lt_s - (i64.load - (get_local $6) - ) - (i64.const 4611686018427387904) - ) - (i32.const 880) - ) - (set_local $7 - (i64.load - (get_local $1) - ) - ) - (br $label$0) - ) - (i64.store - (get_local $6) - (i64.load - (get_local $5) - ) - ) - (i64.store - (i32.add - (get_local $6) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (set_local $7 - (get_local $4) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $4) - (get_local $7) - ) - (i32.const 912) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $5 - (i32.add - (tee_local $3 - (get_local $9) - ) - (i32.const -32) - ) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $1) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const -24) - ) - (get_local $6) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const -16) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (call $db_update_i64 - (i32.load offset=28 - (get_local $1) - ) - (get_local $2) - (get_local $5) - (i32.const 24) - ) - (block $label$2 - (br_if $label$2 - (i64.lt_u - (get_local $4) - (i64.load offset=16 - (get_local $0) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (select - (i64.const -2) - (i64.add - (get_local $4) - (i64.const 1) - ) - (i64.gt_u - (get_local $4) - (i64.const -3) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $8) - ) - ) - (func $_ZN5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE7emplaceIZNS1_13set_allowanceEyyNS_5assetEbEUlRT_E_EENS3_14const_iteratorEyOS6_ (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i64.store offset=40 - (get_local $7) - (get_local $2) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $1) - ) - (call $current_receiver) - ) - (i32.const 208) - ) - (i32.store offset=20 - (get_local $7) - (get_local $3) - ) - (i32.store offset=16 - (get_local $7) - (get_local $1) - ) - (i32.store offset=24 - (get_local $7) - (i32.add - (get_local $7) - (i32.const 40) - ) - ) - (i64.store offset=16 - (tee_local $4 - (call $_Znwj - (i32.const 40) - ) - ) - (i64.const 1398362884) - ) - (i64.store offset=8 - (get_local $4) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $2 - (i64.const 5462355) - ) - (set_local $3 - (i32.const 0) - ) - (block $label$0 - (block $label$1 - (loop $label$2 - (br_if $label$1 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $2) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $2 - (i64.shr_u - (get_local $2) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $2 - (i64.shr_u - (get_local $2) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $3 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $6 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $3 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $6 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 16) - ) - (i32.store offset=24 - (get_local $4) - (get_local $1) - ) - (call $_ZZN5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE7emplaceIZNS1_13set_allowanceEyyNS_5assetEbEUlRT_E_EENS3_14const_iteratorEyOS6_ENKUlS7_E_clINS3_4itemEEEDaS7_ - (i32.add - (get_local $7) - (i32.const 16) - ) - (get_local $4) - ) - (i32.store offset=32 - (get_local $7) - (get_local $4) - ) - (i64.store offset=16 - (get_local $7) - (tee_local $2 - (i64.load - (get_local $4) - ) - ) - ) - (i32.store offset=12 - (get_local $7) - (tee_local $6 - (i32.load offset=28 - (get_local $4) - ) - ) - ) - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.ge_u - (tee_local $3 - (i32.load - (tee_local $5 - (i32.add - (get_local $1) - (i32.const 28) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $3) - (get_local $2) - ) - (i32.store offset=16 - (get_local $3) - (get_local $6) - ) - (i32.store offset=32 - (get_local $7) - (i32.const 0) - ) - (i32.store - (get_local $3) - (get_local $4) - ) - (i32.store - (get_local $5) - (i32.add - (get_local $3) - (i32.const 24) - ) - ) - (br $label$5) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy3774946787993190400ENS1_5token9allowanceEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.add - (get_local $7) - (i32.const 32) - ) - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - (i32.store offset=4 - (get_local $0) - (get_local $4) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (set_local $3 - (i32.load offset=32 - (get_local $7) - ) - ) - (i32.store offset=32 - (get_local $7) - (i32.const 0) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (get_local $3) - ) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 48) - ) - ) - ) - (func $_ZZN5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE7emplaceIZNS1_13set_allowanceEyyNS_5assetEbEUlRT_E_EENS3_14const_iteratorEyOS6_ENKUlS7_E_clINS3_4itemEEEDaS7_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $6 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (i64.store - (get_local $1) - (i64.load - (i32.load - (tee_local $4 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - ) - ) - (set_local $2 - (i32.load - (get_local $0) - ) - ) - (i64.store offset=8 - (get_local $1) - (i64.load - (tee_local $4 - (i32.load offset=4 - (get_local $4) - ) - ) - ) - ) - (i64.store - (tee_local $5 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (get_local $6) - (get_local $1) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.or - (get_local $6) - (i32.const 8) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.add - (get_local $6) - (i32.const 16) - ) - (get_local $5) - (i32.const 8) - ) - ) - (i32.store offset=28 - (get_local $1) - (call $db_store_i64 - (i64.load offset=8 - (get_local $2) - ) - (i64.const 3774946787993190400) - (i64.load - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $3 - (i64.load - (get_local $1) - ) - ) - (get_local $6) - (i32.const 24) - ) - ) - (block $label$0 - (br_if $label$0 - (i64.lt_u - (get_local $3) - (i64.load offset=16 - (get_local $2) - ) - ) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 16) - ) - (select - (i64.const -2) - (i64.add - (get_local $3) - (i64.const 1) - ) - (i64.gt_u - (get_local $3) - (i64.const -3) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 32) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy3774946787993190400ENS1_5token9allowanceEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $5 - (i32.add - (tee_local $4 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $0) - ) - (tee_local $6 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 24) - ) - ) - (i32.const 1) - ) - ) - (i32.const 178956971) - ) - ) - (set_local $7 - (i32.const 178956970) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $6 - (i32.div_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $6) - ) - (i32.const 24) - ) - ) - (i32.const 89478484) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $7 - (select - (get_local $5) - (tee_local $7 - (i32.shl - (get_local $6) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $5) - ) - ) - ) - ) - ) - ) - (set_local $6 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 24) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $6 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $5 - (i32.load - (get_local $1) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i32.store - (tee_local $1 - (i32.add - (get_local $6) - (i32.mul - (get_local $4) - (i32.const 24) - ) - ) - ) - (get_local $5) - ) - (i64.store offset=8 - (get_local $1) - (i64.load - (get_local $2) - ) - ) - (i32.store offset=16 - (get_local $1) - (i32.load - (get_local $3) - ) - ) - (set_local $4 - (i32.add - (get_local $6) - (i32.mul - (get_local $7) - (i32.const 24) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $6 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.load - (get_local $0) - ) - ) - ) - ) - (loop $label$6 - (set_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -24) - ) - (get_local $3) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -8) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -12) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -12) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -16) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -16) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const -24) - ) - ) - (set_local $6 - (get_local $2) - ) - (br_if $label$6 - (i32.ne - (get_local $7) - (get_local $2) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $6 - (i32.load - (get_local $0) - ) - ) - (br $label$4) - ) - (set_local $6 - (get_local $7) - ) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $5) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $4) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $7) - (get_local $6) - ) - ) - (loop $label$8 - (set_local $1 - (i32.load - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (br_if $label$8 - (i32.ne - (get_local $6) - (get_local $7) - ) - ) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (get_local $6) - ) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - ) - (func $_ZNK5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE31load_object_by_primary_iteratorEl (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i64) - (local $9 i32) - (local $10 i32) - (set_local $9 - (tee_local $10 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $10) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - (tee_local $3 - (i32.load offset=24 - (get_local $0) - ) - ) - ) - ) - (set_local $4 - (i32.sub - (i32.const 0) - (get_local $3) - ) - ) - (set_local $6 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (loop $label$1 - (br_if $label$0 - (i32.eq - (i32.load - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (get_local $1) - ) - ) - (set_local $7 - (get_local $6) - ) - (set_local $6 - (tee_local $5 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $5) - (get_local $4) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $7) - (get_local $3) - ) - ) - (set_local $5 - (i32.load - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - (br $label$2) - ) - (call $eosio_assert - (i32.xor - (i32.shr_u - (tee_local $7 - (call $db_get_i64 - (get_local $1) - (i32.const 0) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.const 1) - ) - (i32.const 352) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.le_u - (get_local $7) - (i32.const 512) - ) - ) - (drop - (call $db_get_i64 - (get_local $1) - (tee_local $3 - (call $malloc - (get_local $7) - ) - ) - (get_local $7) - ) - ) - (call $free - (get_local $3) - ) - (br $label$4) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $3 - (i32.sub - (get_local $10) - (i32.and - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - (drop - (call $db_get_i64 - (get_local $1) - (get_local $3) - (get_local $7) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.store offset=8 - (tee_local $5 - (call $_Znwj - (i32.const 32) - ) - ) - (i64.const 1398362884) - ) - (i64.store - (get_local $5) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $10 - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - (set_local $8 - (i64.const 5462355) - ) - (set_local $6 - (i32.const 0) - ) - (block $label$6 - (block $label$7 - (loop $label$8 - (br_if $label$7 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $8) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$9 - (br_if $label$9 - (i64.ne - (i64.and - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$10 - (br_if $label$7 - (i64.ne - (i64.and - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$10 - (i32.lt_s - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - (br_if $label$8 - (i32.lt_s - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$6) - ) - ) - (set_local $4 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 16) - ) - (i32.store offset=16 - (get_local $5) - (get_local $0) - ) - (call $eosio_assert - (i32.gt_u - (get_local $7) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $3) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (i32.and - (get_local $7) - (i32.const -8) - ) - (i32.const 8) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $10) - (i32.add - (get_local $3) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=20 - (get_local $5) - (get_local $1) - ) - (i32.store offset=24 - (get_local $9) - (get_local $5) - ) - (i64.store offset=16 - (get_local $9) - (tee_local $8 - (i64.shr_u - (i64.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=12 - (get_local $9) - (tee_local $7 - (i32.load offset=20 - (get_local $5) - ) - ) - ) - (block $label$11 - (block $label$12 - (br_if $label$12 - (i32.ge_u - (tee_local $6 - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $6) - (get_local $8) - ) - (i32.store offset=16 - (get_local $6) - (get_local $7) - ) - (i32.store offset=24 - (get_local $9) - (i32.const 0) - ) - (i32.store - (get_local $6) - (get_local $5) - ) - (i32.store - (get_local $1) - (i32.add - (get_local $6) - (i32.const 24) - ) - ) - (br $label$11) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy3607749779137757184ENS1_5token7accountEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ - (get_local $2) - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.add - (get_local $9) - (i32.const 16) - ) - (i32.add - (get_local $9) - (i32.const 12) - ) - ) - ) - (set_local $6 - (i32.load offset=24 - (get_local $9) - ) - ) - (i32.store offset=24 - (get_local $9) - (i32.const 0) - ) - (br_if $label$2 - (i32.eqz - (get_local $6) - ) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 32) - ) - ) - (get_local $5) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy3607749779137757184ENS1_5token7accountEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $5 - (i32.add - (tee_local $4 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $0) - ) - (tee_local $6 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 24) - ) - ) - (i32.const 1) - ) - ) - (i32.const 178956971) - ) - ) - (set_local $7 - (i32.const 178956970) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $6 - (i32.div_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $6) - ) - (i32.const 24) - ) - ) - (i32.const 89478484) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $7 - (select - (get_local $5) - (tee_local $7 - (i32.shl - (get_local $6) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $5) - ) - ) - ) - ) - ) - ) - (set_local $6 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 24) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $6 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $5 - (i32.load - (get_local $1) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i32.store - (tee_local $1 - (i32.add - (get_local $6) - (i32.mul - (get_local $4) - (i32.const 24) - ) - ) - ) - (get_local $5) - ) - (i64.store offset=8 - (get_local $1) - (i64.load - (get_local $2) - ) - ) - (i32.store offset=16 - (get_local $1) - (i32.load - (get_local $3) - ) - ) - (set_local $4 - (i32.add - (get_local $6) - (i32.mul - (get_local $7) - (i32.const 24) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $6 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.load - (get_local $0) - ) - ) - ) - ) - (loop $label$6 - (set_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -24) - ) - (get_local $3) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -8) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -12) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -12) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const -16) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const -16) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const -24) - ) - ) - (set_local $6 - (get_local $2) - ) - (br_if $label$6 - (i32.ne - (get_local $7) - (get_local $2) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $6 - (i32.load - (get_local $0) - ) - ) - (br $label$4) - ) - (set_local $6 - (get_local $7) - ) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $5) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $4) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $7) - (get_local $6) - ) - ) - (loop $label$8 - (set_local $1 - (i32.load - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (br_if $label$8 - (i32.ne - (get_local $6) - (get_local $7) - ) - ) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (get_local $6) - ) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - ) - (func $_ZN5eosio5token5issueEyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE (type $FUNCSIG$vijii) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (local $7 i32) - (local $8 i64) - (local $9 i32) - (local $10 i32) - (local $11 i64) - (local $12 i64) - (local $13 i64) - (local $14 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $14 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 224) - ) - ) - ) - (set_local $9 - (i32.const 0) - ) - (set_local $8 - (tee_local $13 - (i64.shr_u - (tee_local $11 - (i64.load offset=8 - (get_local $2) - ) - ) - (i64.const 8) - ) - ) - ) - (block $label$0 - (block $label$1 - (loop $label$2 - (br_if $label$1 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $8) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $9 - (i32.add - (get_local $9) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $7 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $9 - (i32.add - (get_local $9) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $7 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $7) - (i32.const 16) - ) - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.and - (tee_local $9 - (i32.load8_u - (get_local $3) - ) - ) - (i32.const 1) - ) - ) - (set_local $9 - (i32.shr_u - (get_local $9) - (i32.const 1) - ) - ) - (br $label$5) - ) - (set_local $9 - (i32.load offset=4 - (get_local $3) - ) - ) - ) - (call $eosio_assert - (i32.lt_u - (get_local $9) - (i32.const 257) - ) - (i32.const 976) - ) - (set_local $10 - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $14) - (i32.const 88) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i64.store offset=104 - (get_local $14) - (i64.const -1) - ) - (i64.store offset=112 - (get_local $14) - (i64.const 0) - ) - (i64.store offset=88 - (get_local $14) - (tee_local $8 - (i64.load - (get_local $0) - ) - ) - ) - (i64.store offset=96 - (get_local $14) - (get_local $13) - ) - (set_local $7 - (i32.const 0) - ) - (block $label$7 - (br_if $label$7 - (i32.lt_s - (tee_local $9 - (call $db_find_i64 - (get_local $8) - (get_local $13) - (i64.const -4157508551318700032) - (get_local $13) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=40 - (tee_local $7 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_5token12currencystatEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $14) - (i32.const 88) - ) - (get_local $9) - ) - ) - ) - (i32.add - (get_local $14) - (i32.const 88) - ) - ) - (i32.const 96) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $7) - (i32.const 0) - ) - (i32.const 1008) - ) - (call $require_auth - (i64.load offset=32 - (get_local $7) - ) - ) - (set_local $4 - (i32.add - (get_local $7) - (i32.const 32) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.gt_u - (i64.add - (tee_local $8 - (i64.load - (get_local $2) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $9 - (i32.const 0) - ) - (block $label$9 - (loop $label$10 - (br_if $label$9 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $13) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$11 - (br_if $label$11 - (i64.ne - (i64.and - (tee_local $13 - (i64.shr_u - (get_local $13) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$12 - (br_if $label$9 - (i64.ne - (i64.and - (tee_local $13 - (i64.shr_u - (get_local $13) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$12 - (i32.lt_s - (tee_local $9 - (i32.add - (get_local $9) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $10 - (i32.const 1) - ) - (br_if $label$10 - (i32.lt_s - (tee_local $9 - (i32.add - (get_local $9) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$8) - ) - ) - (set_local $10 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $10) - (i32.const 544) - ) - (call $eosio_assert - (i64.gt_s - (get_local $8) - (i64.const 0) - ) - (i32.const 1072) - ) - (call $eosio_assert - (i64.eq - (get_local $11) - (i64.load offset=8 - (get_local $7) - ) - ) - (i32.const 608) - ) - (call $eosio_assert - (i64.le_s - (get_local $8) - (i64.sub - (i64.load offset=16 - (get_local $7) - ) - (i64.load - (get_local $7) - ) - ) - ) - (i32.const 1104) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=40 - (get_local $7) - ) - (i32.add - (get_local $14) - (i32.const 88) - ) - ) - (i32.const 688) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=88 - (get_local $14) - ) - (call $current_receiver) - ) - (i32.const 736) - ) - (call $eosio_assert - (i64.eq - (get_local $11) - (tee_local $13 - (i64.load offset=8 - (get_local $7) - ) - ) - ) - (i32.const 800) - ) - (i64.store - (get_local $7) - (tee_local $8 - (i64.add - (i64.load - (get_local $7) - ) - (get_local $8) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $8) - (i64.const -4611686018427387904) - ) - (i32.const 848) - ) - (call $eosio_assert - (i64.lt_s - (i64.load - (get_local $7) - ) - (i64.const 4611686018427387904) - ) - (i32.const 880) - ) - (call $eosio_assert - (i64.eq - (tee_local $8 - (i64.shr_u - (get_local $13) - (i64.const 8) - ) - ) - (i64.shr_u - (i64.load offset=8 - (get_local $7) - ) - (i64.const 8) - ) - ) - (i32.const 912) - ) - (i32.store offset=192 - (get_local $14) - (i32.add - (i32.add - (get_local $14) - (i32.const 128) - ) - (i32.const 40) - ) - ) - (i32.store offset=188 - (get_local $14) - (i32.add - (get_local $14) - (i32.const 128) - ) - ) - (i32.store offset=184 - (get_local $14) - (i32.add - (get_local $14) - (i32.const 128) - ) - ) - (i32.store offset=200 - (get_local $14) - (i32.add - (get_local $14) - (i32.const 184) - ) - ) - (i32.store offset=212 - (get_local $14) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (i32.store offset=208 - (get_local $14) - (get_local $7) - ) - (i32.store offset=216 - (get_local $14) - (get_local $4) - ) - (call $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRKN5eosio5assetES8_RKyEEEZNS5_lsINS5_10datastreamIPcEENS5_5token12currencystatELPv0EEERT_SK_RKT0_EUlRKSJ_E_JLj0ELj1ELj2EEEEvSK_OSL_NSt3__116integer_sequenceIjJXspT1_EEEENSS_17integral_constantIbLb0EEE - (i32.add - (get_local $14) - (i32.const 208) - ) - (i32.add - (get_local $14) - (i32.const 200) - ) - ) - (call $db_update_i64 - (i32.load offset=44 - (get_local $7) - ) - (i64.const 0) - (i32.add - (get_local $14) - (i32.const 128) - ) - (i32.const 40) - ) - (block $label$13 - (br_if $label$13 - (i64.lt_u - (get_local $8) - (i64.load - (tee_local $9 - (i32.add - (i32.add - (get_local $14) - (i32.const 88) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $9) - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - ) - (i32.store - (tee_local $9 - (i32.add - (i32.add - (get_local $14) - (i32.const 72) - ) - (i32.const 12) - ) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 12) - ) - ) - ) - (i32.store - (tee_local $7 - (i32.add - (i32.add - (get_local $14) - (i32.const 72) - ) - (i32.const 8) - ) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i32.store offset=76 - (get_local $14) - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (i32.store offset=72 - (get_local $14) - (i32.load - (get_local $2) - ) - ) - (set_local $8 - (i64.load - (get_local $4) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $14) - (i32.const 8) - ) - (i32.const 12) - ) - (i32.load - (get_local $9) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $14) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.load - (get_local $7) - ) - ) - (i32.store offset=12 - (get_local $14) - (i32.load offset=76 - (get_local $14) - ) - ) - (i32.store offset=8 - (get_local $14) - (i32.load offset=72 - (get_local $14) - ) - ) - (call $_ZN5eosio5token11add_balanceEyNS_5assetEy - (get_local $0) - (get_local $8) - (i32.add - (get_local $14) - (i32.const 8) - ) - (get_local $8) - ) - (block $label$14 - (br_if $label$14 - (i64.eq - (tee_local $5 - (i64.load - (get_local $4) - ) - ) - (get_local $1) - ) - ) - (set_local $6 - (i64.load - (get_local $0) - ) - ) - (set_local $8 - (i64.const 0) - ) - (set_local $11 - (i64.const 59) - ) - (set_local $9 - (i32.const 1152) - ) - (set_local $12 - (i64.const 0) - ) - (loop $label$15 - (block $label$16 - (block $label$17 - (block $label$18 - (block $label$19 - (block $label$20 - (br_if $label$20 - (i64.gt_u - (get_local $8) - (i64.const 5) - ) - ) - (br_if $label$19 - (i32.gt_u - (i32.and - (i32.add - (tee_local $7 - (i32.load8_s - (get_local $9) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const 165) - ) - ) - (br $label$18) - ) - (set_local $13 - (i64.const 0) - ) - (br_if $label$17 - (i64.le_u - (get_local $8) - (i64.const 11) - ) - ) - (br $label$16) - ) - (set_local $7 - (select - (i32.add - (get_local $7) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $7) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $13 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $7) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $13 - (i64.shl - (i64.and - (get_local $13) - (i64.const 31) - ) - (i64.and - (get_local $11) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $9 - (i32.add - (get_local $9) - (i32.const 1) - ) - ) - (set_local $8 - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - (set_local $12 - (i64.or - (get_local $13) - (get_local $12) - ) - ) - (br_if $label$15 - (i64.ne - (tee_local $11 - (i64.add - (get_local $11) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i32.store - (i32.add - (get_local $14) - (i32.const 52) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 12) - ) - ) - ) - (i32.store - (tee_local $7 - (i32.add - (i32.add - (get_local $14) - (i32.const 24) - ) - (i32.const 24) - ) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i32.store - (i32.add - (get_local $14) - (i32.const 44) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (i64.store offset=32 - (get_local $14) - (get_local $1) - ) - (i64.store offset=24 - (get_local $14) - (get_local $5) - ) - (i32.store offset=40 - (get_local $14) - (i32.load - (get_local $2) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $14) - (i32.const 56) - ) - (get_local $3) - ) - ) - (i64.store - (tee_local $9 - (call $_Znwj - (i32.const 16) - ) - ) - (get_local $5) - ) - (i64.store offset=8 - (get_local $9) - (get_local $12) - ) - (i32.store offset=208 - (get_local $14) - (get_local $9) - ) - (i32.store offset=216 - (get_local $14) - (tee_local $9 - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - (i32.store offset=212 - (get_local $14) - (get_local $9) - ) - (i64.store offset=128 - (get_local $14) - (i64.load offset=24 - (get_local $14) - ) - ) - (i64.store offset=136 - (get_local $14) - (i64.load offset=32 - (get_local $14) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 128) - ) - (i32.const 24) - ) - (i64.load - (get_local $7) - ) - ) - (i64.store offset=144 - (get_local $14) - (i64.load offset=40 - (get_local $14) - ) - ) - (i32.store - (tee_local $7 - (i32.add - (i32.add - (get_local $14) - (i32.const 128) - ) - (i32.const 40) - ) - ) - (i32.load - (tee_local $9 - (i32.add - (i32.add - (get_local $14) - (i32.const 24) - ) - (i32.const 40) - ) - ) - ) - ) - (i64.store offset=160 - (get_local $14) - (i64.load offset=56 - (get_local $14) - ) - ) - (i32.store offset=56 - (get_local $14) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $14) - (i32.const 60) - ) - (i32.const 0) - ) - (i32.store - (get_local $9) - (i32.const 0) - ) - (call $_ZN5eosio15dispatch_inlineIJyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEvyyNS2_6vectorINS_16permission_levelENS6_ISA_EEEENS2_5tupleIJDpT_EEE - (get_local $6) - (i64.const -3617168760277827584) - (i32.add - (get_local $14) - (i32.const 208) - ) - (i32.add - (get_local $14) - (i32.const 128) - ) - ) - (block $label$21 - (br_if $label$21 - (i32.eqz - (i32.and - (i32.load8_u offset=160 - (get_local $14) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (get_local $7) - ) - ) - ) - (block $label$22 - (br_if $label$22 - (i32.eqz - (tee_local $9 - (i32.load offset=208 - (get_local $14) - ) - ) - ) - ) - (i32.store offset=212 - (get_local $14) - (get_local $9) - ) - (call $_ZdlPv - (get_local $9) - ) - ) - (br_if $label$14 - (i32.eqz - (i32.and - (i32.load8_u - (i32.add - (get_local $14) - (i32.const 56) - ) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $14) - (i32.const 64) - ) - ) - ) - ) - (block $label$23 - (br_if $label$23 - (i32.eqz - (tee_local $2 - (i32.load offset=112 - (get_local $14) - ) - ) - ) - ) - (block $label$24 - (block $label$25 - (br_if $label$25 - (i32.eq - (tee_local $9 - (i32.load - (tee_local $10 - (i32.add - (get_local $14) - (i32.const 116) - ) - ) - ) - ) - (get_local $2) - ) - ) - (loop $label$26 - (set_local $7 - (i32.load - (tee_local $9 - (i32.add - (get_local $9) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $9) - (i32.const 0) - ) - (block $label$27 - (br_if $label$27 - (i32.eqz - (get_local $7) - ) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (br_if $label$26 - (i32.ne - (get_local $2) - (get_local $9) - ) - ) - ) - (set_local $9 - (i32.load - (i32.add - (get_local $14) - (i32.const 112) - ) - ) - ) - (br $label$24) - ) - (set_local $9 - (get_local $2) - ) - ) - (i32.store - (get_local $10) - (get_local $2) - ) - (call $_ZdlPv - (get_local $9) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $14) - (i32.const 224) - ) - ) - ) - (func $_ZN5eosio5token11add_balanceEyNS_5assetEy (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) - (local $4 i64) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 80) - ) - ) - ) - (set_local $8 - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i64.store offset=24 - (get_local $9) - (i64.const -1) - ) - (i64.store offset=32 - (get_local $9) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $9) - (tee_local $6 - (i64.load - (get_local $0) - ) - ) - ) - (i64.store offset=16 - (get_local $9) - (get_local $1) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.lt_s - (tee_local $0 - (call $db_find_i64 - (get_local $6) - (get_local $1) - (i64.const 3607749779137757184) - (i64.shr_u - (tee_local $4 - (i64.load offset=8 - (get_local $2) - ) - ) - (i64.const 8) - ) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (tee_local $8 - (call $_ZNK5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $9) - (i32.const 8) - ) - (get_local $0) - ) - ) - ) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (i32.const 96) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 640) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (get_local $8) - ) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (i32.const 688) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $9) - ) - (call $current_receiver) - ) - (i32.const 736) - ) - (call $eosio_assert - (i64.eq - (get_local $4) - (tee_local $1 - (i64.load offset=8 - (get_local $8) - ) - ) - ) - (i32.const 800) - ) - (i64.store - (get_local $8) - (tee_local $6 - (i64.add - (i64.load - (get_local $8) - ) - (i64.load - (get_local $2) - ) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $6) - (i64.const -4611686018427387904) - ) - (i32.const 848) - ) - (call $eosio_assert - (i64.lt_s - (i64.load - (get_local $8) - ) - (i64.const 4611686018427387904) - ) - (i32.const 880) - ) - (call $eosio_assert - (i64.eq - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.shr_u - (i64.load offset=8 - (get_local $8) - ) - (i64.const 8) - ) - ) - (i32.const 912) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.add - (get_local $9) - (i32.const 64) - ) - (get_local $8) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.or - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 8) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $db_update_i64 - (i32.load offset=20 - (get_local $8) - ) - (i64.const 0) - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 16) - ) - (br_if $label$2 - (i64.lt_u - (get_local $1) - (i64.load - (tee_local $8 - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $8) - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (br_if $label$1 - (tee_local $2 - (i32.load offset=32 - (get_local $9) - ) - ) - ) - (br $label$0) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $9) - ) - (call $current_receiver) - ) - (i32.const 208) - ) - (i64.store offset=8 - (tee_local $0 - (call $_Znwj - (i32.const 32) - ) - ) - (i64.const 1398362884) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $5 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $1 - (i64.const 5462355) - ) - (block $label$4 - (loop $label$5 - (set_local $7 - (i32.const 0) - ) - (br_if $label$4 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $1) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$6 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$7 - (br_if $label$4 - (i64.ne - (i64.and - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $7 - (i32.const 1) - ) - (br_if $label$5 - (i32.lt_s - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (call $eosio_assert - (get_local $7) - (i32.const 16) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (i64.store - (tee_local $8 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i64.store - (get_local $0) - (i64.load - (get_local $2) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.add - (get_local $9) - (i32.const 64) - ) - (get_local $0) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.or - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 8) - ) - (get_local $5) - (i32.const 8) - ) - ) - (i32.store offset=20 - (get_local $0) - (tee_local $2 - (call $db_store_i64 - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i64.const 3607749779137757184) - (get_local $3) - (tee_local $1 - (i64.shr_u - (i64.load - (get_local $8) - ) - (i64.const 8) - ) - ) - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 16) - ) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.lt_u - (get_local $1) - (i64.load - (tee_local $7 - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $7) - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - ) - (i32.store offset=56 - (get_local $9) - (get_local $0) - ) - (i64.store offset=64 - (get_local $9) - (tee_local $1 - (i64.shr_u - (i64.load - (get_local $8) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=52 - (get_local $9) - (get_local $2) - ) - (block $label$9 - (block $label$10 - (br_if $label$10 - (i32.ge_u - (tee_local $8 - (i32.load - (tee_local $7 - (i32.add - (get_local $9) - (i32.const 36) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $9) - (i32.const 40) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $8) - (get_local $1) - ) - (i32.store offset=16 - (get_local $8) - (get_local $2) - ) - (i32.store offset=56 - (get_local $9) - (i32.const 0) - ) - (i32.store - (get_local $8) - (get_local $0) - ) - (i32.store - (get_local $7) - (i32.add - (get_local $8) - (i32.const 24) - ) - ) - (br $label$9) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy3607749779137757184ENS1_5token7accountEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $9) - (i32.const 32) - ) - (i32.add - (get_local $9) - (i32.const 56) - ) - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.add - (get_local $9) - (i32.const 52) - ) - ) - ) - (set_local $8 - (i32.load offset=56 - (get_local $9) - ) - ) - (i32.store offset=56 - (get_local $9) - (i32.const 0) - ) - (br_if $label$2 - (i32.eqz - (get_local $8) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $2 - (i32.load offset=32 - (get_local $9) - ) - ) - ) - ) - ) - (block $label$11 - (block $label$12 - (br_if $label$12 - (i32.eq - (tee_local $8 - (i32.load - (tee_local $7 - (i32.add - (get_local $9) - (i32.const 36) - ) - ) - ) - ) - (get_local $2) - ) - ) - (loop $label$13 - (set_local $0 - (i32.load - (tee_local $8 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (get_local $0) - ) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (br_if $label$13 - (i32.ne - (get_local $2) - (get_local $8) - ) - ) - ) - (set_local $8 - (i32.load - (i32.add - (get_local $9) - (i32.const 32) - ) - ) - ) - (br $label$11) - ) - (set_local $8 - (get_local $2) - ) - ) - (i32.store - (get_local $7) - (get_local $2) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 80) - ) - ) - ) - (func $_ZN5eosio15dispatch_inlineIJyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEvyyNS2_6vectorINS_16permission_levelENS6_ISA_EEEENS2_5tupleIJDpT_EEE (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store offset=16 - (get_local $9) - (i32.const 0) - ) - (i64.store offset=8 - (get_local $9) - (i64.const 0) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $5 - (i32.shr_s - (tee_local $4 - (i32.sub - (i32.load offset=4 - (get_local $2) - ) - (i32.load - (get_local $2) - ) - ) - ) - (i32.const 4) - ) - ) - ) - ) - (br_if $label$0 - (i32.ge_u - (get_local $5) - (i32.const 268435456) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 16) - ) - (tee_local $6 - (i32.add - (tee_local $8 - (call $_Znwj - (get_local $4) - ) - ) - (i32.shl - (get_local $5) - (i32.const 4) - ) - ) - ) - ) - (i32.store offset=8 - (get_local $9) - (get_local $8) - ) - (i32.store offset=12 - (get_local $9) - (get_local $8) - ) - (block $label$2 - (br_if $label$2 - (i32.lt_s - (tee_local $2 - (i32.sub - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - (tee_local $7 - (i32.load - (get_local $2) - ) - ) - ) - ) - (i32.const 1) - ) - ) - (drop - (call $memcpy - (get_local $8) - (get_local $7) - (get_local $2) - ) - ) - (i32.store offset=12 - (get_local $9) - (tee_local $7 - (i32.add - (get_local $8) - (get_local $2) - ) - ) - ) - (br $label$1) - ) - (set_local $7 - (get_local $8) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 44) - ) - (get_local $7) - ) - (i64.store offset=32 - (get_local $9) - (get_local $1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 16) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 48) - ) - (get_local $6) - ) - (i64.store offset=24 - (get_local $9) - (get_local $0) - ) - (i32.store offset=40 - (get_local $9) - (get_local $8) - ) - (i64.store offset=8 - (get_local $9) - (i64.const 0) - ) - (i32.store offset=52 - (get_local $9) - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 36) - ) - (i32.const 0) - ) - (set_local $8 - (i32.add - (tee_local $2 - (select - (i32.load - (i32.add - (get_local $3) - (i32.const 36) - ) - ) - (i32.shr_u - (tee_local $8 - (i32.load8_u offset=32 - (get_local $3) - ) - ) - (i32.const 1) - ) - (i32.and - (get_local $8) - (i32.const 1) - ) - ) - ) - (i32.const 32) - ) - ) - (set_local $0 - (i64.extend_u/i32 - (get_local $2) - ) - ) - (set_local $2 - (i32.add - (get_local $9) - (i32.const 52) - ) - ) - (loop $label$3 - (set_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (br_if $label$3 - (i64.ne - (tee_local $0 - (i64.shr_u - (get_local $0) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eqz - (get_local $8) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $2) - (get_local $8) - ) - (set_local $2 - (i32.load - (i32.add - (get_local $9) - (i32.const 56) - ) - ) - ) - (set_local $8 - (i32.load - (i32.add - (get_local $9) - (i32.const 52) - ) - ) - ) - (br $label$4) - ) - (set_local $2 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - ) - (i32.store offset=84 - (get_local $9) - (get_local $8) - ) - (i32.store offset=80 - (get_local $9) - (get_local $8) - ) - (i32.store offset=88 - (get_local $9) - (get_local $2) - ) - (i32.store offset=64 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 80) - ) - ) - (i32.store offset=72 - (get_local $9) - (get_local $3) - ) - (call $_ZN5boost6fusion6detail17for_each_unrolledILi4EE4callINS0_18std_tuple_iteratorIKNSt3__15tupleIJyyN5eosio5assetENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEELi0EEEZNS8_lsINS8_10datastreamIPcEEJyyS9_SF_EEERT_SO_RKNS7_IJDpT0_EEEEUlRKSN_E_EEvSV_RKT0_ - (i32.add - (get_local $9) - (i32.const 72) - ) - (i32.add - (get_local $9) - (i32.const 64) - ) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.add - (get_local $9) - (i32.const 24) - ) - ) - (call $send_inline - (tee_local $8 - (i32.load offset=80 - (get_local $9) - ) - ) - (i32.sub - (i32.load offset=84 - (get_local $9) - ) - (get_local $8) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.eqz - (tee_local $8 - (i32.load offset=80 - (get_local $9) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $9) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (tee_local $8 - (i32.load offset=52 - (get_local $9) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 56) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.eqz - (tee_local $8 - (i32.load offset=40 - (get_local $9) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 44) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (tee_local $8 - (i32.load offset=8 - (get_local $9) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $9) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 96) - ) - ) - (return) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (unreachable) - ) - (func $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.ge_u - (i32.sub - (tee_local $2 - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (get_local $1) - ) - ) - (br_if $label$2 - (i32.le_s - (tee_local $4 - (i32.add - (tee_local $3 - (i32.sub - (get_local $6) - (tee_local $5 - (i32.load - (get_local $0) - ) - ) - ) - ) - (get_local $1) - ) - ) - (i32.const -1) - ) - ) - (set_local $6 - (i32.const 2147483647) - ) - (block $label$5 - (br_if $label$5 - (i32.gt_u - (tee_local $2 - (i32.sub - (get_local $2) - (get_local $5) - ) - ) - (i32.const 1073741822) - ) - ) - (br_if $label$3 - (i32.eqz - (tee_local $6 - (select - (get_local $4) - (tee_local $6 - (i32.shl - (get_local $2) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $6) - (get_local $4) - ) - ) - ) - ) - ) - ) - (set_local $2 - (call $_Znwj - (get_local $6) - ) - ) - (br $label$1) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$6 - (i32.store8 - (get_local $6) - (i32.const 0) - ) - (i32.store - (get_local $0) - (tee_local $6 - (i32.add - (i32.load - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$6 - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -1) - ) - ) - ) - (br $label$0) - ) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $2 - (i32.const 0) - ) - (br $label$1) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $4 - (i32.add - (get_local $2) - (get_local $6) - ) - ) - (set_local $6 - (tee_local $5 - (i32.add - (get_local $2) - (get_local $3) - ) - ) - ) - (loop $label$7 - (i32.store8 - (get_local $6) - (i32.const 0) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$7 - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -1) - ) - ) - ) - ) - (set_local $5 - (i32.sub - (get_local $5) - (tee_local $2 - (i32.sub - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $1 - (i32.load - (get_local $0) - ) - ) - ) - ) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.lt_s - (get_local $2) - (i32.const 1) - ) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $1) - (get_local $2) - ) - ) - (set_local $1 - (i32.load - (get_local $0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $5) - ) - (i32.store - (get_local $3) - (get_local $6) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $4) - ) - (br_if $label$0 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - (return) - ) - ) - (func $_ZN5boost6fusion6detail17for_each_unrolledILi4EE4callINS0_18std_tuple_iteratorIKNSt3__15tupleIJyyN5eosio5assetENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEELi0EEEZNS8_lsINS8_10datastreamIPcEEJyyS9_SF_EEERT_SO_RKNS7_IJDpT0_EEEEUlRKSN_E_EEvSV_RKT0_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (set_local $2 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $3) - ) - (get_local $2) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (set_local $0 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $3) - ) - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $3) - ) - (i32.add - (get_local $0) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $3) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $3) - ) - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE - (i32.load - (get_local $1) - ) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - ) - (func $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i64.store align=4 - (get_local $0) - (i64.const 0) - ) - (set_local $5 - (i32.const 16) - ) - (set_local $2 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - (set_local $6 - (i64.extend_u/i32 - (i32.shr_s - (tee_local $4 - (i32.sub - (tee_local $7 - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - ) - (tee_local $3 - (i32.load offset=16 - (get_local $1) - ) - ) - ) - ) - (i32.const 4) - ) - ) - ) - (loop $label$0 - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $3) - (get_local $7) - ) - ) - (set_local $5 - (i32.add - (i32.and - (get_local $4) - (i32.const -16) - ) - (get_local $5) - ) - ) - ) - (set_local $5 - (i32.sub - (i32.sub - (tee_local $7 - (i32.load offset=28 - (get_local $1) - ) - ) - (get_local $5) - ) - (tee_local $3 - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $1) - (i32.const 28) - ) - ) - (set_local $6 - (i64.extend_u/i32 - (i32.sub - (get_local $3) - (get_local $7) - ) - ) - ) - (loop $label$2 - (set_local $5 - (i32.add - (get_local $5) - (i32.const -1) - ) - ) - (br_if $label$2 - (i64.ne - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (set_local $7 - (i32.const 0) - ) - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.eqz - (get_local $5) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $0) - (i32.sub - (i32.const 0) - (get_local $5) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $5 - (i32.load - (get_local $0) - ) - ) - (br $label$3) - ) - (set_local $5 - (i32.const 0) - ) - ) - (i32.store - (get_local $8) - (get_local $5) - ) - (i32.store offset=8 - (get_local $8) - (get_local $7) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $7) - (get_local $5) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $1) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $7) - (tee_local $0 - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (get_local $0) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $8) - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__16vectorIcNS6_9allocatorIcEEEE - (call $_ZN5eosiolsINS_10datastreamIPcEENS_16permission_levelEEERT_S6_RKNSt3__16vectorIT0_NS7_9allocatorIS9_EEEE - (get_local $8) - (get_local $2) - ) - (get_local $4) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEENS_16permission_levelEEERT_S6_RKNSt3__16vectorIT0_NS7_9allocatorIS9_EEEE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (set_local $4 - (i64.extend_u/i32 - (i32.shr_s - (i32.sub - (i32.load offset=4 - (get_local $1) - ) - (i32.load - (get_local $1) - ) - ) - (i32.const 4) - ) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$0 - (set_local $3 - (i32.wrap/i64 - (get_local $4) - ) - ) - (i32.store8 offset=15 - (get_local $7) - (i32.or - (i32.shl - (tee_local $6 - (i64.ne - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - (i32.const 7) - ) - (i32.and - (get_local $3) - (i32.const 127) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $5) - ) - (i32.const 0) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $3) - (tee_local $5 - (i32.add - (i32.load - (get_local $3) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$0 - (get_local $6) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (tee_local $6 - (i32.load - (get_local $1) - ) - ) - (tee_local $1 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$2 - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (get_local $5) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load - (get_local $3) - ) - (get_local $6) - (i32.const 8) - ) - ) - (i32.store - (get_local $3) - (tee_local $5 - (i32.add - (i32.load - (get_local $3) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $5) - ) - (i32.const 7) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load - (get_local $3) - ) - (i32.add - (get_local $6) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $3) - (tee_local $5 - (i32.add - (i32.load - (get_local $3) - ) - (i32.const 8) - ) - ) - ) - (br_if $label$2 - (i32.ne - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (get_local $1) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__16vectorIcNS6_9allocatorIcEEEE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (set_local $7 - (i64.extend_u/i32 - (i32.sub - (i32.load offset=4 - (get_local $1) - ) - (i32.load - (get_local $1) - ) - ) - ) - ) - (set_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $4 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $5 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$0 - (set_local $2 - (i32.wrap/i64 - (get_local $7) - ) - ) - (i32.store8 offset=15 - (get_local $8) - (i32.or - (i32.shl - (tee_local $3 - (i64.ne - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - (i32.const 7) - ) - (i32.and - (get_local $2) - (i32.const 127) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $4) - ) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load - (get_local $5) - ) - (i32.add - (get_local $8) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $5) - (tee_local $6 - (i32.add - (i32.load - (get_local $5) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$0 - (get_local $3) - ) - ) - (call $eosio_assert - (i32.ge_s - (i32.sub - (i32.load - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (get_local $6) - ) - (tee_local $5 - (i32.sub - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (tee_local $2 - (i32.load - (get_local $1) - ) - ) - ) - ) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (get_local $2) - (get_local $5) - ) - ) - (i32.store - (get_local $6) - (i32.add - (i32.load - (get_local $6) - ) - (get_local $5) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (set_local $7 - (i64.extend_u/i32 - (select - (i32.load offset=4 - (get_local $1) - ) - (i32.shr_u - (tee_local $5 - (i32.load8_u - (get_local $1) - ) - ) - (i32.const 1) - ) - (i32.and - (get_local $5) - (i32.const 1) - ) - ) - ) - ) - (set_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $4 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $5 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$0 - (set_local $2 - (i32.wrap/i64 - (get_local $7) - ) - ) - (i32.store8 offset=15 - (get_local $8) - (i32.or - (i32.shl - (tee_local $3 - (i64.ne - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - (i32.const 7) - ) - (i32.and - (get_local $2) - (i32.const 127) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $4) - ) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load - (get_local $5) - ) - (i32.add - (get_local $8) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $5) - (tee_local $6 - (i32.add - (i32.load - (get_local $5) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$0 - (get_local $3) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $5 - (select - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (i32.shr_u - (tee_local $5 - (i32.load8_u - (get_local $1) - ) - ) - (i32.const 1) - ) - (tee_local $2 - (i32.and - (get_local $5) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (set_local $3 - (i32.load offset=8 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.ge_s - (i32.sub - (i32.load - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (get_local $6) - ) - (get_local $5) - ) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (select - (get_local $3) - (i32.add - (get_local $1) - (i32.const 1) - ) - (get_local $2) - ) - (get_local $5) - ) - ) - (i32.store - (get_local $6) - (i32.add - (i32.load - (get_local $6) - ) - (get_local $5) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosio5token6retireENS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i64) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 160) - ) - ) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $6 - (tee_local $8 - (i64.shr_u - (tee_local $3 - (i64.load offset=8 - (get_local $1) - ) - ) - (i64.const 8) - ) - ) - ) - (block $label$0 - (block $label$1 - (loop $label$2 - (br_if $label$1 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $6) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $5 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $5 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 16) - ) - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.and - (tee_local $7 - (i32.load8_u - (get_local $2) - ) - ) - (i32.const 1) - ) - ) - (set_local $7 - (i32.shr_u - (get_local $7) - (i32.const 1) - ) - ) - (br $label$5) - ) - (set_local $7 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - (call $eosio_assert - (i32.lt_u - (get_local $7) - (i32.const 257) - ) - (i32.const 976) - ) - (set_local $2 - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 40) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i64.store offset=56 - (get_local $9) - (i64.const -1) - ) - (i64.store offset=64 - (get_local $9) - (i64.const 0) - ) - (i64.store offset=40 - (get_local $9) - (tee_local $6 - (i64.load - (get_local $0) - ) - ) - ) - (i64.store offset=48 - (get_local $9) - (get_local $8) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$7 - (br_if $label$7 - (i32.lt_s - (tee_local $7 - (call $db_find_i64 - (get_local $6) - (get_local $8) - (i64.const -4157508551318700032) - (get_local $8) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=40 - (tee_local $5 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_5token12currencystatEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $9) - (i32.const 40) - ) - (get_local $7) - ) - ) - ) - (i32.add - (get_local $9) - (i32.const 40) - ) - ) - (i32.const 96) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $5) - (i32.const 0) - ) - (i32.const 1168) - ) - (call $require_auth - (i64.load offset=32 - (get_local $5) - ) - ) - (set_local $4 - (i32.add - (get_local $5) - (i32.const 32) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.gt_u - (i64.add - (tee_local $6 - (i64.load - (get_local $1) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $7 - (i32.const 0) - ) - (block $label$9 - (loop $label$10 - (br_if $label$9 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $8) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$11 - (br_if $label$11 - (i64.ne - (i64.and - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$12 - (br_if $label$9 - (i64.ne - (i64.and - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$12 - (i32.lt_s - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $2 - (i32.const 1) - ) - (br_if $label$10 - (i32.lt_s - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$8) - ) - ) - (set_local $2 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $2) - (i32.const 544) - ) - (call $eosio_assert - (i64.gt_s - (get_local $6) - (i64.const 0) - ) - (i32.const 1216) - ) - (call $eosio_assert - (i64.eq - (get_local $3) - (i64.load offset=8 - (get_local $5) - ) - ) - (i32.const 608) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=40 - (get_local $5) - ) - (i32.add - (get_local $9) - (i32.const 40) - ) - ) - (i32.const 688) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=40 - (get_local $9) - ) - (call $current_receiver) - ) - (i32.const 736) - ) - (call $eosio_assert - (i64.eq - (get_local $3) - (tee_local $8 - (i64.load offset=8 - (get_local $5) - ) - ) - ) - (i32.const 1248) - ) - (i64.store - (get_local $5) - (tee_local $6 - (i64.sub - (i64.load - (get_local $5) - ) - (get_local $6) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $6) - (i64.const -4611686018427387904) - ) - (i32.const 1296) - ) - (call $eosio_assert - (i64.lt_s - (i64.load - (get_local $5) - ) - (i64.const 4611686018427387904) - ) - (i32.const 1328) - ) - (call $eosio_assert - (i64.eq - (tee_local $6 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.shr_u - (i64.load offset=8 - (get_local $5) - ) - (i64.const 8) - ) - ) - (i32.const 912) - ) - (i32.store offset=128 - (get_local $9) - (i32.add - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 40) - ) - ) - (i32.store offset=124 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 80) - ) - ) - (i32.store offset=120 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 80) - ) - ) - (i32.store offset=136 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 120) - ) - ) - (i32.store offset=148 - (get_local $9) - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - (i32.store offset=144 - (get_local $9) - (get_local $5) - ) - (i32.store offset=152 - (get_local $9) - (get_local $4) - ) - (call $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRKN5eosio5assetES8_RKyEEEZNS5_lsINS5_10datastreamIPcEENS5_5token12currencystatELPv0EEERT_SK_RKT0_EUlRKSJ_E_JLj0ELj1ELj2EEEEvSK_OSL_NSt3__116integer_sequenceIjJXspT1_EEEENSS_17integral_constantIbLb0EEE - (i32.add - (get_local $9) - (i32.const 144) - ) - (i32.add - (get_local $9) - (i32.const 136) - ) - ) - (call $db_update_i64 - (i32.load offset=44 - (get_local $5) - ) - (i64.const 0) - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 40) - ) - (block $label$13 - (br_if $label$13 - (i64.lt_u - (get_local $6) - (i64.load - (tee_local $7 - (i32.add - (i32.add - (get_local $9) - (i32.const 40) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $7) - (i64.add - (get_local $6) - (i64.const 1) - ) - ) - ) - (i32.store - (tee_local $7 - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 12) - ) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 12) - ) - ) - ) - (i32.store - (tee_local $5 - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - (i32.store offset=28 - (get_local $9) - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - (i32.store offset=24 - (get_local $9) - (i32.load - (get_local $1) - ) - ) - (set_local $6 - (i64.load - (get_local $4) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 12) - ) - (i32.load - (get_local $7) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.load - (get_local $5) - ) - ) - (i32.store offset=12 - (get_local $9) - (i32.load offset=28 - (get_local $9) - ) - ) - (i32.store offset=8 - (get_local $9) - (i32.load offset=24 - (get_local $9) - ) - ) - (call $_ZN5eosio5token11sub_balanceEyNS_5assetE - (get_local $0) - (get_local $6) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $1 - (i32.load offset=64 - (get_local $9) - ) - ) - ) - ) - (block $label$15 - (block $label$16 - (br_if $label$16 - (i32.eq - (tee_local $7 - (i32.load - (tee_local $2 - (i32.add - (get_local $9) - (i32.const 68) - ) - ) - ) - ) - (get_local $1) - ) - ) - (loop $label$17 - (set_local $5 - (i32.load - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (block $label$18 - (br_if $label$18 - (i32.eqz - (get_local $5) - ) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (br_if $label$17 - (i32.ne - (get_local $1) - (get_local $7) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $9) - (i32.const 64) - ) - ) - ) - (br $label$15) - ) - (set_local $7 - (get_local $1) - ) - ) - (i32.store - (get_local $2) - (get_local $1) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 160) - ) - ) - ) - (func $_ZN5eosio5token11sub_balanceEyNS_5assetE (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 40) - ) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $8) - (get_local $1) - ) - (i64.store offset=24 - (get_local $8) - (i64.const -1) - ) - (i64.store offset=32 - (get_local $8) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $8) - (i64.load - (get_local $0) - ) - ) - (call $eosio_assert - (i64.ge_s - (i64.load - (tee_local $0 - (call $_ZNK5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE3getEyPKc - (i32.add - (get_local $8) - (i32.const 8) - ) - (i64.shr_u - (tee_local $3 - (i64.load offset=8 - (get_local $2) - ) - ) - (i64.const 8) - ) - (i32.const 400) - ) - ) - ) - (tee_local $4 - (i64.load - (get_local $2) - ) - ) - ) - (i32.const 1360) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (br_if $label$2 - (i64.ne - (get_local $4) - (i64.load - (get_local $0) - ) - ) - ) - (call $_ZN5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE5eraseERKS2_ - (i32.add - (get_local $8) - (i32.const 8) - ) - (get_local $0) - ) - (br_if $label$1 - (tee_local $5 - (i32.load offset=32 - (get_local $8) - ) - ) - ) - (br $label$0) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (get_local $0) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - (i32.const 688) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $8) - ) - (call $current_receiver) - ) - (i32.const 736) - ) - (call $eosio_assert - (i64.eq - (get_local $3) - (tee_local $6 - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 1248) - ) - (i64.store - (get_local $0) - (tee_local $4 - (i64.sub - (i64.load - (get_local $0) - ) - (get_local $4) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $4) - (i64.const -4611686018427387904) - ) - (i32.const 1296) - ) - (call $eosio_assert - (i64.lt_s - (i64.load - (get_local $0) - ) - (i64.const 4611686018427387904) - ) - (i32.const 1328) - ) - (call $eosio_assert - (i64.eq - (tee_local $4 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (i64.shr_u - (i64.load offset=8 - (get_local $0) - ) - (i64.const 8) - ) - ) - (i32.const 912) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 48) - ) - (get_local $0) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.or - (i32.add - (get_local $8) - (i32.const 48) - ) - (i32.const 8) - ) - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $db_update_i64 - (i32.load offset=20 - (get_local $0) - ) - (get_local $1) - (i32.add - (get_local $8) - (i32.const 48) - ) - (i32.const 16) - ) - (block $label$3 - (br_if $label$3 - (i64.lt_u - (get_local $4) - (i64.load - (tee_local $0 - (i32.add - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $0) - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $5 - (i32.load offset=32 - (get_local $8) - ) - ) - ) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $0 - (i32.load - (tee_local $7 - (i32.add - (get_local $8) - (i32.const 36) - ) - ) - ) - ) - (get_local $5) - ) - ) - (loop $label$6 - (set_local $2 - (i32.load - (tee_local $0 - (i32.add - (get_local $0) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $0) - (i32.const 0) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$6 - (i32.ne - (get_local $5) - (get_local $0) - ) - ) - ) - (set_local $0 - (i32.load - (i32.add - (get_local $8) - (i32.const 32) - ) - ) - ) - (br $label$4) - ) - (set_local $0 - (get_local $5) - ) - ) - (i32.store - (get_local $7) - (get_local $5) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 64) - ) - ) - ) - (func $_ZN5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE5eraseERKS2_ (param $0 i32) (param $1 i32) - (local $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (get_local $1) - ) - (get_local $0) - ) - (i32.const 1392) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 1440) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $7 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - (tee_local $3 - (i32.load offset=24 - (get_local $0) - ) - ) - ) - ) - (set_local $2 - (i64.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i32.sub - (i32.const 0) - (get_local $3) - ) - ) - (set_local $8 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (loop $label$1 - (br_if $label$0 - (i64.lt_u - (i64.xor - (i64.load offset=8 - (i32.load - (get_local $8) - ) - ) - (get_local $2) - ) - (i64.const 256) - ) - ) - (set_local $7 - (get_local $8) - ) - (set_local $8 - (tee_local $4 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $4) - (get_local $6) - ) - (i32.const -24) - ) - ) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $7) - (get_local $3) - ) - (i32.const 1504) - ) - (set_local $8 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $7) - (tee_local $4 - (i32.load - (get_local $5) - ) - ) - ) - ) - (set_local $3 - (i32.sub - (i32.const 0) - (get_local $4) - ) - ) - (set_local $7 - (get_local $8) - ) - (loop $label$4 - (set_local $6 - (i32.load - (tee_local $8 - (i32.add - (get_local $7) - (i32.const 24) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (set_local $4 - (i32.load - (get_local $7) - ) - ) - (i32.store - (get_local $7) - (get_local $6) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (get_local $4) - ) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 40) - ) - ) - ) - (i64.store - (i32.add - (get_local $7) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const 32) - ) - ) - ) - (set_local $7 - (get_local $8) - ) - (br_if $label$4 - (i32.ne - (i32.add - (get_local $8) - (get_local $3) - ) - (i32.const -24) - ) - ) - ) - (br_if $label$2 - (i32.eq - (tee_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - (get_local $8) - ) - ) - ) - (loop $label$6 - (set_local $4 - (i32.load - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (get_local $4) - ) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (br_if $label$6 - (i32.ne - (get_local $8) - (get_local $7) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 28) - ) - (get_local $8) - ) - (call $db_remove_i64 - (i32.load offset=20 - (get_local $1) - ) - ) - ) - (func $_ZN5eosio5token8transferEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE (type $FUNCSIG$vijjii) (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i32) (param $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i64) - (local $8 i32) - (local $9 i64) - (local $10 i32) - (local $11 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $11 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (call $eosio_assert - (i64.ne - (get_local $1) - (get_local $2) - ) - (i32.const 1568) - ) - (call $require_auth - (get_local $1) - ) - (call $eosio_assert - (call $is_account - (get_local $2) - ) - (i32.const 1600) - ) - (set_local $5 - (i64.load offset=8 - (get_local $3) - ) - ) - (set_local $8 - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 0) - ) - (i64.store offset=80 - (get_local $11) - (tee_local $9 - (i64.shr_u - (get_local $5) - (i64.const 8) - ) - ) - ) - (i64.store offset=88 - (get_local $11) - (i64.const -1) - ) - (i64.store offset=96 - (get_local $11) - (i64.const 0) - ) - (i64.store offset=72 - (get_local $11) - (i64.load - (get_local $0) - ) - ) - (set_local $6 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_5token12currencystatEJEE3getEyPKc - (i32.add - (get_local $11) - (i32.const 72) - ) - (get_local $9) - (i32.const 512) - ) - ) - (call $require_recipient - (get_local $1) - ) - (call $require_recipient - (get_local $2) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (tee_local $7 - (i64.load - (get_local $3) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $10 - (i32.const 0) - ) - (block $label$1 - (loop $label$2 - (br_if $label$1 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $9) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $9 - (i64.shr_u - (get_local $9) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $9 - (i64.shr_u - (get_local $9) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $10 - (i32.add - (get_local $10) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $8 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $10 - (i32.add - (get_local $10) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $8 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $8) - (i32.const 544) - ) - (call $eosio_assert - (i64.gt_s - (get_local $7) - (i64.const 0) - ) - (i32.const 576) - ) - (call $eosio_assert - (i64.eq - (get_local $5) - (i64.load offset=8 - (get_local $6) - ) - ) - (i32.const 608) - ) - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.and - (tee_local $10 - (i32.load8_u - (get_local $4) - ) - ) - (i32.const 1) - ) - ) - (set_local $10 - (i32.shr_u - (get_local $10) - (i32.const 1) - ) - ) - (br $label$5) - ) - (set_local $10 - (i32.load offset=4 - (get_local $4) - ) - ) - ) - (call $eosio_assert - (i32.lt_u - (get_local $10) - (i32.const 257) - ) - (i32.const 976) - ) - (i64.store - (tee_local $10 - (i32.add - (i32.add - (get_local $11) - (i32.const 56) - ) - (i32.const 8) - ) - ) - (i64.load - (tee_local $8 - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - ) - (set_local $9 - (i64.load - (get_local $3) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $11) - (i32.const 56) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 8) - ) - (i32.load - (get_local $10) - ) - ) - (i64.store offset=56 - (get_local $11) - (get_local $9) - ) - (i32.store offset=28 - (get_local $11) - (i32.load offset=60 - (get_local $11) - ) - ) - (i32.store offset=24 - (get_local $11) - (i32.load offset=56 - (get_local $11) - ) - ) - (call $_ZN5eosio5token11sub_balanceEyNS_5assetE - (get_local $0) - (get_local $1) - (i32.add - (get_local $11) - (i32.const 24) - ) - ) - (i64.store - (tee_local $10 - (i32.add - (i32.add - (get_local $11) - (i32.const 40) - ) - (i32.const 8) - ) - ) - (i64.load - (get_local $8) - ) - ) - (set_local $9 - (i64.load - (get_local $3) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $11) - (i32.const 40) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.load - (get_local $10) - ) - ) - (i64.store offset=40 - (get_local $11) - (get_local $9) - ) - (i32.store offset=12 - (get_local $11) - (i32.load offset=44 - (get_local $11) - ) - ) - (i32.store offset=8 - (get_local $11) - (i32.load offset=40 - (get_local $11) - ) - ) - (call $_ZN5eosio5token11add_balanceEyNS_5assetEy - (get_local $0) - (get_local $2) - (i32.add - (get_local $11) - (i32.const 8) - ) - (get_local $1) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (tee_local $8 - (i32.load offset=96 - (get_local $11) - ) - ) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eq - (tee_local $10 - (i32.load - (tee_local $0 - (i32.add - (get_local $11) - (i32.const 100) - ) - ) - ) - ) - (get_local $8) - ) - ) - (loop $label$10 - (set_local $3 - (i32.load - (tee_local $10 - (i32.add - (get_local $10) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $10) - (i32.const 0) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $3) - ) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (br_if $label$10 - (i32.ne - (get_local $8) - (get_local $10) - ) - ) - ) - (set_local $10 - (i32.load - (i32.add - (get_local $11) - (i32.const 96) - ) - ) - ) - (br $label$8) - ) - (set_local $10 - (get_local $8) - ) - ) - (i32.store - (get_local $0) - (get_local $8) - ) - (call $_ZdlPv - (get_local $10) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 112) - ) - ) - ) - (func $_ZN5eosio5token12transferfromEyyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE (type $FUNCSIG$vijjjii) (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i32) (param $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i64) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (call $require_auth - (get_local $1) - ) - (call $_ZN5eosio5token12allowance_ofEyy - (i32.add - (get_local $9) - (i32.const 96) - ) - (get_local $0) - (get_local $2) - (get_local $1) - ) - (call $prints - (i32.const 1632) - ) - (call $printn - (get_local $1) - ) - (call $prints - (i32.const 1664) - ) - (call $_ZNK5eosio5asset5printEv - (get_local $4) - ) - (call $prints - (i32.const 1696) - ) - (call $printn - (get_local $2) - ) - (call $prints - (i32.const 1712) - ) - (call $printn - (get_local $3) - ) - (call $eosio_assert - (i64.ge_s - (i64.load offset=96 - (get_local $9) - ) - (i64.load - (get_local $4) - ) - ) - (i32.const 1728) - ) - (i64.store - (tee_local $7 - (i32.add - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 8) - ) - ) - (i64.load - (tee_local $6 - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - ) - (set_local $8 - (i64.load - (get_local $4) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 32) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 32) - ) - (i32.const 8) - ) - (i32.load - (get_local $7) - ) - ) - (i64.store offset=80 - (get_local $9) - (get_local $8) - ) - (i32.store offset=36 - (get_local $9) - (i32.load offset=84 - (get_local $9) - ) - ) - (i32.store offset=32 - (get_local $9) - (i32.load offset=80 - (get_local $9) - ) - ) - (call $_ZN5eosio5token11add_balanceEyNS_5assetEy - (get_local $0) - (get_local $3) - (i32.add - (get_local $9) - (i32.const 32) - ) - (get_local $1) - ) - (i64.store - (tee_local $7 - (i32.add - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 8) - ) - ) - (i64.load - (get_local $6) - ) - ) - (set_local $3 - (i64.load - (get_local $4) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 16) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 16) - ) - (i32.const 8) - ) - (i32.load - (get_local $7) - ) - ) - (i64.store offset=64 - (get_local $9) - (get_local $3) - ) - (i32.store offset=20 - (get_local $9) - (i32.load offset=68 - (get_local $9) - ) - ) - (i32.store offset=16 - (get_local $9) - (i32.load offset=64 - (get_local $9) - ) - ) - (call $_ZN5eosio5token16sub_balance_fromEyyNS_5assetE - (get_local $0) - (get_local $1) - (get_local $2) - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - (i64.store - (tee_local $7 - (i32.add - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.const 8) - ) - ) - (tee_local $3 - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 8) - ) - ) - ) - ) - (i64.store offset=48 - (get_local $9) - (i64.load offset=96 - (get_local $9) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $3) - (i64.load - (get_local $6) - ) - ) - (i32.const 1248) - ) - (i64.store offset=48 - (get_local $9) - (tee_local $3 - (i64.sub - (i64.load offset=48 - (get_local $9) - ) - (i64.load - (get_local $4) - ) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $3) - (i64.const -4611686018427387904) - ) - (i32.const 1296) - ) - (call $eosio_assert - (i64.lt_s - (get_local $3) - (i64.const 4611686018427387904) - ) - (i32.const 1328) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 8) - ) - (i64.load - (get_local $7) - ) - ) - (i64.store - (get_local $9) - (i64.load offset=48 - (get_local $9) - ) - ) - (call $_ZN5eosio5token13set_allowanceEyyNS_5assetEb - (get_local $0) - (get_local $2) - (get_local $1) - (get_local $9) - (i32.const 0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 112) - ) - ) - ) - (func $_ZN5eosio5token12allowance_ofEyy (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i64) - (local $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 40) - ) - (i32.const 0) - ) - (i64.store offset=24 - (get_local $7) - (i64.const -1) - ) - (i64.store offset=32 - (get_local $7) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $7) - (tee_local $5 - (i64.load - (get_local $1) - ) - ) - ) - (i64.store offset=16 - (get_local $7) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.lt_s - (tee_local $4 - (call $db_find_i64 - (get_local $5) - (get_local $2) - (i64.const 3774946787993190400) - (get_local $3) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=24 - (tee_local $1 - (call $_ZNK5eosio11multi_indexILy3774946787993190400ENS_5token9allowanceEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $7) - (i32.const 8) - ) - (get_local $4) - ) - ) - ) - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - (i32.const 96) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $1) - (i32.const 0) - ) - (i32.const 1840) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i64.store - (get_local $0) - (i64.load offset=8 - (get_local $1) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $4 - (i32.load offset=32 - (get_local $7) - ) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (tee_local $1 - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const 36) - ) - ) - ) - ) - (get_local $4) - ) - ) - (loop $label$4 - (set_local $0 - (i32.load - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (get_local $0) - ) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (br_if $label$4 - (i32.ne - (get_local $4) - (get_local $1) - ) - ) - ) - (set_local $1 - (i32.load - (i32.add - (get_local $7) - (i32.const 32) - ) - ) - ) - (br $label$2) - ) - (set_local $1 - (get_local $4) - ) - ) - (i32.store - (get_local $6) - (get_local $4) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 48) - ) - ) - ) - (func $_ZNK5eosio5asset5printEv (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i32) - (set_local $10 - (tee_local $2 - (i32.load offset=4 - (i32.const 0) - ) - ) - ) - (set_local $7 - (i64.const 1) - ) - (block $label$0 - (br_if $label$0 - (tee_local $5 - (i64.eqz - (tee_local $8 - (i64.load8_u offset=8 - (get_local $0) - ) - ) - ) - ) - ) - (set_local $9 - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - (set_local $7 - (i64.const 1) - ) - (loop $label$1 - (set_local $7 - (i64.mul - (get_local $7) - (i64.const 10) - ) - ) - (br_if $label$1 - (i64.gt_s - (tee_local $9 - (i64.add - (get_local $9) - (i64.const -1) - ) - ) - (i64.const 1) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (get_local $2) - (i32.and - (i32.add - (i32.wrap/i64 - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - (i32.const 15) - ) - (i32.const 1008) - ) - ) - ) - ) - (i32.store8 - (tee_local $6 - (i32.add - (get_local $2) - (tee_local $3 - (i32.wrap/i64 - (get_local $8) - ) - ) - ) - ) - (i32.const 0) - ) - (set_local $4 - (i64.load - (get_local $0) - ) - ) - (block $label$2 - (br_if $label$2 - (get_local $5) - ) - (set_local $8 - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - (set_local $9 - (i64.rem_s - (get_local $4) - (get_local $7) - ) - ) - (set_local $0 - (i32.add - (get_local $6) - (i32.const -1) - ) - ) - (loop $label$3 - (i64.store8 - (get_local $0) - (i64.add - (i64.rem_s - (get_local $9) - (i64.const 10) - ) - (i64.const 48) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const -1) - ) - ) - (set_local $9 - (i64.div_s - (get_local $9) - (i64.const 10) - ) - ) - (br_if $label$3 - (i64.gt_s - (tee_local $8 - (i64.add - (get_local $8) - (i64.const -1) - ) - ) - (i64.const 1) - ) - ) - ) - ) - (call $printi - (i64.div_s - (get_local $4) - (get_local $7) - ) - ) - (call $prints - (i32.const 1792) - ) - (call $prints_l - (get_local $2) - (get_local $3) - ) - (call $prints - (i32.const 1808) - ) - (call $_ZNK5eosio11symbol_type5printEb - (get_local $1) - (i32.const 0) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $10) - ) - ) - (func $_ZN5eosio5token16sub_balance_fromEyyNS_5assetE (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 40) - ) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $8) - (get_local $2) - ) - (i64.store offset=24 - (get_local $8) - (i64.const -1) - ) - (i64.store offset=32 - (get_local $8) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $8) - (i64.load - (get_local $0) - ) - ) - (call $eosio_assert - (i64.ge_s - (i64.load - (tee_local $0 - (call $_ZNK5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE3getEyPKc - (i32.add - (get_local $8) - (i32.const 8) - ) - (i64.shr_u - (tee_local $4 - (i64.load offset=8 - (get_local $3) - ) - ) - (i64.const 8) - ) - (i32.const 400) - ) - ) - ) - (tee_local $2 - (i64.load - (get_local $3) - ) - ) - ) - (i32.const 1360) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (br_if $label$2 - (i64.ne - (get_local $2) - (i64.load - (get_local $0) - ) - ) - ) - (call $_ZN5eosio11multi_indexILy3607749779137757184ENS_5token7accountEJEE5eraseERKS2_ - (i32.add - (get_local $8) - (i32.const 8) - ) - (get_local $0) - ) - (br_if $label$1 - (tee_local $5 - (i32.load offset=32 - (get_local $8) - ) - ) - ) - (br $label$0) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (get_local $0) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - (i32.const 688) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $8) - ) - (call $current_receiver) - ) - (i32.const 736) - ) - (call $eosio_assert - (i64.eq - (get_local $4) - (tee_local $6 - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 1248) - ) - (i64.store - (get_local $0) - (tee_local $2 - (i64.sub - (i64.load - (get_local $0) - ) - (get_local $2) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $2) - (i64.const -4611686018427387904) - ) - (i32.const 1296) - ) - (call $eosio_assert - (i64.lt_s - (i64.load - (get_local $0) - ) - (i64.const 4611686018427387904) - ) - (i32.const 1328) - ) - (call $eosio_assert - (i64.eq - (tee_local $2 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (i64.shr_u - (i64.load offset=8 - (get_local $0) - ) - (i64.const 8) - ) - ) - (i32.const 912) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 48) - ) - (get_local $0) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 272) - ) - (drop - (call $memcpy - (i32.or - (i32.add - (get_local $8) - (i32.const 48) - ) - (i32.const 8) - ) - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $db_update_i64 - (i32.load offset=20 - (get_local $0) - ) - (get_local $1) - (i32.add - (get_local $8) - (i32.const 48) - ) - (i32.const 16) - ) - (block $label$3 - (br_if $label$3 - (i64.lt_u - (get_local $2) - (i64.load - (tee_local $0 - (i32.add - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $0) - (i64.add - (get_local $2) - (i64.const 1) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $5 - (i32.load offset=32 - (get_local $8) - ) - ) - ) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $0 - (i32.load - (tee_local $7 - (i32.add - (get_local $8) - (i32.const 36) - ) - ) - ) - ) - (get_local $5) - ) - ) - (loop $label$6 - (set_local $3 - (i32.load - (tee_local $0 - (i32.add - (get_local $0) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $0) - (i32.const 0) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (get_local $3) - ) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (br_if $label$6 - (i32.ne - (get_local $5) - (get_local $0) - ) - ) - ) - (set_local $0 - (i32.load - (i32.add - (get_local $8) - (i32.const 32) - ) - ) - ) - (br $label$4) - ) - (set_local $0 - (get_local $5) - ) - ) - (i32.store - (get_local $7) - (get_local $5) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 64) - ) - ) - ) - (func $_ZNK5eosio11symbol_type5printEb (param $0 i32) (param $1 i32) - (local $2 i64) - (local $3 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $3 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $1) - ) - ) - (call $printui - (i64.load8_u - (get_local $0) - ) - ) - (call $prints - (i32.const 1824) - ) - ) - (i32.store8 offset=15 - (get_local $3) - (tee_local $0 - (i32.wrap/i64 - (i64.shr_u - (tee_local $2 - (i64.load - (get_local $0) - ) - ) - (i64.const 8) - ) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (get_local $0) - (i32.const 255) - ) - ) - ) - (call $prints_l - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const 1) - ) - (i32.store8 offset=15 - (get_local $3) - (tee_local $0 - (i32.wrap/i64 - (i64.shr_u - (get_local $2) - (i64.const 16) - ) - ) - ) - ) - (br_if $label$1 - (i32.eqz - (i32.and - (get_local $0) - (i32.const 255) - ) - ) - ) - (call $prints_l - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const 1) - ) - (i32.store8 offset=15 - (get_local $3) - (tee_local $0 - (i32.wrap/i64 - (i64.shr_u - (get_local $2) - (i64.const 24) - ) - ) - ) - ) - (br_if $label$1 - (i32.eqz - (i32.and - (get_local $0) - (i32.const 255) - ) - ) - ) - (call $prints_l - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const 1) - ) - (i32.store8 offset=15 - (get_local $3) - (tee_local $0 - (i32.wrap/i64 - (i64.shr_u - (get_local $2) - (i64.const 32) - ) - ) - ) - ) - (br_if $label$1 - (i32.eqz - (i32.and - (get_local $0) - (i32.const 255) - ) - ) - ) - (call $prints_l - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const 1) - ) - (i32.store8 offset=15 - (get_local $3) - (tee_local $0 - (i32.wrap/i64 - (i64.shr_u - (get_local $2) - (i64.const 40) - ) - ) - ) - ) - (br_if $label$1 - (i32.eqz - (i32.and - (get_local $0) - (i32.const 255) - ) - ) - ) - (call $prints_l - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const 1) - ) - (i32.store8 offset=15 - (get_local $3) - (tee_local $0 - (i32.wrap/i64 - (i64.shr_u - (get_local $2) - (i64.const 48) - ) - ) - ) - ) - (br_if $label$1 - (i32.eqz - (i32.and - (get_local $0) - (i32.const 255) - ) - ) - ) - (call $prints_l - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const 1) - ) - (i32.store8 offset=15 - (get_local $3) - (tee_local $0 - (i32.wrap/i64 - (i64.shr_u - (get_local $2) - (i64.const 56) - ) - ) - ) - ) - (br_if $label$1 - (i32.eqz - (get_local $0) - ) - ) - (call $prints_l - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - (func $apply (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1888) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (block $label$5 - (br_if $label$5 - (i64.gt_u - (get_local $6) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $3 - (select - (i32.add - (get_local $3) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $3) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $8 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $8 - (i64.shl - (i64.and - (get_local $8) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $6 - (i64.add - (get_local $6) - (i64.const 1) - ) - ) - (set_local $7 - (i64.or - (get_local $8) - (get_local $7) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (block $label$6 - (br_if $label$6 - (i64.ne - (get_local $7) - (get_local $2) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1904) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (block $label$12 - (br_if $label$12 - (i64.gt_u - (get_local $6) - (i64.const 4) - ) - ) - (br_if $label$11 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$10) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$9 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$8) - ) - (set_local $3 - (select - (i32.add - (get_local $3) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $3) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $8 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $8 - (i64.shl - (i64.and - (get_local $8) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $6 - (i64.add - (get_local $6) - (i64.const 1) - ) - ) - (set_local $7 - (i64.or - (get_local $8) - (get_local $7) - ) - ) - (br_if $label$7 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $7) - (get_local $1) - ) - (i32.const 1920) - ) - ) - (block $label$13 - (block $label$14 - (br_if $label$14 - (i64.eq - (get_local $1) - (get_local $0) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1888) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$15 - (block $label$16 - (block $label$17 - (block $label$18 - (block $label$19 - (block $label$20 - (br_if $label$20 - (i64.gt_u - (get_local $6) - (i64.const 6) - ) - ) - (br_if $label$19 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$18) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$17 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$16) - ) - (set_local $3 - (select - (i32.add - (get_local $3) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $3) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $8 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $8 - (i64.shl - (i64.and - (get_local $8) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $6 - (i64.add - (get_local $6) - (i64.const 1) - ) - ) - (set_local $7 - (i64.or - (get_local $8) - (get_local $7) - ) - ) - (br_if $label$15 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (br_if $label$13 - (i64.ne - (get_local $7) - (get_local $2) - ) - ) - ) - (i64.store offset=104 - (get_local $9) - (get_local $0) - ) - (block $label$21 - (block $label$22 - (block $label$23 - (block $label$24 - (block $label$25 - (br_if $label$25 - (i64.gt_s - (get_local $2) - (i64.const 3849304916161986559) - ) - ) - (br_if $label$24 - (i64.eq - (get_local $2) - (i64.const -4993669930013425664) - ) - ) - (br_if $label$23 - (i64.eq - (get_local $2) - (i64.const -3617168760277827584) - ) - ) - (br_if $label$13 - (i64.ne - (get_local $2) - (i64.const -3617168760271673056) - ) - ) - (i32.store offset=68 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=64 - (get_local $9) - (i32.const 1) - ) - (i64.store offset=40 align=4 - (get_local $9) - (i64.load offset=64 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_5tokenES1_JyyyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E - (i32.add - (get_local $9) - (i32.const 104) - ) - (i32.add - (get_local $9) - (i32.const 40) - ) - ) - ) - (br $label$13) - ) - (br_if $label$22 - (i64.eq - (get_local $2) - (i64.const 3849304916161986560) - ) - ) - (br_if $label$21 - (i64.eq - (get_local $2) - (i64.const 8516769789752901632) - ) - ) - (br_if $label$13 - (i64.ne - (get_local $2) - (i64.const 5031766152489992192) - ) - ) - (i32.store offset=100 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=96 - (get_local $9) - (i32.const 2) - ) - (i64.store offset=8 align=4 - (get_local $9) - (i64.load offset=96 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_5tokenES1_JyNS_5assetEEEEbPT_MT0_FvDpT1_E - (i32.add - (get_local $9) - (i32.const 104) - ) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - ) - (br $label$13) - ) - (i32.store offset=60 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=56 - (get_local $9) - (i32.const 3) - ) - (i64.store offset=48 align=4 - (get_local $9) - (i64.load offset=56 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_5tokenES1_JNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E - (i32.add - (get_local $9) - (i32.const 104) - ) - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - ) - (br $label$13) - ) - (i32.store offset=84 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=80 - (get_local $9) - (i32.const 4) - ) - (i64.store offset=24 align=4 - (get_local $9) - (i64.load offset=80 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_5tokenES1_JyyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E - (i32.add - (get_local $9) - (i32.const 104) - ) - (i32.add - (get_local $9) - (i32.const 24) - ) - ) - ) - (br $label$13) - ) - (i32.store offset=76 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=72 - (get_local $9) - (i32.const 5) - ) - (i64.store offset=32 align=4 - (get_local $9) - (i64.load offset=72 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_5tokenES1_JyyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E - (i32.add - (get_local $9) - (i32.const 104) - ) - (i32.add - (get_local $9) - (i32.const 32) - ) - ) - ) - (br $label$13) - ) - (i32.store offset=92 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=88 - (get_local $9) - (i32.const 6) - ) - (i64.store offset=16 align=4 - (get_local $9) - (i64.load offset=88 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_5tokenES1_JyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E - (i32.add - (get_local $9) - (i32.const 104) - ) - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 112) - ) - ) - ) - (func $_ZN5eosio14execute_actionINS_5tokenES1_JyNS_5assetEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (set_local $9 - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $7) - ) - (set_local $2 - (i32.load offset=4 - (get_local $1) - ) - ) - (set_local $8 - (i32.load - (get_local $1) - ) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $3 - (call $action_data_size) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.lt_u - (get_local $3) - (i32.const 513) - ) - ) - (set_local $5 - (call $malloc - (get_local $3) - ) - ) - (br $label$1) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $5 - (i32.sub - (get_local $7) - (i32.and - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $5) - (get_local $3) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 40) - ) - (i64.const 1398362884) - ) - (i64.store offset=32 - (get_local $9) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $9) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $6 - (i64.const 5462355) - ) - (block $label$3 - (loop $label$4 - (set_local $7 - (i32.const 0) - ) - (br_if $label$3 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $6) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$5 - (br_if $label$5 - (i64.ne - (i64.and - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$6 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$6 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $7 - (i32.const 1) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (call $eosio_assert - (get_local $7) - (i32.const 16) - ) - (call $eosio_assert - (i32.gt_u - (get_local $3) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $9) - (i32.const 24) - ) - (get_local $5) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (tee_local $7 - (i32.and - (get_local $3) - (i32.const -8) - ) - ) - (i32.const 8) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (tee_local $1 - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i32.add - (get_local $5) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $7) - (i32.const 16) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 16) - ) - (i32.add - (get_local $5) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (block $label$7 - (br_if $label$7 - (i32.lt_u - (get_local $3) - (i32.const 513) - ) - ) - (call $free - (get_local $5) - ) - ) - (i64.store - (tee_local $7 - (i32.add - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - (set_local $6 - (i64.load offset=24 - (get_local $9) - ) - ) - (i64.store offset=48 - (get_local $9) - (i64.load - (get_local $1) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 8) - ) - (i64.load - (get_local $7) - ) - ) - (i64.store offset=64 - (get_local $9) - (i64.load offset=48 - (get_local $9) - ) - ) - (set_local $1 - (i32.add - (get_local $0) - (i32.shr_s - (get_local $2) - (i32.const 1) - ) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.eqz - (i32.and - (get_local $2) - (i32.const 1) - ) - ) - ) - (set_local $8 - (i32.load - (i32.add - (i32.load - (get_local $1) - ) - (get_local $8) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 8) - ) - (tee_local $4 - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 8) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 8) - ) - (get_local $4) - ) - (i64.store offset=80 - (get_local $9) - (tee_local $4 - (i64.load offset=64 - (get_local $9) - ) - ) - ) - (i64.store offset=8 - (get_local $9) - (get_local $4) - ) - (call_indirect (type $FUNCSIG$viji) - (get_local $1) - (get_local $6) - (i32.add - (get_local $9) - (i32.const 8) - ) - (get_local $8) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 96) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosio14execute_actionINS_5tokenES1_JyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 80) - ) - ) - ) - (i32.store offset=60 - (tee_local $5 - (get_local $4) - ) - (get_local $0) - ) - (i32.store offset=48 - (get_local $5) - (i32.load - (get_local $1) - ) - ) - (i32.store offset=52 - (get_local $5) - (i32.load offset=4 - (get_local $1) - ) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $2 - (call $action_data_size) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (set_local $0 - (call $malloc - (get_local $2) - ) - ) - (br $label$1) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (get_local $4) - (i32.and - (i32.add - (get_local $2) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $0) - (get_local $2) - ) - ) - ) - (i64.store - (i32.add - (get_local $5) - (i32.const 24) - ) - (i64.const 1398362884) - ) - (i64.store offset=16 - (get_local $5) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $5) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $3 - (i64.const 5462355) - ) - (block $label$3 - (block $label$4 - (loop $label$5 - (br_if $label$4 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$6 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$7 - (br_if $label$4 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - (br_if $label$5 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$3) - ) - ) - (set_local $4 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 16) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 40) - ) - (i32.const 0) - ) - (i64.store offset=32 - (get_local $5) - (i64.const 0) - ) - (i32.store offset=64 - (get_local $5) - (get_local $0) - ) - (i32.store offset=72 - (get_local $5) - (tee_local $1 - (i32.add - (get_local $0) - (get_local $2) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (get_local $2) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $5) - (i32.const 8) - ) - (get_local $0) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (get_local $1) - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (i32.add - (get_local $5) - (i32.const 8) - ) - (i32.const 8) - ) - (get_local $4) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (get_local $1) - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (i32.add - (get_local $5) - (i32.const 8) - ) - (i32.const 16) - ) - (get_local $4) - (i32.const 8) - ) - ) - (i32.store offset=68 - (get_local $5) - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE - (i32.add - (get_local $5) - (i32.const 64) - ) - (i32.add - (i32.add - (get_local $5) - (i32.const 8) - ) - (i32.const 24) - ) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (call $free - (get_local $0) - ) - ) - (i32.store offset=68 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 48) - ) - ) - (i32.store offset=64 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 60) - ) - ) - (call $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionINS3_5tokenES5_JyNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJyS6_SD_EEEJLj0ELj1ELj2EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE - (i32.add - (get_local $5) - (i32.const 64) - ) - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.and - (i32.load8_u offset=32 - (get_local $5) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $5) - (i32.const 40) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 80) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosio14execute_actionINS_5tokenES1_JyyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store offset=60 - (tee_local $5 - (get_local $4) - ) - (get_local $0) - ) - (i32.store offset=48 - (get_local $5) - (i32.load - (get_local $1) - ) - ) - (i32.store offset=52 - (get_local $5) - (i32.load offset=4 - (get_local $1) - ) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $2 - (call $action_data_size) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (set_local $0 - (call $malloc - (get_local $2) - ) - ) - (br $label$1) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (get_local $4) - (i32.and - (i32.add - (get_local $2) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $0) - (get_local $2) - ) - ) - ) - (i64.store - (i32.add - (get_local $5) - (i32.const 24) - ) - (i64.const 1398362884) - ) - (i64.store offset=8 - (get_local $5) - (i64.const 0) - ) - (i64.store - (get_local $5) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $5) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $3 - (i64.const 5462355) - ) - (block $label$3 - (block $label$4 - (loop $label$5 - (br_if $label$4 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$6 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$7 - (br_if $label$4 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - (br_if $label$5 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$3) - ) - ) - (set_local $4 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 16) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 40) - ) - (i32.const 0) - ) - (i64.store offset=32 - (get_local $5) - (i64.const 0) - ) - (i32.store offset=68 - (get_local $5) - (get_local $0) - ) - (i32.store offset=64 - (get_local $5) - (get_local $0) - ) - (i32.store offset=72 - (get_local $5) - (i32.add - (get_local $0) - (get_local $2) - ) - ) - (i32.store offset=80 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 64) - ) - ) - (i32.store offset=88 - (get_local $5) - (get_local $5) - ) - (call $_ZN5boost6fusion6detail17for_each_unrolledILi4EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyyN5eosio5assetENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyyS9_SF_EEERT_SO_RNS7_IJDpT0_EEEEUlSO_E_EEvRKSN_RKT0_ - (i32.add - (get_local $5) - (i32.const 88) - ) - (i32.add - (get_local $5) - (i32.const 80) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (call $free - (get_local $0) - ) - ) - (i32.store offset=68 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 48) - ) - ) - (i32.store offset=64 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 60) - ) - ) - (call $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionINS3_5tokenES5_JyyNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJyyS6_SD_EEEJLj0ELj1ELj2ELj3EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE - (i32.add - (get_local $5) - (i32.const 64) - ) - (get_local $5) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.and - (i32.load8_u offset=32 - (get_local $5) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $5) - (i32.const 40) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 96) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosio14execute_actionINS_5tokenES1_JyyyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (i32.store offset=76 - (tee_local $5 - (get_local $4) - ) - (get_local $0) - ) - (i32.store offset=64 - (get_local $5) - (i32.load - (get_local $1) - ) - ) - (i32.store offset=68 - (get_local $5) - (i32.load offset=4 - (get_local $1) - ) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $2 - (call $action_data_size) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (set_local $0 - (call $malloc - (get_local $2) - ) - ) - (br $label$1) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (get_local $4) - (i32.and - (i32.add - (get_local $2) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $0) - (get_local $2) - ) - ) - ) - (i64.store - (i32.add - (get_local $5) - (i32.const 40) - ) - (i64.const 1398362884) - ) - (i64.store offset=16 - (get_local $5) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $5) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $5) - (i64.const 0) - ) - (i64.store offset=32 - (get_local $5) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $3 - (i64.const 5462355) - ) - (block $label$3 - (block $label$4 - (loop $label$5 - (br_if $label$4 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$6 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$7 - (br_if $label$4 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - (br_if $label$5 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$3) - ) - ) - (set_local $4 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 16) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 56) - ) - (i32.const 0) - ) - (i64.store offset=48 - (get_local $5) - (i64.const 0) - ) - (i32.store offset=84 - (get_local $5) - (get_local $0) - ) - (i32.store offset=80 - (get_local $5) - (get_local $0) - ) - (i32.store offset=88 - (get_local $5) - (i32.add - (get_local $0) - (get_local $2) - ) - ) - (i32.store offset=96 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 80) - ) - ) - (i32.store offset=104 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - (call $_ZN5boost6fusion6detail17for_each_unrolledILi5EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyyyN5eosio5assetENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyyyS9_SF_EEERT_SO_RNS7_IJDpT0_EEEEUlSO_E_EEvRKSN_RKT0_ - (i32.add - (get_local $5) - (i32.const 104) - ) - (i32.add - (get_local $5) - (i32.const 96) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (call $free - (get_local $0) - ) - ) - (i32.store offset=84 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 64) - ) - ) - (i32.store offset=80 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 76) - ) - ) - (call $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionINS3_5tokenES5_JyyyNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJyyyS6_SD_EEEJLj0ELj1ELj2ELj3ELj4EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE - (i32.add - (get_local $5) - (i32.const 80) - ) - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.and - (i32.load8_u offset=48 - (get_local $5) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $5) - (i32.const 56) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 112) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosio14execute_actionINS_5tokenES1_JNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (i32.store offset=44 - (tee_local $5 - (get_local $4) - ) - (get_local $0) - ) - (i32.store offset=32 - (get_local $5) - (i32.load - (get_local $1) - ) - ) - (i32.store offset=36 - (get_local $5) - (i32.load offset=4 - (get_local $1) - ) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $2 - (call $action_data_size) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (set_local $0 - (call $malloc - (get_local $2) - ) - ) - (br $label$1) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (get_local $4) - (i32.and - (i32.add - (get_local $2) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $0) - (get_local $2) - ) - ) - ) - (i64.store offset=8 - (get_local $5) - (i64.const 1398362884) - ) - (i64.store - (get_local $5) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 288) - ) - (set_local $3 - (i64.const 5462355) - ) - (block $label$3 - (block $label$4 - (loop $label$5 - (br_if $label$4 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$6 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$7 - (br_if $label$4 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - (br_if $label$5 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$3) - ) - ) - (set_local $4 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 16) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 24) - ) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $5) - (i64.const 0) - ) - (i32.store offset=48 - (get_local $5) - (get_local $0) - ) - (i32.store offset=56 - (get_local $5) - (tee_local $1 - (i32.add - (get_local $0) - (get_local $2) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (get_local $2) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $0) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (get_local $1) - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $5) - (i32.const 8) - ) - (get_local $4) - (i32.const 8) - ) - ) - (i32.store offset=52 - (get_local $5) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE - (i32.add - (get_local $5) - (i32.const 48) - ) - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (call $free - (get_local $0) - ) - ) - (i32.store offset=52 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 32) - ) - ) - (i32.store offset=48 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 44) - ) - ) - (call $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionINS3_5tokenES5_JNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJS6_SD_EEEJLj0ELj1EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE - (i32.add - (get_local $5) - (i32.const 48) - ) - (get_local $5) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.and - (i32.load8_u offset=16 - (get_local $5) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $5) - (i32.const 24) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 64) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (i32.store offset=24 - (get_local $7) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $7) - (i64.const 0) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__16vectorIcNS7_9allocatorIcEEEE - (get_local $0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (br_if $label$8 - (i32.ne - (tee_local $5 - (i32.load offset=20 - (get_local $7) - ) - ) - (tee_local $4 - (i32.load offset=16 - (get_local $7) - ) - ) - ) - ) - (br_if $label$7 - (i32.and - (i32.load8_u - (get_local $1) - ) - (i32.const 1) - ) - ) - (i32.store16 - (get_local $1) - (i32.const 0) - ) - (set_local $4 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (br $label$6) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store - (get_local $7) - (i64.const 0) - ) - (br_if $label$0 - (i32.ge_u - (tee_local $2 - (i32.sub - (get_local $5) - (get_local $4) - ) - ) - (i32.const -16) - ) - ) - (br_if $label$5 - (i32.ge_u - (get_local $2) - (i32.const 11) - ) - ) - (i32.store8 - (get_local $7) - (i32.shl - (get_local $2) - (i32.const 1) - ) - ) - (set_local $6 - (i32.or - (get_local $7) - (i32.const 1) - ) - ) - (br_if $label$4 - (get_local $2) - ) - (br $label$3) - ) - (i32.store8 - (i32.load offset=8 - (get_local $1) - ) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $1) - (i32.const 0) - ) - (set_local $4 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj - (get_local $1) - (i32.const 0) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (br_if $label$2 - (tee_local $4 - (i32.load offset=16 - (get_local $7) - ) - ) - ) - (br $label$1) - ) - (set_local $6 - (call $_Znwj - (tee_local $5 - (i32.and - (i32.add - (get_local $2) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store - (get_local $7) - (i32.or - (get_local $5) - (i32.const 1) - ) - ) - (i32.store offset=8 - (get_local $7) - (get_local $6) - ) - (i32.store offset=4 - (get_local $7) - (get_local $2) - ) - ) - (set_local $3 - (get_local $2) - ) - (set_local $5 - (get_local $6) - ) - (loop $label$9 - (i32.store8 - (get_local $5) - (i32.load8_u - (get_local $4) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (br_if $label$9 - (tee_local $3 - (i32.add - (get_local $3) - (i32.const -1) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (get_local $2) - ) - ) - ) - (i32.store8 - (get_local $6) - (i32.const 0) - ) - (block $label$10 - (block $label$11 - (br_if $label$11 - (i32.and - (i32.load8_u - (get_local $1) - ) - (i32.const 1) - ) - ) - (i32.store16 - (get_local $1) - (i32.const 0) - ) - (br $label$10) - ) - (i32.store8 - (i32.load offset=8 - (get_local $1) - ) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $1) - (i32.const 0) - ) - ) - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj - (get_local $1) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i64.store align=4 - (get_local $1) - (i64.load - (get_local $7) - ) - ) - (br_if $label$1 - (i32.eqz - (tee_local $4 - (i32.load offset=16 - (get_local $7) - ) - ) - ) - ) - ) - (i32.store offset=20 - (get_local $7) - (get_local $4) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 32) - ) - ) - (return - (get_local $0) - ) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (get_local $7) - ) - (unreachable) - ) - (func $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionINS3_5tokenES5_JNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJS6_SD_EEEJLj0ELj1EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $3 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i64.store - (tee_local $2 - (i32.add - (i32.add - (get_local $3) - (i32.const 32) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - (i64.store offset=32 - (get_local $3) - (i64.load - (get_local $1) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $3) - (i32.const 16) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $3) - (i32.const 48) - ) - (i32.const 8) - ) - (i64.load - (get_local $2) - ) - ) - (i64.store offset=48 - (get_local $3) - (i64.load offset=32 - (get_local $3) - ) - ) - (set_local $0 - (i32.add - (i32.load - (i32.load - (get_local $0) - ) - ) - (i32.shr_s - (tee_local $2 - (i32.load offset=4 - (tee_local $1 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $1) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (i32.and - (get_local $2) - (i32.const 1) - ) - ) - ) - (set_local $1 - (i32.load - (i32.add - (i32.load - (get_local $0) - ) - (get_local $1) - ) - ) - ) - ) - (i64.store - (tee_local $2 - (i32.add - (i32.add - (get_local $3) - (i32.const 80) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $3) - (i32.const 48) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=80 - (get_local $3) - (i64.load offset=48 - (get_local $3) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $3) - (i32.const 64) - ) - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $3) - (i32.const 8) - ) - (i64.load - (get_local $2) - ) - ) - (i64.store - (get_local $3) - (i64.load offset=80 - (get_local $3) - ) - ) - (call_indirect (type $FUNCSIG$viii) - (get_local $0) - (get_local $3) - (i32.add - (get_local $3) - (i32.const 64) - ) - (get_local $1) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (i32.load8_u offset=64 - (get_local $3) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=72 - (get_local $3) - ) - ) - ) - (block $label$2 - (br_if $label$2 - (i32.eqz - (i32.and - (i32.load8_u offset=16 - (get_local $3) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=24 - (get_local $3) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 96) - ) - ) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__16vectorIcNS7_9allocatorIcEEEE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (set_local $5 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$0 - (call $eosio_assert - (i32.lt_u - (get_local $5) - (i32.load - (get_local $2) - ) - ) - (i32.const 1984) - ) - (set_local $4 - (i32.load8_u - (tee_local $5 - (i32.load - (get_local $3) - ) - ) - ) - ) - (i32.store - (get_local $3) - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - ) - (set_local $6 - (i64.or - (i64.extend_u/i32 - (i32.shl - (i32.and - (get_local $4) - (i32.const 127) - ) - (tee_local $7 - (i32.and - (get_local $7) - (i32.const 255) - ) - ) - ) - ) - (get_local $6) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const 7) - ) - ) - (br_if $label$0 - (i32.shr_u - (get_local $4) - (i32.const 7) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.le_u - (tee_local $3 - (i32.wrap/i64 - (get_local $6) - ) - ) - (tee_local $2 - (i32.sub - (tee_local $7 - (i32.load offset=4 - (get_local $1) - ) - ) - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $1) - (i32.sub - (get_local $3) - (get_local $2) - ) - ) - (set_local $5 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - (set_local $4 - (i32.load - (get_local $1) - ) - ) - (br $label$1) - ) - (br_if $label$1 - (i32.ge_u - (get_local $3) - (get_local $2) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (tee_local $7 - (i32.add - (get_local $4) - (get_local $3) - ) - ) - ) - ) - (call $eosio_assert - (i32.ge_u - (i32.sub - (i32.load - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (get_local $5) - ) - (tee_local $5 - (i32.sub - (get_local $7) - (get_local $4) - ) - ) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $4) - (i32.load - (tee_local $7 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (get_local $5) - ) - ) - (i32.store - (get_local $7) - (i32.add - (i32.load - (get_local $7) - ) - (get_local $5) - ) - ) - (get_local $0) - ) - (func $_ZN5boost6fusion6detail17for_each_unrolledILi5EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyyyN5eosio5assetENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyyyS9_SF_EEERT_SO_RNS7_IJDpT0_EEEEUlSO_E_EEvRKSN_RKT0_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (set_local $2 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $2) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (set_local $0 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $3) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 32) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE - (i32.load - (get_local $1) - ) - (i32.add - (get_local $0) - (i32.const 40) - ) - ) - ) - ) - (func $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionINS3_5tokenES5_JyyyNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJyyyS6_SD_EEEJLj0ELj1ELj2ELj3ELj4EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE (param $0 i32) (param $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $6 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store - (i32.add - (get_local $6) - (i32.const 44) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 36) - ) - ) - ) - (i32.store - (tee_local $5 - (i32.add - (i32.add - (get_local $6) - (i32.const 32) - ) - (i32.const 8) - ) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - (i32.store offset=32 - (get_local $6) - (i32.load offset=24 - (get_local $1) - ) - ) - (i32.store offset=36 - (get_local $6) - (i32.load - (i32.add - (get_local $1) - (i32.const 28) - ) - ) - ) - (set_local $4 - (i64.load offset=16 - (get_local $1) - ) - ) - (set_local $3 - (i64.load offset=8 - (get_local $1) - ) - ) - (set_local $2 - (i64.load - (get_local $1) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $6) - (i32.const 16) - ) - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $6) - (i32.const 48) - ) - (i32.const 8) - ) - (i64.load - (get_local $5) - ) - ) - (i64.store offset=48 - (get_local $6) - (i64.load offset=32 - (get_local $6) - ) - ) - (set_local $0 - (i32.add - (i32.load - (i32.load - (get_local $0) - ) - ) - (i32.shr_s - (tee_local $5 - (i32.load offset=4 - (tee_local $1 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $1) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (i32.and - (get_local $5) - (i32.const 1) - ) - ) - ) - (set_local $1 - (i32.load - (i32.add - (i32.load - (get_local $0) - ) - (get_local $1) - ) - ) - ) - ) - (i64.store - (tee_local $5 - (i32.add - (i32.add - (get_local $6) - (i32.const 80) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $6) - (i32.const 48) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=80 - (get_local $6) - (i64.load offset=48 - (get_local $6) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $6) - (i32.const 64) - ) - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $6) - (i32.const 8) - ) - (i64.load - (get_local $5) - ) - ) - (i64.store - (get_local $6) - (i64.load offset=80 - (get_local $6) - ) - ) - (call_indirect (type $FUNCSIG$vijjjii) - (get_local $0) - (get_local $2) - (get_local $3) - (get_local $4) - (get_local $6) - (i32.add - (get_local $6) - (i32.const 64) - ) - (get_local $1) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (i32.load8_u offset=64 - (get_local $6) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=72 - (get_local $6) - ) - ) - ) - (block $label$2 - (br_if $label$2 - (i32.eqz - (i32.and - (i32.load8_u offset=16 - (get_local $6) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=24 - (get_local $6) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 96) - ) - ) - ) - (func $_ZN5boost6fusion6detail17for_each_unrolledILi4EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyyN5eosio5assetENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyyS9_SF_EEERT_SO_RNS7_IJDpT0_EEEEUlSO_E_EEvRKSN_RKT0_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (set_local $2 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (get_local $2) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (set_local $0 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $3) - ) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $3) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 384) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE - (i32.load - (get_local $1) - ) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - ) - (func $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionINS3_5tokenES5_JyyNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJyyS6_SD_EEEJLj0ELj1ELj2ELj3EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE (param $0 i32) (param $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $5 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 44) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 28) - ) - ) - ) - (i32.store - (tee_local $4 - (i32.add - (i32.add - (get_local $5) - (i32.const 32) - ) - (i32.const 8) - ) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (i32.store offset=32 - (get_local $5) - (i32.load offset=16 - (get_local $1) - ) - ) - (i32.store offset=36 - (get_local $5) - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - ) - (set_local $3 - (i64.load offset=8 - (get_local $1) - ) - ) - (set_local $2 - (i64.load - (get_local $1) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $5) - (i32.const 16) - ) - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $5) - (i32.const 48) - ) - (i32.const 8) - ) - (i64.load - (get_local $4) - ) - ) - (i64.store offset=48 - (get_local $5) - (i64.load offset=32 - (get_local $5) - ) - ) - (set_local $0 - (i32.add - (i32.load - (i32.load - (get_local $0) - ) - ) - (i32.shr_s - (tee_local $4 - (i32.load offset=4 - (tee_local $1 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $1) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (i32.and - (get_local $4) - (i32.const 1) - ) - ) - ) - (set_local $1 - (i32.load - (i32.add - (i32.load - (get_local $0) - ) - (get_local $1) - ) - ) - ) - ) - (i64.store - (tee_local $4 - (i32.add - (i32.add - (get_local $5) - (i32.const 80) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $5) - (i32.const 48) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=80 - (get_local $5) - (i64.load offset=48 - (get_local $5) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $5) - (i32.const 64) - ) - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $5) - (i32.const 8) - ) - (i64.load - (get_local $4) - ) - ) - (i64.store - (get_local $5) - (i64.load offset=80 - (get_local $5) - ) - ) - (call_indirect (type $FUNCSIG$vijjii) - (get_local $0) - (get_local $2) - (get_local $3) - (get_local $5) - (i32.add - (get_local $5) - (i32.const 64) - ) - (get_local $1) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (i32.load8_u offset=64 - (get_local $5) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=72 - (get_local $5) - ) - ) - ) - (block $label$2 - (br_if $label$2 - (i32.eqz - (i32.and - (i32.load8_u offset=16 - (get_local $5) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=24 - (get_local $5) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 96) - ) - ) - ) - (func $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionINS3_5tokenES5_JyNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJyS6_SD_EEEJLj0ELj1ELj2EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE (param $0 i32) (param $1 i32) - (local $2 i64) - (local $3 i32) - (local $4 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $4) - (i32.const 32) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - ) - (i32.store - (tee_local $3 - (i32.add - (i32.add - (get_local $4) - (i32.const 32) - ) - (i32.const 8) - ) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i32.store offset=32 - (get_local $4) - (i32.load offset=8 - (get_local $1) - ) - ) - (i32.store offset=36 - (get_local $4) - (i32.load - (i32.add - (get_local $1) - (i32.const 12) - ) - ) - ) - (set_local $2 - (i64.load - (get_local $1) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $4) - (i32.const 16) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $4) - (i32.const 48) - ) - (i32.const 8) - ) - (i64.load - (get_local $3) - ) - ) - (i64.store offset=48 - (get_local $4) - (i64.load offset=32 - (get_local $4) - ) - ) - (set_local $0 - (i32.add - (i32.load - (i32.load - (get_local $0) - ) - ) - (i32.shr_s - (tee_local $3 - (i32.load offset=4 - (tee_local $1 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $1) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (i32.and - (get_local $3) - (i32.const 1) - ) - ) - ) - (set_local $1 - (i32.load - (i32.add - (i32.load - (get_local $0) - ) - (get_local $1) - ) - ) - ) - ) - (i64.store - (tee_local $3 - (i32.add - (i32.add - (get_local $4) - (i32.const 80) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $4) - (i32.const 48) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=80 - (get_local $4) - (i64.load offset=48 - (get_local $4) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $4) - (i32.const 64) - ) - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $4) - (i32.const 8) - ) - (i64.load - (get_local $3) - ) - ) - (i64.store - (get_local $4) - (i64.load offset=80 - (get_local $4) - ) - ) - (call_indirect (type $FUNCSIG$vijii) - (get_local $0) - (get_local $2) - (get_local $4) - (i32.add - (get_local $4) - (i32.const 64) - ) - (get_local $1) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (i32.load8_u offset=64 - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=72 - (get_local $4) - ) - ) - ) - (block $label$2 - (br_if $label$2 - (i32.eqz - (i32.and - (i32.load8_u offset=16 - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=24 - (get_local $4) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $4) - (i32.const 96) - ) - ) - ) - (func $malloc (param $0 i32) (result i32) - (call $_ZN5eosio14memory_manager6mallocEm - (i32.const 1988) - (get_local $0) - ) - ) - (func $_ZN5eosio14memory_manager6mallocEm (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $1) - ) - ) - (block $label$1 - (br_if $label$1 - (tee_local $13 - (i32.load offset=8384 - (get_local $0) - ) - ) - ) - (set_local $13 - (i32.const 16) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8384) - ) - (i32.const 16) - ) - ) - (set_local $2 - (select - (i32.sub - (i32.add - (get_local $1) - (i32.const 8) - ) - (tee_local $2 - (i32.and - (i32.add - (get_local $1) - (i32.const 4) - ) - (i32.const 7) - ) - ) - ) - (get_local $1) - (get_local $2) - ) - ) - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.ge_u - (tee_local $10 - (i32.load offset=8388 - (get_local $0) - ) - ) - (get_local $13) - ) - ) - (set_local $1 - (i32.add - (i32.add - (get_local $0) - (i32.mul - (get_local $10) - (i32.const 12) - ) - ) - (i32.const 8192) - ) - ) - (block $label$5 - (br_if $label$5 - (get_local $10) - ) - (br_if $label$5 - (i32.load - (tee_local $13 - (i32.add - (get_local $0) - (i32.const 8196) - ) - ) - ) - ) - (i32.store - (get_local $1) - (i32.const 8192) - ) - (i32.store - (get_local $13) - (get_local $0) - ) - ) - (set_local $10 - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - (loop $label$6 - (block $label$7 - (br_if $label$7 - (i32.gt_u - (i32.add - (tee_local $13 - (i32.load offset=8 - (get_local $1) - ) - ) - (get_local $10) - ) - (i32.load - (get_local $1) - ) - ) - ) - (i32.store - (tee_local $13 - (i32.add - (i32.load offset=4 - (get_local $1) - ) - (get_local $13) - ) - ) - (i32.or - (i32.and - (i32.load - (get_local $13) - ) - (i32.const -2147483648) - ) - (get_local $2) - ) - ) - (i32.store - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (i32.add - (i32.load - (get_local $1) - ) - (get_local $10) - ) - ) - (i32.store - (get_local $13) - (i32.or - (i32.load - (get_local $13) - ) - (i32.const -2147483648) - ) - ) - (br_if $label$3 - (tee_local $1 - (i32.add - (get_local $13) - (i32.const 4) - ) - ) - ) - ) - (br_if $label$6 - (tee_local $1 - (call $_ZN5eosio14memory_manager16next_active_heapEv - (get_local $0) - ) - ) - ) - ) - ) - (set_local $4 - (i32.sub - (i32.const 2147483644) - (get_local $2) - ) - ) - (set_local $11 - (i32.add - (get_local $0) - (i32.const 8392) - ) - ) - (set_local $12 - (i32.add - (get_local $0) - (i32.const 8384) - ) - ) - (set_local $13 - (tee_local $3 - (i32.load offset=8392 - (get_local $0) - ) - ) - ) - (loop $label$8 - (call $eosio_assert - (i32.eq - (i32.load - (i32.add - (tee_local $1 - (i32.add - (get_local $0) - (i32.mul - (get_local $13) - (i32.const 12) - ) - ) - ) - (i32.const 8200) - ) - ) - (i32.load - (tee_local $5 - (i32.add - (get_local $1) - (i32.const 8192) - ) - ) - ) - ) - (i32.const 10384) - ) - (set_local $13 - (i32.add - (tee_local $6 - (i32.load - (i32.add - (get_local $1) - (i32.const 8196) - ) - ) - ) - (i32.const 4) - ) - ) - (loop $label$9 - (set_local $7 - (i32.add - (get_local $6) - (i32.load - (get_local $5) - ) - ) - ) - (set_local $1 - (i32.and - (tee_local $9 - (i32.load - (tee_local $8 - (i32.add - (get_local $13) - (i32.const -4) - ) - ) - ) - ) - (i32.const 2147483647) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.lt_s - (get_local $9) - (i32.const 0) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.ge_u - (get_local $1) - (get_local $2) - ) - ) - (loop $label$12 - (br_if $label$11 - (i32.ge_u - (tee_local $10 - (i32.add - (get_local $13) - (get_local $1) - ) - ) - (get_local $7) - ) - ) - (br_if $label$11 - (i32.lt_s - (tee_local $10 - (i32.load - (get_local $10) - ) - ) - (i32.const 0) - ) - ) - (br_if $label$12 - (i32.lt_u - (tee_local $1 - (i32.add - (i32.add - (get_local $1) - (i32.and - (get_local $10) - (i32.const 2147483647) - ) - ) - (i32.const 4) - ) - ) - (get_local $2) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.or - (select - (get_local $1) - (get_local $2) - (i32.lt_u - (get_local $1) - (get_local $2) - ) - ) - (i32.and - (get_local $9) - (i32.const -2147483648) - ) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.le_u - (get_local $1) - (get_local $2) - ) - ) - (i32.store - (i32.add - (get_local $13) - (get_local $2) - ) - (i32.and - (i32.add - (get_local $4) - (get_local $1) - ) - (i32.const 2147483647) - ) - ) - ) - (br_if $label$2 - (i32.ge_u - (get_local $1) - (get_local $2) - ) - ) - ) - (br_if $label$9 - (i32.lt_u - (tee_local $13 - (i32.add - (i32.add - (get_local $13) - (get_local $1) - ) - (i32.const 4) - ) - ) - (get_local $7) - ) - ) - ) - (set_local $1 - (i32.const 0) - ) - (i32.store - (get_local $11) - (tee_local $13 - (select - (i32.const 0) - (tee_local $13 - (i32.add - (i32.load - (get_local $11) - ) - (i32.const 1) - ) - ) - (i32.eq - (get_local $13) - (i32.load - (get_local $12) - ) - ) - ) - ) - ) - (br_if $label$8 - (i32.ne - (get_local $13) - (get_local $3) - ) - ) - ) - ) - (return - (get_local $1) - ) - ) - (i32.store - (get_local $8) - (i32.or - (i32.load - (get_local $8) - ) - (i32.const -2147483648) - ) - ) - (return - (get_local $13) - ) - ) - (i32.const 0) - ) - (func $_ZN5eosio14memory_manager16next_active_heapEv (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (set_local $1 - (i32.load offset=8388 - (get_local $0) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.load8_u offset=10470 - (i32.const 0) - ) - ) - ) - (set_local $7 - (i32.load offset=10472 - (i32.const 0) - ) - ) - (br $label$0) - ) - (set_local $7 - (current_memory) - ) - (i32.store8 offset=10470 - (i32.const 0) - (i32.const 1) - ) - (i32.store offset=10472 - (i32.const 0) - (tee_local $7 - (i32.shl - (get_local $7) - (i32.const 16) - ) - ) - ) - ) - (set_local $3 - (get_local $7) - ) - (block $label$2 - (block $label$3 - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.le_u - (tee_local $2 - (i32.shr_u - (i32.add - (get_local $7) - (i32.const 65535) - ) - (i32.const 16) - ) - ) - (tee_local $8 - (current_memory) - ) - ) - ) - (drop - (grow_memory - (i32.sub - (get_local $2) - (get_local $8) - ) - ) - ) - (set_local $8 - (i32.const 0) - ) - (br_if $label$4 - (i32.ne - (get_local $2) - (current_memory) - ) - ) - (set_local $3 - (i32.load offset=10472 - (i32.const 0) - ) - ) - ) - (set_local $8 - (i32.const 0) - ) - (i32.store offset=10472 - (i32.const 0) - (get_local $3) - ) - (br_if $label$4 - (i32.lt_s - (get_local $7) - (i32.const 0) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.mul - (get_local $1) - (i32.const 12) - ) - ) - ) - (set_local $7 - (i32.sub - (i32.sub - (i32.add - (get_local $7) - (select - (i32.const 65536) - (i32.const 131072) - (tee_local $6 - (i32.lt_u - (tee_local $8 - (i32.and - (get_local $7) - (i32.const 65535) - ) - ) - (i32.const 64513) - ) - ) - ) - ) - (select - (get_local $8) - (i32.and - (get_local $7) - (i32.const 131071) - ) - (get_local $6) - ) - ) - (get_local $7) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.load8_u offset=10470 - (i32.const 0) - ) - ) - (set_local $3 - (current_memory) - ) - (i32.store8 offset=10470 - (i32.const 0) - (i32.const 1) - ) - (i32.store offset=10472 - (i32.const 0) - (tee_local $3 - (i32.shl - (get_local $3) - (i32.const 16) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 8192) - ) - ) - (br_if $label$3 - (i32.lt_s - (get_local $7) - (i32.const 0) - ) - ) - (set_local $6 - (get_local $3) - ) - (block $label$7 - (br_if $label$7 - (i32.le_u - (tee_local $8 - (i32.shr_u - (i32.add - (i32.add - (tee_local $5 - (i32.and - (i32.add - (get_local $7) - (i32.const 7) - ) - (i32.const -8) - ) - ) - (get_local $3) - ) - (i32.const 65535) - ) - (i32.const 16) - ) - ) - (tee_local $4 - (current_memory) - ) - ) - ) - (drop - (grow_memory - (i32.sub - (get_local $8) - (get_local $4) - ) - ) - ) - (br_if $label$3 - (i32.ne - (get_local $8) - (current_memory) - ) - ) - (set_local $6 - (i32.load offset=10472 - (i32.const 0) - ) - ) - ) - (i32.store offset=10472 - (i32.const 0) - (i32.add - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$3 - (i32.eq - (get_local $3) - (i32.const -1) - ) - ) - (br_if $label$2 - (i32.eq - (i32.add - (tee_local $6 - (i32.load - (i32.add - (tee_local $1 - (i32.add - (get_local $0) - (i32.mul - (get_local $1) - (i32.const 12) - ) - ) - ) - (i32.const 8196) - ) - ) - ) - (tee_local $8 - (i32.load - (get_local $2) - ) - ) - ) - (get_local $3) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.eq - (get_local $8) - (tee_local $1 - (i32.load - (tee_local $5 - (i32.add - (get_local $1) - (i32.const 8200) - ) - ) - ) - ) - ) - ) - (i32.store - (tee_local $6 - (i32.add - (get_local $6) - (get_local $1) - ) - ) - (i32.or - (i32.and - (i32.load - (get_local $6) - ) - (i32.const -2147483648) - ) - (i32.add - (i32.sub - (i32.const -4) - (get_local $1) - ) - (get_local $8) - ) - ) - ) - (i32.store - (get_local $5) - (i32.load - (get_local $2) - ) - ) - (i32.store - (get_local $6) - (i32.and - (i32.load - (get_local $6) - ) - (i32.const 2147483647) - ) - ) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 8388) - ) - ) - (tee_local $2 - (i32.add - (i32.load - (get_local $2) - ) - (i32.const 1) - ) - ) - ) - (i32.store - (i32.add - (tee_local $0 - (i32.add - (get_local $0) - (i32.mul - (get_local $2) - (i32.const 12) - ) - ) - ) - (i32.const 8196) - ) - (get_local $3) - ) - (i32.store - (tee_local $8 - (i32.add - (get_local $0) - (i32.const 8192) - ) - ) - (get_local $7) - ) - ) - (return - (get_local $8) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eq - (tee_local $8 - (i32.load - (get_local $2) - ) - ) - (tee_local $7 - (i32.load - (tee_local $1 - (i32.add - (tee_local $3 - (i32.add - (get_local $0) - (i32.mul - (get_local $1) - (i32.const 12) - ) - ) - ) - (i32.const 8200) - ) - ) - ) - ) - ) - ) - (i32.store - (tee_local $3 - (i32.add - (i32.load - (i32.add - (get_local $3) - (i32.const 8196) - ) - ) - (get_local $7) - ) - ) - (i32.or - (i32.and - (i32.load - (get_local $3) - ) - (i32.const -2147483648) - ) - (i32.add - (i32.sub - (i32.const -4) - (get_local $7) - ) - (get_local $8) - ) - ) - ) - (i32.store - (get_local $1) - (i32.load - (get_local $2) - ) - ) - (i32.store - (get_local $3) - (i32.and - (i32.load - (get_local $3) - ) - (i32.const 2147483647) - ) - ) - ) - (i32.store offset=8384 - (get_local $0) - (tee_local $3 - (i32.add - (i32.load - (tee_local $7 - (i32.add - (get_local $0) - (i32.const 8388) - ) - ) - ) - (i32.const 1) - ) - ) - ) - (i32.store - (get_local $7) - (get_local $3) - ) - (return - (i32.const 0) - ) - ) - (i32.store - (get_local $2) - (i32.add - (get_local $8) - (get_local $7) - ) - ) - (get_local $2) - ) - (func $free (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (get_local $0) - ) - ) - (br_if $label$1 - (i32.lt_s - (tee_local $2 - (i32.load offset=10372 - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - (set_local $3 - (i32.const 10180) - ) - (set_local $1 - (i32.add - (i32.mul - (get_local $2) - (i32.const 12) - ) - (i32.const 10180) - ) - ) - (loop $label$2 - (br_if $label$1 - (i32.eqz - (tee_local $2 - (i32.load - (i32.add - (get_local $3) - (i32.const 4) - ) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.gt_u - (i32.add - (get_local $2) - (i32.const 4) - ) - (get_local $0) - ) - ) - (br_if $label$0 - (i32.gt_u - (i32.add - (get_local $2) - (i32.load - (get_local $3) - ) - ) - (get_local $0) - ) - ) - ) - (br_if $label$2 - (i32.lt_u - (tee_local $3 - (i32.add - (get_local $3) - (i32.const 12) - ) - ) - (get_local $1) - ) - ) - ) - ) - (return) - ) - (i32.store - (tee_local $3 - (i32.add - (get_local $0) - (i32.const -4) - ) - ) - (i32.and - (i32.load - (get_local $3) - ) - (i32.const 2147483647) - ) - ) - ) - (func $_Znwj (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (block $label$0 - (br_if $label$0 - (tee_local $0 - (call $malloc - (tee_local $1 - (select - (get_local $0) - (i32.const 1) - (get_local $0) - ) - ) - ) - ) - ) - (loop $label$1 - (set_local $0 - (i32.const 0) - ) - (br_if $label$0 - (i32.eqz - (tee_local $2 - (i32.load offset=10476 - (i32.const 0) - ) - ) - ) - ) - (call_indirect (type $FUNCSIG$v) - (get_local $2) - ) - (br_if $label$1 - (i32.eqz - (tee_local $0 - (call $malloc - (get_local $1) - ) - ) - ) - ) - ) - ) - (get_local $0) - ) - (func $_ZdlPv (param $0 i32) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $0) - ) - ) - (call $free - (get_local $0) - ) - ) - ) - (func $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv (param $0 i32) - (call $abort) - (unreachable) - ) - (func $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (block $label$0 - (br_if $label$0 - (i32.ge_u - (get_local $1) - (i32.const -16) - ) - ) - (set_local $2 - (i32.const 10) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (tee_local $5 - (i32.load8_u - (get_local $0) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $2 - (i32.add - (i32.and - (tee_local $5 - (i32.load - (get_local $0) - ) - ) - (i32.const -2) - ) - (i32.const -1) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.and - (get_local $5) - (i32.const 1) - ) - ) - (set_local $3 - (i32.shr_u - (i32.and - (get_local $5) - (i32.const 254) - ) - (i32.const 1) - ) - ) - (br $label$2) - ) - (set_local $3 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (set_local $4 - (i32.const 10) - ) - (block $label$4 - (br_if $label$4 - (i32.lt_u - (tee_local $1 - (select - (get_local $3) - (get_local $1) - (i32.gt_u - (get_local $3) - (get_local $1) - ) - ) - ) - (i32.const 11) - ) - ) - (set_local $4 - (i32.add - (i32.and - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const -16) - ) - (i32.const -1) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eq - (get_local $4) - (get_local $2) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.ne - (get_local $4) - (i32.const 10) - ) - ) - (set_local $6 - (i32.const 1) - ) - (set_local $1 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (set_local $2 - (i32.load offset=8 - (get_local $0) - ) - ) - (set_local $7 - (i32.const 0) - ) - (br $label$6) - ) - (set_local $1 - (call $_Znwj - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.gt_u - (get_local $4) - (get_local $2) - ) - ) - (br_if $label$5 - (i32.eqz - (get_local $1) - ) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.and - (tee_local $5 - (i32.load8_u - (get_local $0) - ) - ) - (i32.const 1) - ) - ) - (set_local $7 - (i32.const 1) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (set_local $6 - (i32.const 0) - ) - (br $label$6) - ) - (set_local $2 - (i32.load offset=8 - (get_local $0) - ) - ) - (set_local $6 - (i32.const 1) - ) - (set_local $7 - (i32.const 1) - ) - ) - (block $label$10 - (block $label$11 - (br_if $label$11 - (i32.and - (get_local $5) - (i32.const 1) - ) - ) - (set_local $5 - (i32.shr_u - (i32.and - (get_local $5) - (i32.const 254) - ) - (i32.const 1) - ) - ) - (br $label$10) - ) - (set_local $5 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - ) - ) - (drop - (call $memcpy - (get_local $1) - (get_local $2) - (get_local $5) - ) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (get_local $6) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (get_local $7) - ) - ) - (i32.store offset=4 - (get_local $0) - (get_local $3) - ) - (i32.store offset=8 - (get_local $0) - (get_local $1) - ) - (i32.store - (get_local $0) - (i32.or - (i32.add - (get_local $4) - (i32.const 1) - ) - (i32.const 1) - ) - ) - (return) - ) - (i32.store8 - (get_local $0) - (i32.shl - (get_local $3) - (i32.const 1) - ) - ) - ) - (return) - ) - (call $abort) - (unreachable) - ) - (func $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv (param $0 i32) - (call $abort) - (unreachable) - ) - (func $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (i64.store align=4 - (get_local $0) - (i64.const 0) - ) - (i32.store - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.and - (i32.load8_u - (get_local $1) - ) - (i32.const 1) - ) - ) - (i64.store align=4 - (get_local $0) - (i64.load align=4 - (get_local $1) - ) - ) - (i32.store - (get_local $3) - (i32.load - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - (return - (get_local $0) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $3 - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.const -16) - ) - ) - (set_local $2 - (i32.load offset=8 - (get_local $1) - ) - ) - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.ge_u - (get_local $3) - (i32.const 11) - ) - ) - (i32.store8 - (get_local $0) - (i32.shl - (get_local $3) - (i32.const 1) - ) - ) - (set_local $1 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (br_if $label$3 - (get_local $3) - ) - (br $label$2) - ) - (set_local $1 - (call $_Znwj - (tee_local $4 - (i32.and - (i32.add - (get_local $3) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store - (get_local $0) - (i32.or - (get_local $4) - (i32.const 1) - ) - ) - (i32.store offset=8 - (get_local $0) - (get_local $1) - ) - (i32.store offset=4 - (get_local $0) - (get_local $3) - ) - ) - (drop - (call $memcpy - (get_local $1) - (get_local $2) - (get_local $3) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $1) - (get_local $3) - ) - (i32.const 0) - ) - (return - (get_local $0) - ) - ) - (call $abort) - (unreachable) - ) - (func $memcmp (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $2) - ) - ) - (block $label$1 - (loop $label$2 - (br_if $label$1 - (i32.ne - (tee_local $3 - (i32.load8_u - (get_local $0) - ) - ) - (tee_local $4 - (i32.load8_u - (get_local $1) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (br_if $label$2 - (tee_local $2 - (i32.add - (get_local $2) - (i32.const -1) - ) - ) - ) - (br $label$0) - ) - ) - (set_local $5 - (i32.sub - (get_local $3) - (get_local $4) - ) - ) - ) - (get_local $5) - ) - (func $__wasm_nullptr (type $FUNCSIG$v) - (unreachable) - ) -) diff --git a/contracts/ore.usage_log/ore.usage_log.cpp b/contracts/ore.usage_log/ore.usage_log.cpp index a08ca87..3f1ad53 100644 --- a/contracts/ore.usage_log/ore.usage_log.cpp +++ b/contracts/ore.usage_log/ore.usage_log.cpp @@ -1,21 +1,20 @@ #include #include +#include #include +#include using namespace eosio; using namespace std; -class usage_log : public eosio::contract +class [[eosio::contract("ore.usage_log")]] usage_log : public eosio::contract { public: - usage_log(account_name self) : eosio::contract(self) {} + using contract::contract; + usage_log(name receiver, name code, datastream ds): contract(receiver, code, ds), _logs(receiver, receiver.value){} - //@abi action - void createlog(uint64_t instrument_id, string right_name, string token_hash, uint64_t timestamp) + ACTION createlog(uint64_t instrument_id, string right_name, string token_hash, uint64_t timestamp) { - - logs_table _logs(_self, _self); - uint64_t right_hash = hashStr(right_name); _logs.emplace(_self, [&](auto &a) { @@ -25,31 +24,29 @@ class usage_log : public eosio::contract a.token_hash = hashStr(token_hash); a.timestamp = timestamp; }); + + print("action:createlog Log created for instrument id : " + to_string(instrument_id) + " and right name " + right_name + "\n"); + } // TODO: require authority of the reconciler // delets the entry from the log table with matching token_hash - // @abi action - void deletelog(uint64_t instrument_id, string token_hash) + ACTION deletelog(uint64_t instrument_id, string token_hash) { - logs_table _logs(_self, _self); - auto itr = _logs.find(hashStr(token_hash)); - eosio_assert(itr != _logs.end(), "No log exist for the given pair or right and instrument"); + string msg = "No log exist for the given pair of instrument id " + to_string(instrument_id) + " and access token hash " + token_hash + "\n"; + eosio_assert(itr != _logs.end(), msg.c_str()); - print("token hash", itr->token_hash); + print("action:deletelog Log deleted for instrument id : " + to_string(instrument_id) + " and access token hash" + token_hash + "\n"); _logs.erase(itr); } - //@abi action - void updatecount(uint64_t instrument_id, string right_name, asset cpu) + ACTION updatecount(uint64_t instrument_id, string right_name, asset cpu) { uint64_t right_hash = hashStr(right_name); - //Test the scoping - counts_table _counts(_self, instrument_id); auto itr = _counts.find(right_hash); @@ -59,7 +56,7 @@ class usage_log : public eosio::contract _counts.emplace(_self, [&](auto &a) { a.right_hash = right_hash; a.right_name = right_name; - a.last_usage_time = now(); + a.last_usage_time = time_point_sec(now()); a.total_count = 1; a.total_cpu = cpu; }); @@ -67,16 +64,18 @@ class usage_log : public eosio::contract else { _counts.modify(itr, _self, [&](auto &a) { - a.last_usage_time = now(); + a.last_usage_time = time_point_sec(now()); a.total_count += 1; a.total_cpu += cpu; }); } + + print("action:updatecount Call count updated for instrument id : " + to_string(instrument_id) + " and right name " + right_name + "\n"); + } private: - //@abi table logs i64 - struct log + TABLE log { uint64_t instrument_id; uint64_t right_hash; @@ -89,25 +88,26 @@ class usage_log : public eosio::contract }; //following structure enables fast query of api call count for the verifier - //@abi table counts i64 - struct callcount + TABLE callcount { uint64_t right_hash; string right_name; - time last_usage_time; + time_point_sec last_usage_time; uint64_t total_count; asset total_cpu; auto primary_key() const { return right_hash; } EOSLIB_SERIALIZE(callcount, (right_hash)(right_name)(last_usage_time)(total_count)(total_cpu)) }; + + typedef eosio::multi_index<"counts"_n, callcount> counts_table; + typedef eosio::multi_index<"logs"_n, log> logs_table; - typedef eosio::multi_index counts_table; - typedef eosio::multi_index logs_table; + logs_table _logs; uint64_t hashStr(const string &strkey) { return hash{}(strkey); } }; -EOSIO_ABI(usage_log, (createlog)(deletelog)(updatecount)) +EOSIO_DISPATCH(usage_log, (createlog)(deletelog)(updatecount)) diff --git a/contracts/ore_types/ore_types.hpp b/contracts/ore_types/ore_types.hpp index c61726a..11a29dd 100644 --- a/contracts/ore_types/ore_types.hpp +++ b/contracts/ore_types/ore_types.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include "eosiolib/transaction.hpp" #include using namespace std; @@ -57,7 +57,7 @@ class ore_types : public contract { string right_name; vector urls; - vector whitelist; + vector whitelist; }; struct api_voucher_params diff --git a/tests/build_and_test.sh b/tests/build_and_test.sh index b736589..5668606 100755 --- a/tests/build_and_test.sh +++ b/tests/build_and_test.sh @@ -4,17 +4,17 @@ cd ~/ore-protocol/contracts cd ore.instrument && mkdir build -eosiocpp -g build/ore.instrument.wast ore.instrument.cpp -eosiocpp -o build/ore.instrument.abi ore.instrument.cpp +eosio-cpp ore.instrument.cpp -o build/ore.instrument.wast +eosio-abigen ore.instrument.cpp --contract=ore.instrument --output=build/ore.instrument.abi cd ../ore.rights_registry && mkdir build -eosiocpp -g build/ore.rights_registry.wast ore.rights_registry.cpp -eosiocpp -o build/ore.rights_registry.abi ore.rights_registry.cpp +eosio-cpp ore.rights_registry.cpp -o build/ore.rights_registry.wast +eosio-abigen ore.rights_registry.cpp --contract=ore.rights_registry --output=build/ore.rights_registry.abi cd ../ore.usage_log && mkdir build -eosiocpp -g build/ore.usage_log.wast ore.usage_log.cpp -eosiocpp -o build/ore.usage_log.abi ore.usage_log.cpp +eosio-cpp ore.usage_log.cpp -o build/ore.usage_log.wast +eosio-abigen ore.usage_log.cpp --contract=ore.usage_log --output=build/ore.usage_log.abi cd ../ore.standard_token && mkdir build -eosiocpp -g build/ore.standard_token.wast ore.standard_token.cpp -eosiocpp -o build/ore.standard_token.abi ore.standard_token.cpp \ No newline at end of file +eosio-cpp ore.standard_token.cpp -o build/ore.standard_token.wast +eosio-abigen ore.standard_token.cpp --contract=ore.standard_token --output=build/ore.standard_token.abi From 362e1861159b1f93bfcb951f28da49a2dee7597b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 11 Dec 2018 04:19:55 +0300 Subject: [PATCH 10/21] instrument updates --- .../ore.instrument/build/ore.instrument.wast | Bin 0 -> 91233 bytes contracts/ore.instrument/ore.instrument.cpp | 15 +++++++-------- contracts/ore.instrument/ore.instrument.hpp | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100755 contracts/ore.instrument/build/ore.instrument.wast diff --git a/contracts/ore.instrument/build/ore.instrument.wast b/contracts/ore.instrument/build/ore.instrument.wast new file mode 100755 index 0000000000000000000000000000000000000000..2cf3f948d3b04e7343c4b7add0a1a68608c18582 GIT binary patch literal 91233 zcmeFa3%Fh9S>L%X`@Z+Fma&`&Ni(dyt9Fj5{5&ccSz}VrI&~a77h)$4s7$7^Vk^k! z$hIuW#%Uc(NlXyXf+>V?2vBjgV=y(8i_4{`NeB)&Mgwthr@*6uzyMDkp0s5;nQ031 z`@iq^t-ba>7fbOifUV^0b@{IE_ujwvdslMc*llT&Bj{FmI6=}(K=_oXLj?8FIvc*fr(z3--!%BkMa zk`?c$q`gk5mwGu~$EUeBr2G5y(q4oHctn5JQFh{9b^T7izt^6=Q{CGnG^DnMr=iiY zJ+$W3Jk#{Hdsf6sb;D(tmJL{sxX4s}7~cD{>}R`QmLI(R?$NnU%vj5iIS0qC{>D+ekwwsTo3@!s&_=bZHC>peQ`l6>~5Pc}dcOgMJ%xMM<>8^OWv2K)Elb^9GhZ#n+e(>?0yKX;r{O!kX zO}44}0*?;gao{))Z$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~qm=H!$lZ{MsHdU1R4CChb*pOS{^x0gSt*gyeQ)oZ(Tom6F&|OS-W4cFKKF^a6v@99<7X}~QF*uW!CY?`DH`{Gd zs`wV7(8r%AtZmInGUslA`C;1Y0qm|aMgjXWif8F~-3}33>qRB}UB+A=fcu{BkjamH z4GV0Hat`zp=McmvyCH)hkjdfiu!mO|d(GI`#v-|=*`Rr2G?u8T{MP$5Nc+97NAZ5T z;lS~3B*SU%6jn~lgS6}$w#Yw)hR@S*bZnCT`n)OU+syO|!wzPBw@>y4jR(dX$L3>o zHvS+^kiXZD`OhCc?mvIge;)ss|Ge+Z{&V>a`#gW|ktE{p`F#uadG9y>&_2^=o=N@> DY`pm$ literal 0 HcmV?d00001 diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp index f0ecdc0..812005b 100644 --- a/contracts/ore.instrument/ore.instrument.cpp +++ b/contracts/ore.instrument/ore.instrument.cpp @@ -188,7 +188,6 @@ ACTION instrument::createinst(name minter, name owner, uint64_t instrumentId, in This is called by the update action - as the last step in the list of deferred transactions This can only be called within the instrument contract (requires _self for instr.ore) */ - ACTION instrument::updateinst(name updater, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) { require_auth(_self); @@ -201,7 +200,7 @@ ACTION instrument::updateinst(name updater, name owner, uint64_t instrumentId, i a.id = instrumentId; a.owner = owner; a.minted_by = a.minted_by; - a.minted_at = time(0); + a.minted_at = now(); a.instrument = instrument; a.revoked = false; a.start_time = start_time; @@ -229,7 +228,7 @@ ACTION instrument::checkright(name minter, name issuer, string rightname, uint64 string msg; - rights_registry rights_contract(_self,_code,_ds); + rights_registry rights_contract("rights.ore"_n,"rights.ore"_n,_ds); // check that right exists in the rights registry auto rightitr = rights_contract.find_right_by_name(rightname); @@ -290,7 +289,7 @@ ACTION instrument::checkright(name minter, name issuer, string rightname, uint64 */ ACTION instrument::update(name updater, string instrument_template, instrument_data instrument = {}, uint64_t instrument_id = 0, uint64_t start_time = 0, uint64_t end_time = 0) -{ +{ require_auth(updater); uint64_t new_start; uint64_t new_end; @@ -313,7 +312,7 @@ ACTION instrument::update(name updater, string instrument_template, instrument_d eosio_assert(item.instrument.mutability == 1 || item.instrument.mutability == 2, "the instrument to be updated is immutable"); - rights_registry rights_contract = rights_registry(_self,_code,_ds); + rights_registry rights_contract("rights.ore"_n,"rights.ore"_n,_ds); auto tokenitr = _tokens.find(item.id); @@ -368,7 +367,7 @@ ACTION instrument::update(name updater, string instrument_template, instrument_d for (int i = 0; i < item.instrument.rights.size(); i++) { deferred_instrument.actions.emplace_back( - permission_level{N(instr.ore), N(active)}, _self, N(checkright), + permission_level{"instr.ore"_n, "active"_n}, _self, "checkright"_n, std::make_tuple( updater, instrument.issuer, @@ -378,7 +377,7 @@ ACTION instrument::update(name updater, string instrument_template, instrument_d // Adding createinst action to the deferred transaction to add the new instrument to the tokens table deferred_instrument.actions.emplace_back( - permission_level{N(instr.ore), N(active)}, _self, N(updateinst), + permission_level{"instr.ore"_n, "active"_n}, _self, "updateinst"_n, std::make_tuple(updater, item.owner, instrument_id, @@ -590,4 +589,4 @@ void instrument::add_balance(name owner, asset value, name ram_payer) } } -EOSIO_DISPATCH(instrument, (transfer)(mint)(checkright)(createinst)(update)(revoke)(burn)(create)(issue)) +EOSIO_DISPATCH(instrument, (transfer)(mint)(checkright)(updateinst)(createinst)(update)(revoke)(burn)(create)(issue)) \ No newline at end of file diff --git a/contracts/ore.instrument/ore.instrument.hpp b/contracts/ore.instrument/ore.instrument.hpp index eb8c1ab..7a0beb6 100644 --- a/contracts/ore.instrument/ore.instrument.hpp +++ b/contracts/ore.instrument/ore.instrument.hpp @@ -132,6 +132,7 @@ class [[eosio::contract("ore.instrument")]] instrument : public eosio::contract ACTION burn(name burner, uint64_t token_id); ACTION create(name issuer, asset maximum_supply); ACTION createinst(name minter, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); + ACTION updateinst(name updater, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); ACTION issue(name to, asset quantity, string memo); }; From a72753f2089258bee3e8d13da4576bd517269c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 11 Dec 2018 04:31:35 +0300 Subject: [PATCH 11/21] instrument updates --- tests/build_and_test.sh | 1 - tests/instrument.py | 4 ---- 2 files changed, 5 deletions(-) diff --git a/tests/build_and_test.sh b/tests/build_and_test.sh index 5668606..c9fe1d7 100755 --- a/tests/build_and_test.sh +++ b/tests/build_and_test.sh @@ -3,7 +3,6 @@ cd ~/ore-protocol/contracts cd ore.instrument && mkdir build - eosio-cpp ore.instrument.cpp -o build/ore.instrument.wast eosio-abigen ore.instrument.cpp --contract=ore.instrument --output=build/ore.instrument.abi diff --git a/tests/instrument.py b/tests/instrument.py index 5a247a1..b7d2b25 100644 --- a/tests/instrument.py +++ b/tests/instrument.py @@ -33,15 +33,11 @@ def test_01(self): create_account("right", master, account_name="rights.ore") right_contract = Contract(right, "/root/ore-protocol/contracts/ore.rights_registry") - if(right_contract.is_deployed()): - right_contract.delete() right_contract.build() right_contract.deploy() create_account("instr", master, account_name="instr.ore") instr_contract = Contract(instr, "/root/ore-protocol/contracts/ore.instrument") - if(instr_contract.is_deployed()): - instr_contract.delete() instr_contract.build() instr_contract.deploy() From 6f6bc5ce708bbd9a0850adfaff544dd9b186d37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 11 Dec 2018 04:36:21 +0300 Subject: [PATCH 12/21] instrument test updates --- tests/instrument.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/instrument.py b/tests/instrument.py index b7d2b25..c7e7cdd 100644 --- a/tests/instrument.py +++ b/tests/instrument.py @@ -267,7 +267,7 @@ def test_05(self): { "minter": app, "owner": "notexist", - "instrumentId": 4, + "instrumentId": 50, "instrument": { "issuer": app, "instrument_class": "sample_class", From 2122bc0a17d625402c39e746eff3d2e35899a089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 11 Dec 2018 04:46:04 +0300 Subject: [PATCH 13/21] instrument test updates --- contracts/ore.instrument/ore.instrument.cpp | 2 - tests/instrument.py | 89 +++++++-------------- 2 files changed, 30 insertions(+), 61 deletions(-) diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp index 812005b..8c2e577 100644 --- a/contracts/ore.instrument/ore.instrument.cpp +++ b/contracts/ore.instrument/ore.instrument.cpp @@ -212,8 +212,6 @@ ACTION instrument::updateinst(name updater, name owner, uint64_t instrumentId, i print("minter", name{updater}); print("action:update instrument:", instrumentId, " to:", name{owner}, "\n"); - - eosio_assert(is_account(owner), "to account does not exist"); } /* diff --git a/tests/instrument.py b/tests/instrument.py index c7e7cdd..d2b8473 100644 --- a/tests/instrument.py +++ b/tests/instrument.py @@ -198,6 +198,36 @@ def test_04(self): }, permission=(app, Permission.ACTIVE)) + with self.assertRaises(Error): # Owner account doesnt exists + instr.push_action( + "mint", + { + "minter": app, + "owner": "notexists", + "instrument": { + "issuer": app, + "instrument_class": "sample_class", + "description": "sample_description", + "instrument_template": "", + "security_type": "", + "parameter_rules": [], + "rights": [{ + "right_name": "apimarket.manager.licenseApi", + "description": "licenser", + "price_in_cpu": "10", + "additional_url_params": [] + }], + "parent_instrument_id": 0, + "data": [], + "encrypted_by": "", + "mutability": 2 + }, + "start_time": 0, + "end_time": 0, + "instrumentId": 0 + }, + permission=(app, Permission.ACTIVE)) + def test_05(self): COMMENT(''' Create Instrument: @@ -260,36 +290,6 @@ def test_05(self): "end_time": 0 }, permission=(instr, Permission.ACTIVE)) - - with self.assertRaises(Error): # To account does not exists - instr.push_action( - "createinst", - { - "minter": app, - "owner": "notexist", - "instrumentId": 50, - "instrument": { - "issuer": app, - "instrument_class": "sample_class", - "description": "sample_description", - "instrument_template": "", - "security_type": "", - "parameter_rules": [], - "rights": [{ - "right_name": "apimarket.manager.licenseApi", - "description": "licenser", - "price_in_cpu": "10", - "additional_url_params": [] - }], - "parent_instrument_id": 0, - "data": [], - "encrypted_by": "", - "mutability": 2 - }, - "start_time": 0, - "end_time": 0 - }, - permission=(instr, Permission.ACTIVE)) def test_06(self): @@ -326,35 +326,6 @@ def test_06(self): }, permission=(instr, Permission.ACTIVE)) - with self.assertRaises(Error): # To account does not exists - instr.push_action( - "updateinst", - { - "updater": app, - "owner": "notexist", - "instrumentId": 2, - "instrument": { - "issuer": app, - "instrument_class": "sample_class", - "description": "sample_description", - "instrument_template": "", - "security_type": "", - "parameter_rules": [], - "rights": [{ - "right_name": "apimarket.manager.licenseApi", - "description": "licenser", - "price_in_cpu": "10", - "additional_url_params": [] - }], - "parent_instrument_id": 0, - "data": [], - "encrypted_by": "", - "mutability": 2 - }, - "start_time": 0, - "end_time": 0 - }, - permission=(instr, Permission.ACTIVE)) def test_07(self): COMMENT(''' From 5db51a90b6c7f02c6cbf4b46c42d90dea7a59e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 11 Dec 2018 04:48:46 +0300 Subject: [PATCH 14/21] repo clean --- .../ore.instrument/build/ore.instrument.wast | Bin 91233 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 contracts/ore.instrument/build/ore.instrument.wast diff --git a/contracts/ore.instrument/build/ore.instrument.wast b/contracts/ore.instrument/build/ore.instrument.wast deleted file mode 100755 index 2cf3f948d3b04e7343c4b7add0a1a68608c18582..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 91233 zcmeFa3%Fh9S>L%X`@Z+Fma&`&Ni(dyt9Fj5{5&ccSz}VrI&~a77h)$4s7$7^Vk^k! z$hIuW#%Uc(NlXyXf+>V?2vBjgV=y(8i_4{`NeB)&Mgwthr@*6uzyMDkp0s5;nQ031 z`@iq^t-ba>7fbOifUV^0b@{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!wMTz`S$KPSs z{Z?bJumq6b{ktfxX9IAL3j_kJXQRzB6nh@0d0%HE z?Jf2io9(O@<6fj;;#aPY`1%rGYe(L5{SEKEu`$1}n4UVl)LdR!ZM8dV-ClpNzOi}c z?61*}cU{I)n|J_G|C>)o@pXi>X8W`ZbkOOz)ehgi={DTBY7!#PF!CuzUYhoLxKa5m zBQy-7mDf$i6Q|PwUti_xq`L6^HNGDXCev)=(kbzL?koj&|b6#q!*B%IuMyExeD zEH+O`mp(_&BRjD7%@;-dMF!mvz=y6L1b!65H~qm=H!$lZ{MsHdU1R4CChb*pOS{^x0gSt*gyeQ)oZ(Tom6F&|OS-W4cFKKF^a6v@99<7X}~QF*uW!CY?`DH`{Gd zs`wV7(8r%AtZmInGUslA`C;1Y0qm|aMgjXWif8F~-3}33>qRB}UB+A=fcu{BkjamH z4GV0Hat`zp=McmvyCH)hkjdfiu!mO|d(GI`#v-|=*`Rr2G?u8T{MP$5Nc+97NAZ5T z;lS~3B*SU%6jn~lgS6}$w#Yw)hR@S*bZnCT`n)OU+syO|!wzPBw@>y4jR(dX$L3>o zHvS+^kiXZD`OhCc?mvIge;)ss|Ge+Z{&V>a`#gW|ktE{p`F#uadG9y>&_2^=o=N@> DY`pm$ From 1b238eae2e6a5ea1d0bd138197dbfb26fc6fea74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Fri, 4 Jan 2019 20:47:13 +0300 Subject: [PATCH 15/21] Add cancel deferred transaction in the checkRight instrument if minter is not the owner/whitelisted account --- contracts/ore.instrument/ore.instrument.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp index 3c6b72a..ceffb41 100644 --- a/contracts/ore.instrument/ore.instrument.cpp +++ b/contracts/ore.instrument/ore.instrument.cpp @@ -188,11 +188,17 @@ void instrument::checkright(account_name minter, account_name issuer, string rig if (!minter_owns_right) { auto position_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), minter); - eosio_assert(position_in_whitelist != rightitr.issuer_whitelist.end(), "minter neither owns the right nor whitelisted for the right"); + if (position_in_whitelist == rightitr.issuer_whitelist.end()) + { + if (deferred_transaction_id != 0) + { + cancel_deferred(deferred_transaction_id); + } + eosio_assert(false, "minter neither owns the right nor whitelisted for the right"); + } } bool issuer_owns_right = rightitr.owner == issuer; - if (!issuer_owns_right) { auto issuer_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), issuer); @@ -202,7 +208,7 @@ void instrument::checkright(account_name minter, account_name issuer, string rig { cancel_deferred(deferred_transaction_id); } - eosio_assert(true, "instrument issuer neither holds the right nor whitelisted for the right"); + eosio_assert(false, "instrument issuer neither holds the right nor whitelisted for the right"); } } } From 349ec8c5b71e11602cc6e59d08381c9a993932d3 Mon Sep 17 00:00:00 2001 From: Surabhi Lodha Date: Tue, 22 Jan 2019 18:46:36 +0530 Subject: [PATCH 16/21] Revert "Merge pull request #23 from API-market/108-cancel-deffered-fix" This reverts commit d874246059956571839a4b50a190f8352108457b, reversing changes made to 191c4e845e7963759edce28e7be43b5fd2b5f3be. --- contracts/ore.instrument/ore.instrument.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp index ceffb41..3c6b72a 100644 --- a/contracts/ore.instrument/ore.instrument.cpp +++ b/contracts/ore.instrument/ore.instrument.cpp @@ -188,17 +188,11 @@ void instrument::checkright(account_name minter, account_name issuer, string rig if (!minter_owns_right) { auto position_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), minter); - if (position_in_whitelist == rightitr.issuer_whitelist.end()) - { - if (deferred_transaction_id != 0) - { - cancel_deferred(deferred_transaction_id); - } - eosio_assert(false, "minter neither owns the right nor whitelisted for the right"); - } + eosio_assert(position_in_whitelist != rightitr.issuer_whitelist.end(), "minter neither owns the right nor whitelisted for the right"); } bool issuer_owns_right = rightitr.owner == issuer; + if (!issuer_owns_right) { auto issuer_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), issuer); @@ -208,7 +202,7 @@ void instrument::checkright(account_name minter, account_name issuer, string rig { cancel_deferred(deferred_transaction_id); } - eosio_assert(false, "instrument issuer neither holds the right nor whitelisted for the right"); + eosio_assert(true, "instrument issuer neither holds the right nor whitelisted for the right"); } } } From 996e864986d5f9034eabb0e5263e2ff74e5fe599 Mon Sep 17 00:00:00 2001 From: Surabhi Lodha Date: Tue, 22 Jan 2019 19:06:32 +0530 Subject: [PATCH 17/21] rebase contracts --- contracts/ore.instrument/ore.instrument.cpp | 590 ------------------ contracts/ore.instrument/ore.instrument.hpp | 249 -------- .../ore.rights_registry.cpp | 51 -- .../ore.rights_registry.hpp | 63 -- .../ore.standard_token/ore.standard_token.cpp | 233 ------- .../ore.standard_token/ore.standard_token.hpp | 151 ----- contracts/ore.usage_log/CMakeLists.txt | 8 - contracts/ore.usage_log/ore.usage_log.cpp | 113 ---- contracts/ore_types/ore_types.hpp | 80 --- 9 files changed, 1538 deletions(-) delete mode 100644 contracts/ore.instrument/ore.instrument.cpp delete mode 100644 contracts/ore.instrument/ore.instrument.hpp delete mode 100644 contracts/ore.rights_registry/ore.rights_registry.cpp delete mode 100644 contracts/ore.rights_registry/ore.rights_registry.hpp delete mode 100644 contracts/ore.standard_token/ore.standard_token.cpp delete mode 100644 contracts/ore.standard_token/ore.standard_token.hpp delete mode 100644 contracts/ore.usage_log/CMakeLists.txt delete mode 100644 contracts/ore.usage_log/ore.usage_log.cpp delete mode 100644 contracts/ore_types/ore_types.hpp diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp deleted file mode 100644 index 8c2e577..0000000 --- a/contracts/ore.instrument/ore.instrument.cpp +++ /dev/null @@ -1,590 +0,0 @@ -#include "ore.instrument.hpp" -using namespace eosio; - -/* - Creates new instrument - NOTE: this should result in changes in the following tables : - tokens - add new token - account - instrument owner's list of owned instruments get updated - accounts - OREINST symbol balance gets updated - - mint action internally calls a deferred transaction with 2 types of actions: - checkright - for each right in the instrument object, mint instrument calls check right within a deferred transaction - createinst - once all the rights are checked, the last action in the deferred transaction is createinst which adds the instrument to the tokens table - NOTE: if any of the checkright action fails, it will cancel the deferred transaction and the creatinst action will not be called. Hence no instrument will be created. - - owner - owner of the new instrument - minter - account authorized to mint the instrument's rights - either the minter or the owner should own the right (or be whitelisted by the owner of the right) - */ -ACTION instrument::mint(name minter, name owner, instrument_data instrument, - uint64_t start_time, uint64_t end_time, uint64_t instrumentId = 0) -{ - // Checking if the minter has the required authorization - require_auth(minter); - - string msg = "owner account does not exist " + owner.to_string(); - eosio_assert(is_account(owner), msg.c_str()); - - // if an instrument_template name is passed-in, look from an instrument with the same name on the chain - // ...if one exists, the new instrument will be a copy of that one - // All instruments with the same template name will have the same data - only the dates may be different - auto hashtable = _tokens.get_index<"templatehash"_n>(); - auto item = hashtable.find(hashStringToInt(instrument.instrument_template)); - - if (instrument.rights.size() == 0) - { - eosio_assert(false, "Right array is empty"); - } - - // If instrumentId value passed as 0, next available primate key will be automatically assigned as instrumentId - // So, instrumentId can't be set to 0 - if (instrumentId == 0) - { - if (_tokens.available_primary_key() == 0) //first instrument created - { - instrumentId = 1; - } - else - { - instrumentId = _tokens.available_primary_key(); - } - } - else - { - auto institr = _tokens.find(instrumentId); - // If an id value specified (other than 0) and the id already exists in the table, assertion will be thrown - eosio_assert(institr == _tokens.end(), "instrumentId exists!"); - } - - // ------- Copy an existing intstrument from a template - // If an instrument already exists with the given template name - // ... copy the instrument data from the existing instrument - // ... the owner of the new instrument is the same as existing instrument (you can't make a copy of someone else's template) - if (instrument.instrument_template != "" && item != hashtable.end()) - { - instrument.issuer = item->instrument.issuer; - instrument.instrument_class = item->instrument.instrument_class; - instrument.description = item->instrument.description; - instrument.security_type = item->instrument.security_type; - instrument.parameter_rules = item->instrument.parameter_rules; - instrument.rights = item->instrument.rights; - instrument.parent_instrument_id = item->instrument.parent_instrument_id; - instrument.data = item->instrument.data; - instrument.encrypted_by = item->instrument.encrypted_by; - instrument.mutability = item->instrument.mutability; - - // create a deferred transaction object to add instrument to the tokens table - transaction create_instrument{}; - - // create an unique id for the deferred transaction - uint64_t transaction_id = instrumentId; - - // Adding createinst action to the deferred transaction to add the new instrument to the tokens table - create_instrument.actions.emplace_back( - permission_level{"instr.ore"_n, "active"_n}, "instr.ore"_n, "createinst"_n, - std::make_tuple(minter, - owner, - instrumentId, - instrument, - start_time, - end_time, - transaction_id)); - - // send deferred transaction - create_instrument.send(transaction_id, minter); - } - else - { - // ------- Create a new intstrument - // create a deferred transaction object to check rights and add instrument to the tokens table - transaction deferred_instrument{}; - - // create an unique id for the deferred transaction - // this deferred_transaction_id is different than the actual completed transaction Id - uint64_t deferred_transaction_id = instrumentId; - - // The creation of this instrument is a series of steps grouped into one deferred transaction - - // Step 1 - add one action for each right to check if the issuer is approved to issue an instrument with that right - for (int i = 0; i < instrument.rights.size(); i++) - { - deferred_instrument.actions.emplace_back( - permission_level{"instr.ore"_n, "active"_n}, _self, "checkright"_n, - std::make_tuple( - minter, - instrument.issuer, - instrument.rights[i].right_name, - deferred_transaction_id)); - } - - // Step 2 - if all the prior actions are sucessful (did not cancel because a right was invalid) - // ... create the instrument as the last step in the transaction chain (using the createinst action) - deferred_instrument.actions.emplace_back( - permission_level{"instr.ore"_n, "active"_n}, _self, "createinst"_n, - std::make_tuple(minter, - owner, - instrumentId, - instrument, - start_time, - end_time)); - - // Step 3 - send deferred transaction - deferred_instrument.send(deferred_transaction_id, minter); - } -} - -/* - createinst creates a row in the instruments table - This is called by the mint action - as the last step in the list of deferred transactions - This can only be called within the instrument contract (requires _self for instr.ore) -*/ -ACTION instrument::createinst(name minter, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) -{ - require_auth(_self); - auto accountitr = _account.find(owner.value); - - // We track every instrumentId a user owns in the accounts table - along with total count (balance) for each user - // The first time a user creates an instrument, create a record in the accounts table in this contract - if (accountitr == _account.end()) - { - _account.emplace(_self, [&](auto &a) { - a.owner = owner; - a.balance = 0; - print("new instrument account: ", a.primary_key(), "\n"); - }); - accountitr = _account.find(owner.value); - } - - // all instruments are stored in the tokens table - _tokens.emplace(_self, [&](auto &a) { - a.id = instrumentId; - a.owner = owner; - a.minted_by = minter; - a.minted_at = now();; - a.instrument = instrument; - a.revoked = false; - a.start_time = start_time; - a.end_time = end_time; - a.template_hash = hashStringToInt(instrument.instrument_template); - a.class_hash = hashStringToInt(instrument.instrument_class); - }); - - // increasing the account balance (total token count) - _account.modify(accountitr, same_payer, [&](auto &a) { - a.balance++; - a.instruments.push_back(instrumentId); - }); - - print("action:mint Created new instrument: type: " + instrument.instrument_class + " id: " + to_string(instrumentId) + " for: " + owner.to_string() + "\n"); - - // transfer 1 OREINST from the issuer account for OREINST to the owner account of instrument - sub_balance(_self, asset(10000, symbol(symbol_code("OREINST"),4))); - add_balance(owner, asset(10000, symbol(symbol_code("OREINST"),4)), _self); -} - -/* - updateinst modifies a row in the instruments table - This is called by the update action - as the last step in the list of deferred transactions - This can only be called within the instrument contract (requires _self for instr.ore) -*/ -ACTION instrument::updateinst(name updater, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) -{ - require_auth(_self); - auto accountitr = _account.find(owner.value); - - auto tokenitr = _tokens.find(instrumentId); - - // writing to tokens table - _tokens.modify(tokenitr, same_payer, [&](auto &a) { - a.id = instrumentId; - a.owner = owner; - a.minted_by = a.minted_by; - a.minted_at = now(); - a.instrument = instrument; - a.revoked = false; - a.start_time = start_time; - a.end_time = end_time; - a.template_hash = hashStringToInt(instrument.instrument_template); - a.class_hash = hashStringToInt(instrument.instrument_class); - }); - - print("minter", name{updater}); - - print("action:update instrument:", instrumentId, " to:", name{owner}, "\n"); -} - -/* - Checks that the issuer and owner are authorized to issue an instrument that includes this right (either the owner or in whitelist) - This is called by the mint action - as part of a deferred transaction during the minting process - This is called once for each right to be added to the instrument - This can only be called within the instrument contract (requires _self for instr.ore) -*/ -ACTION instrument::checkright(name minter, name issuer, string rightname, uint64_t deferred_transaction_id = 0) -{ - require_auth(_self); - - string msg; - - rights_registry rights_contract("rights.ore"_n,"rights.ore"_n,_ds); - - // check that right exists in the rights registry - auto rightitr = rights_contract.find_right_by_name(rightname); - - if (rightitr.owner.value == 0) - { - if (deferred_transaction_id != 0) - { - cancel_deferred(deferred_transaction_id); - } - msg = "right:" + rightname + " doesn't exist"; - eosio_assert(rightitr.owner.value != 0, msg.c_str()); - } - - // check if the minter of the instrument is the issuer of the right - bool minter_owns_right = rightitr.owner == minter; - if (!minter_owns_right) - { - auto position_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), minter); - - //if minter is not in whitelist, cancel the entire mint transaction - if (position_in_whitelist == rightitr.issuer_whitelist.end()) - { - if (deferred_transaction_id != 0) - { - cancel_deferred(deferred_transaction_id); - } - msg = "Attempt to create instrument with right: " + rightname + " by minter: " + minter.to_string() + " who isn't whitelisted or owner of right"; - eosio_assert(position_in_whitelist != rightitr.issuer_whitelist.end(), msg.c_str()); - } - } - - // check if the issuer of the instrument is the owner of the right - bool issuer_owns_right = rightitr.owner == issuer; - - if (!issuer_owns_right) - { - auto issuer_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), issuer); - //if issuer is not in whitelist, cancel the entire mint transaction - if (issuer_in_whitelist == rightitr.issuer_whitelist.end()) - { - if (deferred_transaction_id != 0) - { - cancel_deferred(deferred_transaction_id); - } - msg = "Attempt to create instrument with right: " + rightname + " by issuer: " + issuer.to_string() + " who isn't whitelisted or owner of right"; - eosio_assert(issuer_in_whitelist != rightitr.issuer_whitelist.end(), msg.c_str()); - } - } -} - -/* - updates an instrument (in the tokens table) - the instrument token gets updated depending on the mutabiility - mutability = 0 - completely immutable - mutability = 1 - start_time and/or end_time can be updated - mutability = 2 - everything mutable except the owner can't be updated -*/ -ACTION instrument::update(name updater, string instrument_template, instrument_data instrument = {}, - uint64_t instrument_id = 0, uint64_t start_time = 0, uint64_t end_time = 0) -{ - require_auth(updater); - uint64_t new_start; - uint64_t new_end; - - instrument::token item; - - //find existing instrument by id or template - if (instrument_id != 0) - { - item = find_token_by_id(instrument_id); - } - else - { - item = find_token_by_template(instrument_template); - } - - eosio_assert(item.owner == updater || item.minted_by == updater, "updater acccount doesn't have the authority to change start/emd time of the instrument"); - - eosio_assert(item.revoked == false, "Token is already revoked"); - - eosio_assert(item.instrument.mutability == 1 || item.instrument.mutability == 2, "the instrument to be updated is immutable"); - - rights_registry rights_contract("rights.ore"_n,"rights.ore"_n,_ds); - - auto tokenitr = _tokens.find(item.id); - - // Update start time/ end time for mutability 1 and 2 - // No updates if the input start time/end time is 0 - if (start_time != 0) - { - new_start = start_time; - } - else - { - new_start = item.start_time; - } - - if (end_time != 0) - { - new_end = end_time; - } - else - { - new_end = item.end_time; - } - - // mutability = 1 - update dates - if (item.instrument.mutability == 1) - { - // update the instrument token in the tokens table - _tokens.modify(tokenitr, same_payer, [&](auto &a) { - a.start_time = new_start; - a.end_time = new_end; - }); - } - - // mutability = 2 - update anything - if (item.instrument.mutability == 2) - { - item.instrument.issuer = instrument.issuer; - item.instrument.instrument_class = instrument.instrument_class; - item.instrument.description = instrument.description; - item.instrument.security_type = instrument.security_type; - item.instrument.parameter_rules = instrument.parameter_rules; - item.instrument.rights = instrument.rights; - item.instrument.parent_instrument_id = instrument.parent_instrument_id; - item.instrument.data = instrument.data; - item.instrument.encrypted_by = instrument.encrypted_by; - item.instrument.mutability = instrument.mutability; - - transaction deferred_instrument{}; - - uint64_t deferred_trx_id = item.id; - - for (int i = 0; i < item.instrument.rights.size(); i++) - { - deferred_instrument.actions.emplace_back( - permission_level{"instr.ore"_n, "active"_n}, _self, "checkright"_n, - std::make_tuple( - updater, - instrument.issuer, - instrument.rights[i].right_name, - deferred_trx_id)); - } - - // Adding createinst action to the deferred transaction to add the new instrument to the tokens table - deferred_instrument.actions.emplace_back( - permission_level{"instr.ore"_n, "active"_n}, _self, "updateinst"_n, - std::make_tuple(updater, - item.owner, - instrument_id, - instrument, - start_time, - end_time)); - - // send deferred transaction - deferred_instrument.send(deferred_trx_id, _self); - } - - print("updater", name{updater}); - - print("action:update instrument:", instrument_id, "\n"); -} - -/* - transfers an instrument (owner field for the instrument gets updated to the new owner in the tokens table) - */ -ACTION instrument::transfer(name sender, name to, uint64_t instrument_id) -{ - - require_auth(sender); - - string msg; - - //find token - auto tokenitr = _tokens.find(instrument_id); - - msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; - eosio_assert(tokenitr != _tokens.end(), msg.c_str()); - - msg = "Sender account is not allowed to transfer the instrument " + sender.to_string(); - eosio_assert(tokenitr->owner == sender, msg.c_str()); - - msg = "Instrument Id " + to_string(instrument_id) + " has been previously revoked"; - eosio_assert(tokenitr->revoked == false, msg.c_str()); - - // transfer balance in the accounts table - transfer_balances(sender, to, instrument_id); - - // transfer OREINST balance - sub_balance(sender, asset(10000, symbol(symbol_code("OREINST"),4))); - add_balance(to, asset(10000, symbol(symbol_code("OREINST"),4)), sender); - _tokens.modify(tokenitr, same_payer, [&](auto &a) { - a.owner = to; - }); -} - -// revokes an instrument - A revoked instrument is no longer active and cannot be used -ACTION instrument::revoke(name revoker, uint64_t instrument_id) -{ - require_auth(revoker); - - string msg; - - //Checking if the token exists. - auto tokenitr = _tokens.find(instrument_id); - - msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; - eosio_assert(tokenitr != _tokens.end(), msg.c_str()); - - msg = "The account " + revoker.to_string() + "doesn't have authority to revoke the instrument"; - eosio_assert(tokenitr->owner == revoker, msg.c_str()); - - msg = "Instrument Id" + to_string(instrument_id) + "has been previously revoked"; - eosio_assert(tokenitr->revoked == false, msg.c_str()); - - _tokens.modify(tokenitr, same_payer, [&](auto &t) { - t.revoked = true; - }); -} - -/* - deletes an instrument (from the tokens table) - deletes only if it's mutability is 2 ( as mutability 2 means we can change anything) -*/ -ACTION instrument::burn(name burner, uint64_t instrument_id) -{ - require_auth(burner); - - string msg; - bool from = false; - - // Checking if the token exists. - auto tokenitr = _tokens.find(instrument_id); - - msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; - eosio_assert(tokenitr != _tokens.end(), msg.c_str()); - - msg = "The account " + burner.to_string() + "doesn't have authority to burn the instrument"; - eosio_assert(tokenitr->owner == burner, msg.c_str()); - - msg = "Instrument Id" + to_string(instrument_id) + "is not mutable and cannot be burned."; - eosio_assert(tokenitr->instrument.mutability == 2, msg.c_str()); - - transfer_balances(burner, same_payer, instrument_id); - sub_balance(burner, asset(10000, symbol(symbol_code("OREINST"),4))); - - _tokens.erase(tokenitr); -} - -/* - -CUSTOM_CODE- it replicates the create function of ore.standard_token - creates a new currency OREINST -*/ -ACTION instrument::create(name issuer, - asset maximum_supply) -{ - require_auth(_self); - - // Symbol is hardcoded here to prevent creating any other symbol than OREINST - // auto sym = "maximum_supply.symbol"; - eosio::symbol sym = symbol(symbol_code("OREINST"),4); - - eosio_assert(maximum_supply.symbol == sym, "symbol name must be ORINST"); - eosio_assert(sym.is_valid(), "invalid symbol name"); - eosio_assert(maximum_supply.is_valid(), "invalid supply"); - eosio_assert(maximum_supply.amount > 0, "max-supply must be positive"); - - stats statstable(_self, sym.code().raw()); - auto existing = statstable.find(sym.code().raw()); - eosio_assert(existing == statstable.end(), "token with symbol already exists"); - - statstable.emplace(_self, [&](auto &s) { - s.supply.symbol = sym; - s.max_supply = maximum_supply; - s.issuer = issuer; - }); -} - -/* - -CUSTOM_CODE-it replicates the issue function of ore.standard_token except the inline transfer action present in ore.standard_token - issue OREINST to an account -*/ -ACTION instrument::issue(name to, asset quantity, string memo) -{ - auto sym = quantity.symbol; - eosio_assert(sym.is_valid(), "invalid symbol name"); - eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); - - stats statstable(_self, sym.code().raw()); - auto existing = statstable.find(sym.code().raw()); - eosio_assert(existing != statstable.end(), "token with symbol does not exist, create token before issue"); - const auto &st = *existing; - - require_auth(st.issuer); - eosio_assert(quantity.is_valid(), "invalid quantity"); - eosio_assert(quantity.amount > 0, "must issue positive quantity"); - - eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); - eosio_assert(quantity.amount <= st.max_supply.amount - st.supply.amount, "quantity exceeds available supply"); - - statstable.modify(st, same_payer, [&](auto &s) { - s.supply += quantity; - }); - - add_balance(st.issuer, quantity, st.issuer); - - if (to != st.issuer) - { - sub_balance(st.issuer, quantity); - add_balance(to, quantity, st.issuer); - } -} - -/* - -CUSTOM_CODE-it replicates the sub_balance function of ore.standard_token - removes OREINST from an account - */ -void instrument::sub_balance(name owner, asset value) -{ - accounts from_acnts(_self, owner.value); - - const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); - eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); - - if (from.balance.amount == value.amount) - { - from_acnts.erase(from); - } - else - { - from_acnts.modify(from, owner, [&](auto &a) { - a.balance -= value; - }); - } -} - -/* - -CUSTOM_CODE-it replicates the add_balance function of ore.standard_token - adds OREINST to an account -*/ -void instrument::add_balance(name owner, asset value, name ram_payer) -{ - accounts to_acnts(_self, owner.value); - auto to = to_acnts.find(value.symbol.code().raw()); - if (to == to_acnts.end()) - { - to_acnts.emplace(ram_payer, [&](auto &a) { - a.balance = value; - }); - } - else - { - to_acnts.modify(to, same_payer, [&](auto &a) { - a.balance += value; - }); - } -} - -EOSIO_DISPATCH(instrument, (transfer)(mint)(checkright)(updateinst)(createinst)(update)(revoke)(burn)(create)(issue)) \ No newline at end of file diff --git a/contracts/ore.instrument/ore.instrument.hpp b/contracts/ore.instrument/ore.instrument.hpp deleted file mode 100644 index 7a0beb6..0000000 --- a/contracts/ore.instrument/ore.instrument.hpp +++ /dev/null @@ -1,249 +0,0 @@ -#pragma once -#include -#include -#include -#include - -#include "eosiolib/eosio.hpp" -#include "eosiolib/asset.hpp" -#include "eosiolib/print.hpp" -#include "eosiolib/transaction.hpp" -#include "eosiolib/time.hpp" -#include "../ore.rights_registry/ore.rights_registry.hpp" - -using namespace eosio; -using namespace std; - -class [[eosio::contract("ore.instrument")]] instrument : public eosio::contract -{ - public: - instrument( name receiver, name code, datastream ds): contract(receiver, code, ds), _account(receiver, receiver.value), _tokens(receiver, receiver.value) {} - - struct instrument_data - { - name issuer; - string instrument_class; - string description; - string instrument_template; - string security_type; - vector parameter_rules; - vector rights; - uint64_t parent_instrument_id; - - //example input for data: considerations - vector data; - string encrypted_by; - uint8_t mutability; // 0- immutable, 1- only datesi 2- all - }; - - TABLE token - { - //721 standard properties - uint64_t id; - name owner; - name minted_by; - uint64_t minted_at; - - //instrument properties - instrument_data instrument; - bool revoked; - uint64_t start_time; - uint64_t end_time; - - uint64_t template_hash; - uint64_t class_hash; - - uint64_t primary_key() const { return id; } - uint64_t by_owner() const { return owner.value; } - uint64_t by_template() const { return template_hash; } - uint64_t by_class() const { return class_hash; } - - EOSLIB_SERIALIZE(token, (id)(owner)(minted_by)(minted_at)(instrument)(revoked)(start_time)(end_time)(template_hash)(class_hash)) - }; - - typedef eosio::multi_index<"tokens"_n, token, - indexed_by<"owner"_n, const_mem_fun>, - indexed_by<"templatehash"_n, const_mem_fun>, - indexed_by<"classhash"_n, const_mem_fun> - >tokenindex; - - tokenindex _tokens; - - TABLE accountdata - { - name owner; - uint64_t balance; - vector instruments; - uint64_t primary_key() const { return owner.value; } - EOSLIB_SERIALIZE(accountdata, (owner)(balance)(instruments)) - }; - - typedef eosio::multi_index<"account"_n, accountdata> accountindex; - - accountindex _account; - - private: - TABLE accountbalance - { - asset balance; - - uint64_t primary_key() const { return balance.symbol.code().raw(); } - }; - - TABLE currencystat - { - asset supply; - asset max_supply; - name issuer; - - uint64_t primary_key() const { return supply.symbol.code().raw(); } - }; - - typedef eosio::multi_index<"accounts"_n, accountbalance> accounts; - typedef eosio::multi_index<"stat"_n, currencystat> stats; - - void sub_balance(name owner, asset value); - void sub_balance_from(name sender, name owner, asset value); - void add_balance(name owner, asset value, name ram_payer); - void transfer_balances(name from, name to, uint64_t instrument_id, int64_t amount = 1); - - public: - //public utility functions - token find_token_by_id(uint64_t id); - bool isToken(uint64_t id); - token find_token_by_template(string instrument_template); - bool _owns(name claimant, uint64_t token_id); - uint64_t total_supply(); - uint64_t balance_of(name owner); - name owner_of(uint64_t token_id); - - inline static uint64_t hashStringToInt(const string &strkey) - { - return hash{}(strkey); - } - - //actions - ACTION approve(name from, name to, uint64_t token_id); - ACTION mint(name minter, name owner, instrument_data instrument, uint64_t start_time, uint64_t end_time, uint64_t instrumentId); - ACTION checkright(name minter, name issuer, string rightname, uint64_t deferred_transaction_id); - ACTION update(name updater, string instrument_template, instrument_data instrument, uint64_t instrument_id, uint64_t start_time, uint64_t end_time); - ACTION transfer(name sender, name to, uint64_t token_id); - ACTION revoke(name revoker, uint64_t token_id); - ACTION burn(name burner, uint64_t token_id); - ACTION create(name issuer, asset maximum_supply); - ACTION createinst(name minter, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); - ACTION updateinst(name updater, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); - ACTION issue(name to, asset quantity, string memo); -}; - -instrument::token instrument::find_token_by_id(uint64_t id) -{ - auto tok = _tokens.find(id); - - if (tok == _tokens.end()) - eosio_assert(false, "token not found"); - - return token{ - tok->id, - tok->owner, - tok->minted_by, - tok->minted_at, - tok->instrument, - tok->revoked, - tok->start_time, - tok->end_time, - tok->template_hash, - tok->class_hash}; -} - -bool instrument::isToken(uint64_t id) -{ - auto tok = _tokens.find(id); - - if (tok == _tokens.end()) - return false; - else - return true; -} - -instrument::token instrument::find_token_by_template(string instrument_template) -{ - auto hashtable = _tokens.get_index<"templatehash"_n>(); - auto item = hashtable.find(hashStringToInt(instrument_template)); - if (item == hashtable.end()) - eosio_assert(false, "instrument with given template not found"); - return {item->id, - item->owner, - item->minted_by, - item->minted_at, - item->instrument, - item->revoked, - item->start_time, - item->end_time, - item->template_hash, - item->class_hash}; -} - -// Return an account's total balance -uint64_t instrument::balance_of(name owner) -{ - auto account = _account.find(owner.value); - return account->balance; -} - -// Returns who owns a token -name instrument::owner_of(uint64_t token_id) -{ - auto token = _tokens.find(token_id); - return token->owner; -} - -uint64_t instrument::total_supply() -{ - auto tokitr = _tokens.begin(); - uint64_t token_id = 0; - while (tokitr != _tokens.end()) - { - token_id++; - tokitr++; - } - - return token_id; -} - -// Check if account owns the token -bool instrument::_owns(name claimant, uint64_t token_id) -{ - return owner_of(token_id) == claimant; -} - -void instrument::transfer_balances(name from, name to, uint64_t instrument_id, int64_t amount) -{ - auto fromitr = _account.find(from.value); - - eosio_assert(fromitr != _account.end(), "Sender account doesn't exists"); - eosio_assert(fromitr->balance > 0, "Sender account's balance is 0"); - - _account.modify(fromitr, same_payer, [&](auto &a) { - a.balance -= amount; - a.instruments.erase(std::remove(a.instruments.begin(), a.instruments.end(), instrument_id), a.instruments.end()); - }); - - auto toitr = _account.find(to.value); - - if (toitr != _account.end()) - { - _account.modify(toitr, same_payer, [&](auto &a) { - a.balance += amount; - a.instruments.push_back(instrument_id); - }); - } - else - { - _account.emplace(from, [&](auto &a) { - a.owner = to; - a.balance = amount; - a.instruments.push_back(instrument_id); - }); - } -} \ No newline at end of file diff --git a/contracts/ore.rights_registry/ore.rights_registry.cpp b/contracts/ore.rights_registry/ore.rights_registry.cpp deleted file mode 100644 index 5d2c9d5..0000000 --- a/contracts/ore.rights_registry/ore.rights_registry.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "ore.rights_registry.hpp" - -using namespace eosio; - -// transfer action -ACTION rights_registry::upsertright(name owner, string &right_name, vector urls, vector issuer_whitelist) -{ - require_auth(owner); - - auto itr = _rights.find(hashStr(right_name)); - - if (itr == _rights.end()) - { - _rights.emplace(owner, [&](auto &end) { - end.id = hashStr(right_name); - end.right_name = right_name; - end.owner = owner; - end.urls = urls; - end.issuer_whitelist = issuer_whitelist; - }); - - print("action:upsertright Right: " + right_name + " added:" + " by: " + owner.to_string() + "\n"); - - } - else - { - string msg = "The account " + owner.to_string() + " is not the owner of the right " + right_name + " and cannot modify it."; - eosio_assert(itr->owner == owner, msg.c_str()); - - _rights.modify(itr, owner, [&](auto &end) { - end.urls = urls; - end.issuer_whitelist = issuer_whitelist; - }); - - print("action:upsertright Right: " + right_name + " modified by: " + owner.to_string() + "\n"); - } -} - -ACTION rights_registry::deleteright(name owner, string &right_name) -{ - require_auth(owner); - - auto itr = _rights.find(hashStr(right_name)); - - string msg = "The right " + right_name + " doesn't exist "; - - eosio_assert(itr != _rights.end(), msg.c_str()); - _rights.erase(itr); -} - -EOSIO_DISPATCH(rights_registry, (upsertright)(deleteright)) diff --git a/contracts/ore.rights_registry/ore.rights_registry.hpp b/contracts/ore.rights_registry/ore.rights_registry.hpp deleted file mode 100644 index 602a962..0000000 --- a/contracts/ore.rights_registry/ore.rights_registry.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ -#pragma once -#include - -#include "eosiolib/eosio.hpp" -#include "../ore_types/ore_types.hpp" - -using namespace eosio; -using namespace std; - -class [[eosio::contract("ore.rights_registry")]] rights_registry : public eosio::contract -{ - public: - using contract::contract; - rights_registry( name receiver, name code, datastream ds): contract(receiver, code, ds), _rights(receiver, receiver.value){} - - TABLE right_reg - { - uint64_t id; - string right_name; - name owner; - vector urls; - vector issuer_whitelist; - - uint64_t primary_key() const { return id; } - - EOSLIB_SERIALIZE(right_reg, (id)(right_name)(owner)(urls)(issuer_whitelist)) - }; - - typedef eosio::multi_index<"rights"_n, right_reg>right_registration_index; - - public: - right_registration_index _rights; - - ACTION upsertright(name owner, string &right_name, vector urls, vector issuer_whitelist); - - ACTION deleteright(name owner, string &right_name); - - inline static uint64_t hashStr(const string &strkey) - { - return hash{}(strkey); - } - - right_reg find_right_by_name(string right_name) - { - auto rightitr = _rights.find(hashStr(right_name)); - - if (rightitr == _rights.end()) - { - return right_reg{0}; - } - - return right_reg{ - rightitr->id, - rightitr->right_name, - rightitr->owner, - rightitr->urls, - rightitr->issuer_whitelist}; - } -}; \ No newline at end of file diff --git a/contracts/ore.standard_token/ore.standard_token.cpp b/contracts/ore.standard_token/ore.standard_token.cpp deleted file mode 100644 index 2d70bd6..0000000 --- a/contracts/ore.standard_token/ore.standard_token.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ - -/** - * Following contract adheres to eosio.token standards. - * It copies all the functionalities of eosio.token. In addition to that, it implements functions for allowance model as in ERC-20 - */ - -/** - * NOTE: Any changes to create, issue, transfer, sub_balance, sub_balance_from and add_balance functions should be replicated - * in the implementation of the same functions in ore.instrument contract. - */ - -#include "ore.standard_token.hpp" - -namespace eosio -{ - -ACTION token::create(name issuer, - asset maximum_supply) -{ - require_auth(_self); - - auto sym = maximum_supply.symbol; - eosio_assert(sym.is_valid(), "invalid symbol name"); - eosio_assert(maximum_supply.is_valid(), "invalid supply"); - eosio_assert(maximum_supply.amount > 0, "max-supply must be positive"); - - stats statstable(_self, sym.code().raw()); - auto existing = statstable.find(sym.code().raw()); - eosio_assert(existing == statstable.end(), "token with symbol already exists"); - - statstable.emplace(_self, [&](auto &s) { - s.supply.symbol = maximum_supply.symbol; - s.max_supply = maximum_supply; - s.issuer = issuer; - }); -} - -// The approve action is called by "from" account to authorize "to" account to call the transferfrom function on it's behalf -ACTION token::approve(name from, name to, asset quantity, string memo) -{ - require_auth(from); - - accounts from_acnts(_self, from.value); - - const auto &from_account = from_acnts.get(quantity.symbol.code().raw(), "no balance object found"); - eosio_assert(from_account.balance.amount >= quantity.amount, "amount being approved is more than the balance of the approver account"); - - set_allowance(from, to, quantity, true); -} - -ACTION token::issue(name to, asset quantity, string memo) -{ - auto sym = quantity.symbol; - eosio_assert(sym.is_valid(), "invalid symbol name"); - eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); - - stats statstable(_self, sym.code().raw()); - auto existing = statstable.find(sym.code().raw()); - eosio_assert(existing != statstable.end(), "token with symbol does not exist, create token before issue"); - const auto &st = *existing; - - require_auth(st.issuer); - eosio_assert(quantity.is_valid(), "invalid quantity"); - eosio_assert(quantity.amount > 0, "must issue positive quantity"); - - eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); - eosio_assert(quantity.amount <= st.max_supply.amount - st.supply.amount, "quantity exceeds available supply"); - - statstable.modify(st, same_payer, [&](auto &s) { - s.supply += quantity; - }); - - add_balance(st.issuer, quantity, st.issuer); - - if (to != st.issuer) - { - SEND_INLINE_ACTION(*this, transfer, {st.issuer, "active"_n}, {st.issuer, to, quantity, memo}); - } -} - -ACTION token::retire(asset quantity, string memo) -{ - auto sym = quantity.symbol; - eosio_assert(sym.is_valid(), "invalid symbol name"); - eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); - - stats statstable(_self, sym.code().raw()); - auto existing = statstable.find(sym.code().raw()); - eosio_assert(existing != statstable.end(), "token with symbol does not exist"); - const auto &st = *existing; - - require_auth(st.issuer); - eosio_assert(quantity.is_valid(), "invalid quantity"); - eosio_assert(quantity.amount > 0, "must retire positive quantity"); - - eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); - - statstable.modify(st, same_payer, [&](auto &s) { - s.supply -= quantity; - }); - - sub_balance(st.issuer, quantity); -} - -ACTION token::transfer(name from, - name to, - asset quantity, - string memo) -{ - eosio_assert(from != to, "cannot transfer to self"); - require_auth(from); - eosio_assert(is_account(to), "to account does not exist"); - auto sym = quantity.symbol.code(); - stats statstable(_self, sym.raw()); - const auto &st = statstable.get(sym.raw()); - - require_recipient(from); - require_recipient(to); - - eosio_assert(quantity.is_valid(), "invalid quantity"); - eosio_assert(quantity.amount > 0, "must transfer positive quantity"); - eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); - eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); - - auto payer = has_auth(to) ? to : from; - - sub_balance(from, quantity); - add_balance(to, quantity, payer); -} - -// This action is called by the approved "sender" account on behalf of the "from" account to transfer "quantity" to "to" account -ACTION token::transferfrom(name sender, name from, name to, asset quantity, string memo) -{ - require_auth(sender); - - auto allowance = token::allowance_of(from, sender); - - print("The approved account ", name{sender}); - print(" is transferring ", quantity); - print(" from ", name{from}); - print(" to ", name{to}); - - eosio_assert(allowance.amount >= quantity.amount, "the amount being transferred is more than the approved amount"); - - add_balance(to, quantity, sender); - sub_balance_from(sender, from, quantity); - - set_allowance(from, sender, allowance - quantity, false); -} - -// eosio.token standard sub_balance function -void token::sub_balance(name owner, asset value) -{ - accounts from_acnts(_self, owner.value); - - const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); - eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); - - { - from_acnts.modify(from, owner, [&](auto &a) { - a.balance -= value; - }); - } -} - -// It is used by transfer_from account to specify the RAM payer as the "sender" account and not the "owner" account as in the sub_balance function -void token::sub_balance_from(name sender, name owner, asset value) -{ - accounts from_acnts(_self, owner.value); - - const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); - eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); - - from_acnts.modify(from, sender, [&](auto &a) { - a.balance -= value; - }); -} - -void token::add_balance(name owner, asset value, name ram_payer) -{ - accounts to_acnts(_self, owner.value); - auto to = to_acnts.find(value.symbol.code().raw()); - if (to == to_acnts.end()) - { - to_acnts.emplace(ram_payer, [&](auto &a) { - a.balance = value; - }); - } - else - { - to_acnts.modify(to, same_payer, [&](auto &a) { - a.balance += value; - }); - } -} - -ACTION token::open(name owner, const symbol &symbol, name ram_payer) -{ - require_auth(ram_payer); - - auto sym_code_raw = symbol.code().raw(); - - stats statstable(_self, sym_code_raw); - const auto &st = statstable.get(sym_code_raw, "symbol does not exist"); - eosio_assert(st.supply.symbol == symbol, "symbol precision mismatch"); - - accounts acnts(_self, owner.value); - auto it = acnts.find(sym_code_raw); - if (it == acnts.end()) - { - acnts.emplace(ram_payer, [&](auto &a) { - a.balance = asset{0, symbol}; - }); - } -} - -ACTION token::close(name owner, const symbol &symbol) -{ - require_auth(owner); - accounts acnts(_self, owner.value); - auto it = acnts.find(symbol.code().raw()); - eosio_assert(it != acnts.end(), "Balance row already deleted or never existed. Action won't have any effect."); - eosio_assert(it->balance.amount == 0, "Cannot close because the balance is not zero."); - acnts.erase(it); -} - -} // namespace eosio - -EOSIO_DISPATCH( eosio::token, (create)(issue)(transfer)(approve)(transferfrom)(open)(close)(retire)) \ No newline at end of file diff --git a/contracts/ore.standard_token/ore.standard_token.hpp b/contracts/ore.standard_token/ore.standard_token.hpp deleted file mode 100644 index 2aa875f..0000000 --- a/contracts/ore.standard_token/ore.standard_token.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ -#pragma once - -#include "eosiolib/asset.hpp" -#include "eosiolib/eosio.hpp" - -#include - -namespace eosiosystem -{ -class system_contract; -} - -namespace eosio -{ - -using std::string; - -class[[eosio::contract("ore.standard_token")]] token : public contract -{ - public: - using contract::contract; - - ACTION create(name issuer, asset maximum_supply); - - ACTION issue(name to, asset quantity, string memo); - - ACTION retire(asset quantity, string memo); - - ACTION transfer(name from, name to, asset quantity, string memo); - - ACTION approve(name from, name to, asset quantity, string memo); - - ACTION transferfrom(name sender, name from, name to, asset quantity, string memo); - - ACTION open(name owner, const symbol &symbol, name ram_payer); - - ACTION close(name owner, const symbol &symbol); - - static asset get_supply( name token_contract_account, symbol_code sym_code ) - { - stats statstable( token_contract_account, sym_code.raw() ); - const auto& st = statstable.get( sym_code.raw() ); - return st.supply; - } - - static asset get_balance( name token_contract_account, name owner, symbol_code sym_code ) - { - accounts accountstable( token_contract_account, owner.value ); - const auto& ac = accountstable.get( sym_code.raw() ); - return ac.balance; - } - - inline asset allowance_of(name from, name to); - - private: - inline void set_allowance(name from, name to, asset quantity, bool increment = false); - - TABLE account - { - asset balance; - - uint64_t primary_key() const { return balance.symbol.code().raw(); } - }; - - TABLE currencystat - { - asset supply; - asset max_supply; - name issuer; - - uint64_t primary_key() const { return supply.symbol.code().raw(); } - }; - - TABLE allowance - { - name to; - asset quantity; - - uint64_t primary_key() const { return to.value; } - - EOSLIB_SERIALIZE(allowance, (to)(quantity)) - }; - - typedef eosio::multi_index<"allowances"_n, allowance> _allowances; - typedef eosio::multi_index<"accounts"_n, account> accounts; - typedef eosio::multi_index<"stat"_n, currencystat> stats; - - void sub_balance(name owner, asset value); - void sub_balance_from(name sender, name owner, asset value); - void add_balance(name owner, asset value, name ram_payer); - - public: - struct transfer_args - { - name from; - name to; - asset quantity; - string memo; - }; -}; - -void token::set_allowance(name from, name to, asset quantity, bool increment) -{ - auto sym = quantity.symbol.code(); - stats statstable(_self, sym.raw()); - const auto &st = statstable.get(sym.raw()); - - eosio_assert(quantity.is_valid(), "invalid quantity"); - eosio_assert(quantity.amount >= 0, "must transfer positive quantity"); - eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); - - name key = to; - - _allowances allowances(_self, from.value); - - auto allowanceitr = allowances.find(key.value); - - if (allowanceitr == allowances.end()) - { - allowances.emplace(from, [&](auto &a) { - a.to = to; - a.quantity = quantity; - }); - } - else - { - allowances.modify(allowanceitr, same_payer, [&](auto &a) { - if (!increment) - a.quantity = quantity; - else - a.quantity += quantity; - }); - } -} - -asset token::allowance_of(name from, name to) -{ - _allowances allowances(_self, from.value); - - auto allowanceitr = allowances.find(to.value); - - eosio_assert(allowanceitr != allowances.end(), "no allowance approved for this account"); - - return allowanceitr->quantity; -} - -} // namespace eosio \ No newline at end of file diff --git a/contracts/ore.usage_log/CMakeLists.txt b/contracts/ore.usage_log/CMakeLists.txt deleted file mode 100644 index 63d2373..0000000 --- a/contracts/ore.usage_log/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -file(GLOB ABI_FILES "*.abi") -configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) - -add_wast_executable(TARGET ore.usage_log - INCLUDE_FOLDERS "${STANDARD_INCLUDE_FOLDERS}" - LIBRARIES libc++ libc eosiolib - DESTINATION_FOLDER ${CMAKE_CURRENT_BINARY_DIR} -) diff --git a/contracts/ore.usage_log/ore.usage_log.cpp b/contracts/ore.usage_log/ore.usage_log.cpp deleted file mode 100644 index 3f1ad53..0000000 --- a/contracts/ore.usage_log/ore.usage_log.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include -#include -#include -#include -#include - -using namespace eosio; -using namespace std; - -class [[eosio::contract("ore.usage_log")]] usage_log : public eosio::contract -{ - public: - using contract::contract; - usage_log(name receiver, name code, datastream ds): contract(receiver, code, ds), _logs(receiver, receiver.value){} - - ACTION createlog(uint64_t instrument_id, string right_name, string token_hash, uint64_t timestamp) - { - uint64_t right_hash = hashStr(right_name); - - _logs.emplace(_self, [&](auto &a) { - a.instrument_id = instrument_id; - a.right_hash = right_hash; - a.right_name = right_name; - a.token_hash = hashStr(token_hash); - a.timestamp = timestamp; - }); - - print("action:createlog Log created for instrument id : " + to_string(instrument_id) + " and right name " + right_name + "\n"); - - } - - // TODO: require authority of the reconciler - // delets the entry from the log table with matching token_hash - ACTION deletelog(uint64_t instrument_id, string token_hash) - { - auto itr = _logs.find(hashStr(token_hash)); - - string msg = "No log exist for the given pair of instrument id " + to_string(instrument_id) + " and access token hash " + token_hash + "\n"; - eosio_assert(itr != _logs.end(), msg.c_str()); - - print("action:deletelog Log deleted for instrument id : " + to_string(instrument_id) + " and access token hash" + token_hash + "\n"); - - _logs.erase(itr); - } - - ACTION updatecount(uint64_t instrument_id, string right_name, asset cpu) - { - uint64_t right_hash = hashStr(right_name); - - counts_table _counts(_self, instrument_id); - - auto itr = _counts.find(right_hash); - - if (itr == _counts.end()) - { - _counts.emplace(_self, [&](auto &a) { - a.right_hash = right_hash; - a.right_name = right_name; - a.last_usage_time = time_point_sec(now()); - a.total_count = 1; - a.total_cpu = cpu; - }); - } - else - { - _counts.modify(itr, _self, [&](auto &a) { - a.last_usage_time = time_point_sec(now()); - a.total_count += 1; - a.total_cpu += cpu; - }); - } - - print("action:updatecount Call count updated for instrument id : " + to_string(instrument_id) + " and right name " + right_name + "\n"); - - } - - private: - TABLE log - { - uint64_t instrument_id; - uint64_t right_hash; - string right_name; - bool action_type; - uint64_t token_hash; - uint64_t timestamp; - auto primary_key() const { return token_hash; } - EOSLIB_SERIALIZE(log, (instrument_id)(right_hash)(right_name)(action_type)(token_hash)(timestamp)) - }; - - //following structure enables fast query of api call count for the verifier - TABLE callcount - { - uint64_t right_hash; - string right_name; - time_point_sec last_usage_time; - uint64_t total_count; - asset total_cpu; - auto primary_key() const { return right_hash; } - - EOSLIB_SERIALIZE(callcount, (right_hash)(right_name)(last_usage_time)(total_count)(total_cpu)) - }; - - typedef eosio::multi_index<"counts"_n, callcount> counts_table; - typedef eosio::multi_index<"logs"_n, log> logs_table; - - logs_table _logs; - - uint64_t hashStr(const string &strkey) - { - return hash{}(strkey); - } -}; -EOSIO_DISPATCH(usage_log, (createlog)(deletelog)(updatecount)) diff --git a/contracts/ore_types/ore_types.hpp b/contracts/ore_types/ore_types.hpp deleted file mode 100644 index 11a29dd..0000000 --- a/contracts/ore_types/ore_types.hpp +++ /dev/null @@ -1,80 +0,0 @@ -#pragma once - -#include "eosiolib/transaction.hpp" -#include - -using namespace std; -using namespace eosio; - -class ore_types : public contract -{ - public: - struct args - { - string name; - string value; - }; - - // this struct is used to specify parameter_rules in an instrument - // for type such as required and locked, there is no value. Hence pass in an empty string as value. - struct param_type - { - string type; - vector values; - }; - - struct endpoint_url - { - string base_right; - string url; - string method; - vector matches_params; - uint64_t token_life_span; - bool is_default; - }; - - struct params - { - vector params; - }; - - struct url_params - { - vector url_params; - }; - - //right in instrument - struct right - { - string right_name; - string description; - string price_in_cpu; - vector additional_url_params; - }; - - //right in right registry - struct right_param - { - string right_name; - vector urls; - vector whitelist; - }; - - struct api_voucher_params - { - string right_name; - params additional_url_params; - }; - - struct offer_params - { - string right_name; - string right_description; - string right_price_in_cpu; - string api_name; - string api_description; - string api_price_in_cpu; - string api_payment_model; - string api_additional_url_params; - }; -}; \ No newline at end of file From a3e74bc483ccd0391bf94c0c50911c5d02640c90 Mon Sep 17 00:00:00 2001 From: Surabhi Lodha Date: Tue, 22 Jan 2019 19:10:11 +0530 Subject: [PATCH 18/21] add latest version of contracts --- contracts/ore.instrument/ore.instrument.cpp | 576 ++++++++++++++++++ contracts/ore.instrument/ore.instrument.hpp | 248 ++++++++ contracts/ore.rights_registry/--url | 11 + .../ore.rights_registry.cpp | 51 ++ .../ore.rights_registry.hpp | 63 ++ .../ore.standard_token/ore.standard_token.cpp | 233 +++++++ .../ore.standard_token/ore.standard_token.hpp | 151 +++++ contracts/ore.usage_log/CMakeLists.txt | 8 + contracts/ore.usage_log/ore.usage_log.cpp | 113 ++++ contracts/ore_types/ore_types.hpp | 80 +++ 10 files changed, 1534 insertions(+) create mode 100644 contracts/ore.instrument/ore.instrument.cpp create mode 100644 contracts/ore.instrument/ore.instrument.hpp create mode 100644 contracts/ore.rights_registry/--url create mode 100644 contracts/ore.rights_registry/ore.rights_registry.cpp create mode 100644 contracts/ore.rights_registry/ore.rights_registry.hpp create mode 100644 contracts/ore.standard_token/ore.standard_token.cpp create mode 100644 contracts/ore.standard_token/ore.standard_token.hpp create mode 100644 contracts/ore.usage_log/CMakeLists.txt create mode 100644 contracts/ore.usage_log/ore.usage_log.cpp create mode 100644 contracts/ore_types/ore_types.hpp diff --git a/contracts/ore.instrument/ore.instrument.cpp b/contracts/ore.instrument/ore.instrument.cpp new file mode 100644 index 0000000..61f5fdc --- /dev/null +++ b/contracts/ore.instrument/ore.instrument.cpp @@ -0,0 +1,576 @@ +#include "ore.instrument.hpp" +using namespace eosio; + +/* + Creates new instrument + NOTE: this should result in changes in the following tables : + tokens - add new token + account - instrument owner's list of owned instruments get updated + accounts - OREINST symbol balance gets updated + + mint action internally calls a deferred transaction with 2 types of actions: + checkright - for each right in the instrument object, mint instrument calls check right within a deferred transaction + createinst - once all the rights are checked, the last action in the deferred transaction is createinst which adds the instrument to the tokens table + NOTE: if any of the checkright action fails, it will cancel the deferred transaction and the creatinst action will not be called. Hence no instrument will be created. + + owner - owner of the new instrument + minter - account authorized to mint the instrument's rights + either the minter or the owner should own the right (or be whitelisted by the owner of the right) + */ +ACTION instrument::mint(name minter, name owner, instrument_data instrument, + uint64_t start_time, uint64_t end_time, uint64_t instrumentId = 0) +{ + // Checking if the minter has the required authorization + require_auth(minter); + + string msg = "owner account does not exist " + owner.to_string(); + eosio_assert(is_account(owner), msg.c_str()); + + // if an instrument_template name is passed-in, look from an instrument with the same name on the chain + // ...if one exists, the new instrument will be a copy of that one + // All instruments with the same template name will have the same data - only the dates may be different + auto hashtable = _tokens.get_index<"templatehash"_n>(); + auto item = hashtable.find(hashStringToInt(instrument.instrument_template)); + + if (instrument.rights.size() == 0) + { + eosio_assert(false, "Right array is empty"); + } + + // If instrumentId value passed as 0, next available primate key will be automatically assigned as instrumentId + // So, instrumentId can't be set to 0 + if (instrumentId == 0) + { + if (_tokens.available_primary_key() == 0) //first instrument created + { + instrumentId = 1; + } + else + { + instrumentId = _tokens.available_primary_key(); + } + } + else + { + auto institr = _tokens.find(instrumentId); + // If an id value specified (other than 0) and the id already exists in the table, assertion will be thrown + eosio_assert(institr == _tokens.end(), "instrumentId exists!"); + } + + // ------- Copy an existing intstrument from a template + // If an instrument already exists with the given template name + // ... copy the instrument data from the existing instrument + // ... the owner of the new instrument is the same as existing instrument (you can't make a copy of someone else's template) + if (instrument.instrument_template != "" && item != hashtable.end()) + { + instrument.issuer = item->instrument.issuer; + instrument.instrument_class = item->instrument.instrument_class; + instrument.description = item->instrument.description; + instrument.security_type = item->instrument.security_type; + instrument.parameter_rules = item->instrument.parameter_rules; + instrument.rights = item->instrument.rights; + instrument.parent_instrument_id = item->instrument.parent_instrument_id; + instrument.data = item->instrument.data; + instrument.encrypted_by = item->instrument.encrypted_by; + instrument.mutability = item->instrument.mutability; + + // create a deferred transaction object to add instrument to the tokens table + transaction create_instrument{}; + + // create an unique id for the deferred transaction + uint64_t transaction_id = instrumentId; + + // Adding createinst action to the deferred transaction to add the new instrument to the tokens table + create_instrument.actions.emplace_back( + permission_level{"instr.ore"_n, "active"_n}, "instr.ore"_n, "createinst"_n, + std::make_tuple(minter, + owner, + instrumentId, + instrument, + start_time, + end_time, + transaction_id)); + + // send deferred transaction + create_instrument.send(transaction_id, minter); + } + else + { + // ------- Create a new intstrument + // create a deferred transaction object to check rights and add instrument to the tokens table + transaction deferred_instrument{}; + + // create an unique id for the deferred transaction + // this deferred_transaction_id is different than the actual completed transaction Id + uint64_t deferred_transaction_id = instrumentId; + + // The creation of this instrument is a series of steps grouped into one deferred transaction + + // Step 1 - add one action for each right to check if the issuer is approved to issue an instrument with that right + for (int i = 0; i < instrument.rights.size(); i++) + { + deferred_instrument.actions.emplace_back( + permission_level{"instr.ore"_n, "active"_n}, _self, "checkright"_n, + std::make_tuple( + minter, + instrument.issuer, + instrument.rights[i].right_name, + deferred_transaction_id)); + } + + // Step 2 - if all the prior actions are sucessful (did not cancel because a right was invalid) + // ... create the instrument as the last step in the transaction chain (using the createinst action) + deferred_instrument.actions.emplace_back( + permission_level{"instr.ore"_n, "active"_n}, _self, "createinst"_n, + std::make_tuple(minter, + owner, + instrumentId, + instrument, + start_time, + end_time)); + + // Step 3 - send deferred transaction + deferred_instrument.send(deferred_transaction_id, minter); + } +} + +/* + createinst creates a row in the instruments table or modifies an already existing row in the instrument table for the given instrument id + This is called by the mint/update action - as the last step in the list of deferred transactions + This can only be called within the instrument contract (requires _self for instr.ore) +*/ +ACTION instrument::createinst(name minter, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time) +{ + require_auth(_self); + auto accountitr = _account.find(owner.value); + + // We track every instrumentId a user owns in the accounts table - along with total count (balance) for each user + // The first time a user creates an instrument, create a record in the accounts table in this contract + if (accountitr == _account.end()) + { + _account.emplace(_self, [&](auto &a) { + a.owner = owner; + a.balance = 0; + print("new instrument account: ", a.primary_key(), "\n"); + }); + accountitr = _account.find(owner.value); + } + + auto tokenitr = _tokens.find(instrumentId); + + // if there is no existing instrument with the input instrument id + if(tokenitr == _tokens.end()){ + // all instruments are stored in the tokens table + _tokens.emplace(_self, [&](auto &a) { + a.id = instrumentId; + a.owner = owner; + a.minted_by = minter; + a.minted_at = now();; + a.instrument = instrument; + a.revoked = false; + a.start_time = start_time; + a.end_time = end_time; + a.template_hash = hashStringToInt(instrument.instrument_template); + a.class_hash = hashStringToInt(instrument.instrument_class); + }); + + // increasing the account balance (total token count) + _account.modify(accountitr, same_payer, [&](auto &a) { + a.balance++; + a.instruments.push_back(instrumentId); + }); + + print("action:mint Created new instrument: type: " + instrument.instrument_class + " id: " + to_string(instrumentId) + " for: " + owner.to_string() + "\n"); + + // transfer 1 OREINST from the issuer account for OREINST to the owner account of instrument + sub_balance(_self, asset(10000, symbol(symbol_code("OREINST"),4))); + add_balance(owner, asset(10000, symbol(symbol_code("OREINST"),4)), _self); + } else { + // update an already existing instrument + _tokens.modify(tokenitr, same_payer, [&](auto &a) { + a.id = instrumentId; + a.owner = owner; + a.minted_by = a.minted_by; + a.minted_at = now(); + a.instrument = instrument; + a.revoked = false; + a.start_time = start_time; + a.end_time = end_time; + a.template_hash = hashStringToInt(instrument.instrument_template); + a.class_hash = hashStringToInt(instrument.instrument_class); + }); + + print("action:update Updated instrument: type: " + instrument.instrument_class + " id: " + to_string(instrumentId) + " for: " + owner.to_string() + "\n"); + } +} + +/* + Checks that the issuer and owner are authorized to issue an instrument that includes this right (either the owner or in whitelist) + This is called by the mint action - as part of a deferred transaction during the minting process + This is called once for each right to be added to the instrument + This can only be called within the instrument contract (requires _self for instr.ore) +*/ +ACTION instrument::checkright(name minter, name issuer, string rightname, uint64_t deferred_transaction_id = 0) +{ + require_auth(_self); + + string msg; + + rights_registry rights_contract("rights.ore"_n,"rights.ore"_n,_ds); + + // check that right exists in the rights registry + auto rightitr = rights_contract.find_right_by_name(rightname); + + if (rightitr.owner.value == 0) + { + if (deferred_transaction_id != 0) + { + cancel_deferred(deferred_transaction_id); + } + msg = "right:" + rightname + " doesn't exist"; + eosio_assert(rightitr.owner.value != 0, msg.c_str()); + } + + // check if the minter of the instrument is the issuer of the right + bool minter_owns_right = rightitr.owner == minter; + if (!minter_owns_right) + { + auto position_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), minter); + //if minter is not in whitelist, cancel the entire mint transaction + if (position_in_whitelist == rightitr.issuer_whitelist.end()) + { + if (deferred_transaction_id != 0) + { + cancel_deferred(deferred_transaction_id); + } + msg = "Attempt to create instrument with right: " + rightname + " by minter: " + minter.to_string() + " who isn't whitelisted or owner of right"; + eosio_assert(false, msg.c_str()); + } + } + + // check if the issuer of the instrument is the owner of the right + bool issuer_owns_right = rightitr.owner == issuer; + if (!issuer_owns_right) + { + auto issuer_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), issuer); + //if issuer is not in whitelist, cancel the entire mint transaction + if (issuer_in_whitelist == rightitr.issuer_whitelist.end()) + { + if (deferred_transaction_id != 0) + { + cancel_deferred(deferred_transaction_id); + } + msg = "Attempt to create instrument with right: " + rightname + " by issuer: " + issuer.to_string() + " who isn't whitelisted or owner of right"; + eosio_assert(false, msg.c_str()); + } + } +} + +/* + updates an instrument (in the tokens table) + the instrument token gets updated depending on the mutabiility + mutability = 0 - completely immutable + mutability = 1 - start_time and/or end_time can be updated + mutability = 2 - everything mutable except the owner can't be updated (calls createinst action as a deferred transaction in this case to update instrument ) +*/ +ACTION instrument::update(name updater, string instrument_template, instrument_data instrument = {}, + uint64_t instrument_id = 0, uint64_t start_time = 0, uint64_t end_time = 0) +{ + require_auth(updater); + uint64_t new_start; + uint64_t new_end; + + instrument::token item; + + //find existing instrument by id or template + if (instrument_id != 0) + { + item = find_token_by_id(instrument_id); + } + else + { + item = find_token_by_template(instrument_template); + } + + eosio_assert(item.owner == updater || item.minted_by == updater, "updater acccount doesn't have the authority to change start/emd time of the instrument"); + + eosio_assert(item.revoked == false, "Token is already revoked"); + + eosio_assert(item.instrument.mutability == 1 || item.instrument.mutability == 2, "the instrument to be updated is immutable"); + + rights_registry rights_contract("rights.ore"_n,"rights.ore"_n,_ds); + + auto tokenitr = _tokens.find(item.id); + + // Update start time/ end time for mutability 1 and 2 + // No updates if the input start time/end time is 0 + if (start_time != 0) + { + new_start = start_time; + } + else + { + new_start = item.start_time; + } + + if (end_time != 0) + { + new_end = end_time; + } + else + { + new_end = item.end_time; + } + + // mutability = 1 - update dates + if (item.instrument.mutability == 1) + { + // update the instrument token in the tokens table + _tokens.modify(tokenitr, same_payer, [&](auto &a) { + a.start_time = new_start; + a.end_time = new_end; + }); + + print("action:update Updated instrument: type: " + item.instrument.instrument_class + " id: " + to_string(item.id) + " for: " + item.owner.to_string() + "\n"); + } + + // mutability = 2 - update anything + if (item.instrument.mutability == 2) + { + item.instrument.issuer = instrument.issuer; + item.instrument.instrument_class = instrument.instrument_class; + item.instrument.description = instrument.description; + item.instrument.security_type = instrument.security_type; + item.instrument.parameter_rules = instrument.parameter_rules; + item.instrument.rights = instrument.rights; + item.instrument.parent_instrument_id = instrument.parent_instrument_id; + item.instrument.data = instrument.data; + item.instrument.encrypted_by = instrument.encrypted_by; + item.instrument.mutability = instrument.mutability; + + transaction deferred_instrument{}; + + uint64_t deferred_trx_id = item.id; + + for (int i = 0; i < item.instrument.rights.size(); i++) + { + deferred_instrument.actions.emplace_back( + permission_level{"instr.ore"_n, "active"_n}, _self, "checkright"_n, + std::make_tuple( + updater, + instrument.issuer, + instrument.rights[i].right_name, + deferred_trx_id)); + } + + // Adding createinst action to the deferred transaction to add the new instrument to the tokens table + deferred_instrument.actions.emplace_back( + permission_level{"instr.ore"_n, "active"_n}, _self, "createinst"_n, + std::make_tuple(updater, + item.owner, + instrument_id, + instrument, + start_time, + end_time)); + + // send deferred transaction + deferred_instrument.send(deferred_trx_id, _self); + } +} + +/* + transfers an instrument (owner field for the instrument gets updated to the new owner in the tokens table) + */ +ACTION instrument::transfer(name sender, name to, uint64_t instrument_id) +{ + + require_auth(sender); + + string msg; + + //find token + auto tokenitr = _tokens.find(instrument_id); + + msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; + eosio_assert(tokenitr != _tokens.end(), msg.c_str()); + + msg = "Sender account is not allowed to transfer the instrument " + sender.to_string(); + eosio_assert(tokenitr->owner == sender, msg.c_str()); + + msg = "Instrument Id " + to_string(instrument_id) + " has been previously revoked"; + eosio_assert(tokenitr->revoked == false, msg.c_str()); + + // transfer balance in the accounts table + transfer_balances(sender, to, instrument_id); + + // transfer OREINST balance + sub_balance(sender, asset(10000, symbol(symbol_code("OREINST"),4))); + add_balance(to, asset(10000, symbol(symbol_code("OREINST"),4)), sender); + _tokens.modify(tokenitr, same_payer, [&](auto &a) { + a.owner = to; + }); +} + +// revokes an instrument - A revoked instrument is no longer active and cannot be used +ACTION instrument::revoke(name revoker, uint64_t instrument_id) +{ + require_auth(revoker); + + string msg; + + //Checking if the token exists. + auto tokenitr = _tokens.find(instrument_id); + + msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; + eosio_assert(tokenitr != _tokens.end(), msg.c_str()); + + msg = "The account " + revoker.to_string() + "doesn't have authority to revoke the instrument"; + eosio_assert(tokenitr->owner == revoker, msg.c_str()); + + msg = "Instrument Id" + to_string(instrument_id) + "has been previously revoked"; + eosio_assert(tokenitr->revoked == false, msg.c_str()); + + _tokens.modify(tokenitr, same_payer, [&](auto &t) { + t.revoked = true; + }); +} + +/* + deletes an instrument (from the tokens table) + deletes only if it's mutability is 2 ( as mutability 2 means we can change anything) +*/ +ACTION instrument::burn(name burner, uint64_t instrument_id) +{ + require_auth(burner); + + string msg; + bool from = false; + + // Checking if the token exists. + auto tokenitr = _tokens.find(instrument_id); + + msg = "Instrument Id" + to_string(instrument_id) + "doesn't exist"; + eosio_assert(tokenitr != _tokens.end(), msg.c_str()); + + msg = "The account " + burner.to_string() + "doesn't have authority to burn the instrument"; + eosio_assert(tokenitr->owner == burner, msg.c_str()); + + msg = "Instrument Id" + to_string(instrument_id) + "is not mutable and cannot be burned."; + eosio_assert(tokenitr->instrument.mutability == 2, msg.c_str()); + + transfer_balances(burner, same_payer, instrument_id); + sub_balance(burner, asset(10000, symbol(symbol_code("OREINST"),4))); + + _tokens.erase(tokenitr); +} + +/* + -CUSTOM_CODE- it replicates the create function of ore.standard_token + creates a new currency OREINST +*/ +ACTION instrument::create(name issuer, + asset maximum_supply) +{ + require_auth(_self); + + // Symbol is hardcoded here to prevent creating any other symbol than OREINST + // auto sym = "maximum_supply.symbol"; + eosio::symbol sym = symbol(symbol_code("OREINST"),4); + + eosio_assert(maximum_supply.symbol == sym, "symbol name must be ORINST"); + eosio_assert(sym.is_valid(), "invalid symbol name"); + eosio_assert(maximum_supply.is_valid(), "invalid supply"); + eosio_assert(maximum_supply.amount > 0, "max-supply must be positive"); + + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); + eosio_assert(existing == statstable.end(), "token with symbol already exists"); + + statstable.emplace(_self, [&](auto &s) { + s.supply.symbol = sym; + s.max_supply = maximum_supply; + s.issuer = issuer; + }); +} + +/* + -CUSTOM_CODE-it replicates the issue function of ore.standard_token except the inline transfer action present in ore.standard_token + issue OREINST to an account +*/ +ACTION instrument::issue(name to, asset quantity, string memo) +{ + auto sym = quantity.symbol; + eosio_assert(sym.is_valid(), "invalid symbol name"); + eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); + + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); + eosio_assert(existing != statstable.end(), "token with symbol does not exist, create token before issue"); + const auto &st = *existing; + + require_auth(st.issuer); + eosio_assert(quantity.is_valid(), "invalid quantity"); + eosio_assert(quantity.amount > 0, "must issue positive quantity"); + + eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); + eosio_assert(quantity.amount <= st.max_supply.amount - st.supply.amount, "quantity exceeds available supply"); + + statstable.modify(st, same_payer, [&](auto &s) { + s.supply += quantity; + }); + + add_balance(st.issuer, quantity, st.issuer); + + if (to != st.issuer) + { + sub_balance(st.issuer, quantity); + add_balance(to, quantity, st.issuer); + } +} + +/* + -CUSTOM_CODE-it replicates the sub_balance function of ore.standard_token + removes OREINST from an account + */ +void instrument::sub_balance(name owner, asset value) +{ + accounts from_acnts(_self, owner.value); + + const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); + eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); + + if (from.balance.amount == value.amount) + { + from_acnts.erase(from); + } + else + { + from_acnts.modify(from, owner, [&](auto &a) { + a.balance -= value; + }); + } +} + +/* + -CUSTOM_CODE-it replicates the add_balance function of ore.standard_token + adds OREINST to an account +*/ +void instrument::add_balance(name owner, asset value, name ram_payer) +{ + accounts to_acnts(_self, owner.value); + auto to = to_acnts.find(value.symbol.code().raw()); + if (to == to_acnts.end()) + { + to_acnts.emplace(ram_payer, [&](auto &a) { + a.balance = value; + }); + } + else + { + to_acnts.modify(to, same_payer, [&](auto &a) { + a.balance += value; + }); + } +} + +EOSIO_DISPATCH(instrument, (transfer)(mint)(checkright)(createinst)(update)(revoke)(burn)(create)(issue)) diff --git a/contracts/ore.instrument/ore.instrument.hpp b/contracts/ore.instrument/ore.instrument.hpp new file mode 100644 index 0000000..eb8c1ab --- /dev/null +++ b/contracts/ore.instrument/ore.instrument.hpp @@ -0,0 +1,248 @@ +#pragma once +#include +#include +#include +#include + +#include "eosiolib/eosio.hpp" +#include "eosiolib/asset.hpp" +#include "eosiolib/print.hpp" +#include "eosiolib/transaction.hpp" +#include "eosiolib/time.hpp" +#include "../ore.rights_registry/ore.rights_registry.hpp" + +using namespace eosio; +using namespace std; + +class [[eosio::contract("ore.instrument")]] instrument : public eosio::contract +{ + public: + instrument( name receiver, name code, datastream ds): contract(receiver, code, ds), _account(receiver, receiver.value), _tokens(receiver, receiver.value) {} + + struct instrument_data + { + name issuer; + string instrument_class; + string description; + string instrument_template; + string security_type; + vector parameter_rules; + vector rights; + uint64_t parent_instrument_id; + + //example input for data: considerations + vector data; + string encrypted_by; + uint8_t mutability; // 0- immutable, 1- only datesi 2- all + }; + + TABLE token + { + //721 standard properties + uint64_t id; + name owner; + name minted_by; + uint64_t minted_at; + + //instrument properties + instrument_data instrument; + bool revoked; + uint64_t start_time; + uint64_t end_time; + + uint64_t template_hash; + uint64_t class_hash; + + uint64_t primary_key() const { return id; } + uint64_t by_owner() const { return owner.value; } + uint64_t by_template() const { return template_hash; } + uint64_t by_class() const { return class_hash; } + + EOSLIB_SERIALIZE(token, (id)(owner)(minted_by)(minted_at)(instrument)(revoked)(start_time)(end_time)(template_hash)(class_hash)) + }; + + typedef eosio::multi_index<"tokens"_n, token, + indexed_by<"owner"_n, const_mem_fun>, + indexed_by<"templatehash"_n, const_mem_fun>, + indexed_by<"classhash"_n, const_mem_fun> + >tokenindex; + + tokenindex _tokens; + + TABLE accountdata + { + name owner; + uint64_t balance; + vector instruments; + uint64_t primary_key() const { return owner.value; } + EOSLIB_SERIALIZE(accountdata, (owner)(balance)(instruments)) + }; + + typedef eosio::multi_index<"account"_n, accountdata> accountindex; + + accountindex _account; + + private: + TABLE accountbalance + { + asset balance; + + uint64_t primary_key() const { return balance.symbol.code().raw(); } + }; + + TABLE currencystat + { + asset supply; + asset max_supply; + name issuer; + + uint64_t primary_key() const { return supply.symbol.code().raw(); } + }; + + typedef eosio::multi_index<"accounts"_n, accountbalance> accounts; + typedef eosio::multi_index<"stat"_n, currencystat> stats; + + void sub_balance(name owner, asset value); + void sub_balance_from(name sender, name owner, asset value); + void add_balance(name owner, asset value, name ram_payer); + void transfer_balances(name from, name to, uint64_t instrument_id, int64_t amount = 1); + + public: + //public utility functions + token find_token_by_id(uint64_t id); + bool isToken(uint64_t id); + token find_token_by_template(string instrument_template); + bool _owns(name claimant, uint64_t token_id); + uint64_t total_supply(); + uint64_t balance_of(name owner); + name owner_of(uint64_t token_id); + + inline static uint64_t hashStringToInt(const string &strkey) + { + return hash{}(strkey); + } + + //actions + ACTION approve(name from, name to, uint64_t token_id); + ACTION mint(name minter, name owner, instrument_data instrument, uint64_t start_time, uint64_t end_time, uint64_t instrumentId); + ACTION checkright(name minter, name issuer, string rightname, uint64_t deferred_transaction_id); + ACTION update(name updater, string instrument_template, instrument_data instrument, uint64_t instrument_id, uint64_t start_time, uint64_t end_time); + ACTION transfer(name sender, name to, uint64_t token_id); + ACTION revoke(name revoker, uint64_t token_id); + ACTION burn(name burner, uint64_t token_id); + ACTION create(name issuer, asset maximum_supply); + ACTION createinst(name minter, name owner, uint64_t instrumentId, instrument_data instrument, uint64_t start_time, uint64_t end_time); + ACTION issue(name to, asset quantity, string memo); +}; + +instrument::token instrument::find_token_by_id(uint64_t id) +{ + auto tok = _tokens.find(id); + + if (tok == _tokens.end()) + eosio_assert(false, "token not found"); + + return token{ + tok->id, + tok->owner, + tok->minted_by, + tok->minted_at, + tok->instrument, + tok->revoked, + tok->start_time, + tok->end_time, + tok->template_hash, + tok->class_hash}; +} + +bool instrument::isToken(uint64_t id) +{ + auto tok = _tokens.find(id); + + if (tok == _tokens.end()) + return false; + else + return true; +} + +instrument::token instrument::find_token_by_template(string instrument_template) +{ + auto hashtable = _tokens.get_index<"templatehash"_n>(); + auto item = hashtable.find(hashStringToInt(instrument_template)); + if (item == hashtable.end()) + eosio_assert(false, "instrument with given template not found"); + return {item->id, + item->owner, + item->minted_by, + item->minted_at, + item->instrument, + item->revoked, + item->start_time, + item->end_time, + item->template_hash, + item->class_hash}; +} + +// Return an account's total balance +uint64_t instrument::balance_of(name owner) +{ + auto account = _account.find(owner.value); + return account->balance; +} + +// Returns who owns a token +name instrument::owner_of(uint64_t token_id) +{ + auto token = _tokens.find(token_id); + return token->owner; +} + +uint64_t instrument::total_supply() +{ + auto tokitr = _tokens.begin(); + uint64_t token_id = 0; + while (tokitr != _tokens.end()) + { + token_id++; + tokitr++; + } + + return token_id; +} + +// Check if account owns the token +bool instrument::_owns(name claimant, uint64_t token_id) +{ + return owner_of(token_id) == claimant; +} + +void instrument::transfer_balances(name from, name to, uint64_t instrument_id, int64_t amount) +{ + auto fromitr = _account.find(from.value); + + eosio_assert(fromitr != _account.end(), "Sender account doesn't exists"); + eosio_assert(fromitr->balance > 0, "Sender account's balance is 0"); + + _account.modify(fromitr, same_payer, [&](auto &a) { + a.balance -= amount; + a.instruments.erase(std::remove(a.instruments.begin(), a.instruments.end(), instrument_id), a.instruments.end()); + }); + + auto toitr = _account.find(to.value); + + if (toitr != _account.end()) + { + _account.modify(toitr, same_payer, [&](auto &a) { + a.balance += amount; + a.instruments.push_back(instrument_id); + }); + } + else + { + _account.emplace(from, [&](auto &a) { + a.owner = to; + a.balance = amount; + a.instruments.push_back(instrument_id); + }); + } +} \ No newline at end of file diff --git a/contracts/ore.rights_registry/--url b/contracts/ore.rights_registry/--url new file mode 100644 index 0000000..413349a --- /dev/null +++ b/contracts/ore.rights_registry/--url @@ -0,0 +1,11 @@ + + + + + Error 411 (Length Required)!!1 + + +

411. That’s an error. +

POST requests require a Content-length header. That’s all we know. diff --git a/contracts/ore.rights_registry/ore.rights_registry.cpp b/contracts/ore.rights_registry/ore.rights_registry.cpp new file mode 100644 index 0000000..5d2c9d5 --- /dev/null +++ b/contracts/ore.rights_registry/ore.rights_registry.cpp @@ -0,0 +1,51 @@ +#include "ore.rights_registry.hpp" + +using namespace eosio; + +// transfer action +ACTION rights_registry::upsertright(name owner, string &right_name, vector urls, vector issuer_whitelist) +{ + require_auth(owner); + + auto itr = _rights.find(hashStr(right_name)); + + if (itr == _rights.end()) + { + _rights.emplace(owner, [&](auto &end) { + end.id = hashStr(right_name); + end.right_name = right_name; + end.owner = owner; + end.urls = urls; + end.issuer_whitelist = issuer_whitelist; + }); + + print("action:upsertright Right: " + right_name + " added:" + " by: " + owner.to_string() + "\n"); + + } + else + { + string msg = "The account " + owner.to_string() + " is not the owner of the right " + right_name + " and cannot modify it."; + eosio_assert(itr->owner == owner, msg.c_str()); + + _rights.modify(itr, owner, [&](auto &end) { + end.urls = urls; + end.issuer_whitelist = issuer_whitelist; + }); + + print("action:upsertright Right: " + right_name + " modified by: " + owner.to_string() + "\n"); + } +} + +ACTION rights_registry::deleteright(name owner, string &right_name) +{ + require_auth(owner); + + auto itr = _rights.find(hashStr(right_name)); + + string msg = "The right " + right_name + " doesn't exist "; + + eosio_assert(itr != _rights.end(), msg.c_str()); + _rights.erase(itr); +} + +EOSIO_DISPATCH(rights_registry, (upsertright)(deleteright)) diff --git a/contracts/ore.rights_registry/ore.rights_registry.hpp b/contracts/ore.rights_registry/ore.rights_registry.hpp new file mode 100644 index 0000000..602a962 --- /dev/null +++ b/contracts/ore.rights_registry/ore.rights_registry.hpp @@ -0,0 +1,63 @@ +/** + * @file + * @copyright defined in eos/LICENSE.txt + */ +#pragma once +#include + +#include "eosiolib/eosio.hpp" +#include "../ore_types/ore_types.hpp" + +using namespace eosio; +using namespace std; + +class [[eosio::contract("ore.rights_registry")]] rights_registry : public eosio::contract +{ + public: + using contract::contract; + rights_registry( name receiver, name code, datastream ds): contract(receiver, code, ds), _rights(receiver, receiver.value){} + + TABLE right_reg + { + uint64_t id; + string right_name; + name owner; + vector urls; + vector issuer_whitelist; + + uint64_t primary_key() const { return id; } + + EOSLIB_SERIALIZE(right_reg, (id)(right_name)(owner)(urls)(issuer_whitelist)) + }; + + typedef eosio::multi_index<"rights"_n, right_reg>right_registration_index; + + public: + right_registration_index _rights; + + ACTION upsertright(name owner, string &right_name, vector urls, vector issuer_whitelist); + + ACTION deleteright(name owner, string &right_name); + + inline static uint64_t hashStr(const string &strkey) + { + return hash{}(strkey); + } + + right_reg find_right_by_name(string right_name) + { + auto rightitr = _rights.find(hashStr(right_name)); + + if (rightitr == _rights.end()) + { + return right_reg{0}; + } + + return right_reg{ + rightitr->id, + rightitr->right_name, + rightitr->owner, + rightitr->urls, + rightitr->issuer_whitelist}; + } +}; \ No newline at end of file diff --git a/contracts/ore.standard_token/ore.standard_token.cpp b/contracts/ore.standard_token/ore.standard_token.cpp new file mode 100644 index 0000000..2d70bd6 --- /dev/null +++ b/contracts/ore.standard_token/ore.standard_token.cpp @@ -0,0 +1,233 @@ +/** + * @file + * @copyright defined in eos/LICENSE.txt + */ + +/** + * Following contract adheres to eosio.token standards. + * It copies all the functionalities of eosio.token. In addition to that, it implements functions for allowance model as in ERC-20 + */ + +/** + * NOTE: Any changes to create, issue, transfer, sub_balance, sub_balance_from and add_balance functions should be replicated + * in the implementation of the same functions in ore.instrument contract. + */ + +#include "ore.standard_token.hpp" + +namespace eosio +{ + +ACTION token::create(name issuer, + asset maximum_supply) +{ + require_auth(_self); + + auto sym = maximum_supply.symbol; + eosio_assert(sym.is_valid(), "invalid symbol name"); + eosio_assert(maximum_supply.is_valid(), "invalid supply"); + eosio_assert(maximum_supply.amount > 0, "max-supply must be positive"); + + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); + eosio_assert(existing == statstable.end(), "token with symbol already exists"); + + statstable.emplace(_self, [&](auto &s) { + s.supply.symbol = maximum_supply.symbol; + s.max_supply = maximum_supply; + s.issuer = issuer; + }); +} + +// The approve action is called by "from" account to authorize "to" account to call the transferfrom function on it's behalf +ACTION token::approve(name from, name to, asset quantity, string memo) +{ + require_auth(from); + + accounts from_acnts(_self, from.value); + + const auto &from_account = from_acnts.get(quantity.symbol.code().raw(), "no balance object found"); + eosio_assert(from_account.balance.amount >= quantity.amount, "amount being approved is more than the balance of the approver account"); + + set_allowance(from, to, quantity, true); +} + +ACTION token::issue(name to, asset quantity, string memo) +{ + auto sym = quantity.symbol; + eosio_assert(sym.is_valid(), "invalid symbol name"); + eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); + + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); + eosio_assert(existing != statstable.end(), "token with symbol does not exist, create token before issue"); + const auto &st = *existing; + + require_auth(st.issuer); + eosio_assert(quantity.is_valid(), "invalid quantity"); + eosio_assert(quantity.amount > 0, "must issue positive quantity"); + + eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); + eosio_assert(quantity.amount <= st.max_supply.amount - st.supply.amount, "quantity exceeds available supply"); + + statstable.modify(st, same_payer, [&](auto &s) { + s.supply += quantity; + }); + + add_balance(st.issuer, quantity, st.issuer); + + if (to != st.issuer) + { + SEND_INLINE_ACTION(*this, transfer, {st.issuer, "active"_n}, {st.issuer, to, quantity, memo}); + } +} + +ACTION token::retire(asset quantity, string memo) +{ + auto sym = quantity.symbol; + eosio_assert(sym.is_valid(), "invalid symbol name"); + eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); + + stats statstable(_self, sym.code().raw()); + auto existing = statstable.find(sym.code().raw()); + eosio_assert(existing != statstable.end(), "token with symbol does not exist"); + const auto &st = *existing; + + require_auth(st.issuer); + eosio_assert(quantity.is_valid(), "invalid quantity"); + eosio_assert(quantity.amount > 0, "must retire positive quantity"); + + eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); + + statstable.modify(st, same_payer, [&](auto &s) { + s.supply -= quantity; + }); + + sub_balance(st.issuer, quantity); +} + +ACTION token::transfer(name from, + name to, + asset quantity, + string memo) +{ + eosio_assert(from != to, "cannot transfer to self"); + require_auth(from); + eosio_assert(is_account(to), "to account does not exist"); + auto sym = quantity.symbol.code(); + stats statstable(_self, sym.raw()); + const auto &st = statstable.get(sym.raw()); + + require_recipient(from); + require_recipient(to); + + eosio_assert(quantity.is_valid(), "invalid quantity"); + eosio_assert(quantity.amount > 0, "must transfer positive quantity"); + eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); + eosio_assert(memo.size() <= 256, "memo has more than 256 bytes"); + + auto payer = has_auth(to) ? to : from; + + sub_balance(from, quantity); + add_balance(to, quantity, payer); +} + +// This action is called by the approved "sender" account on behalf of the "from" account to transfer "quantity" to "to" account +ACTION token::transferfrom(name sender, name from, name to, asset quantity, string memo) +{ + require_auth(sender); + + auto allowance = token::allowance_of(from, sender); + + print("The approved account ", name{sender}); + print(" is transferring ", quantity); + print(" from ", name{from}); + print(" to ", name{to}); + + eosio_assert(allowance.amount >= quantity.amount, "the amount being transferred is more than the approved amount"); + + add_balance(to, quantity, sender); + sub_balance_from(sender, from, quantity); + + set_allowance(from, sender, allowance - quantity, false); +} + +// eosio.token standard sub_balance function +void token::sub_balance(name owner, asset value) +{ + accounts from_acnts(_self, owner.value); + + const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); + eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); + + { + from_acnts.modify(from, owner, [&](auto &a) { + a.balance -= value; + }); + } +} + +// It is used by transfer_from account to specify the RAM payer as the "sender" account and not the "owner" account as in the sub_balance function +void token::sub_balance_from(name sender, name owner, asset value) +{ + accounts from_acnts(_self, owner.value); + + const auto &from = from_acnts.get(value.symbol.code().raw(), "no balance object found"); + eosio_assert(from.balance.amount >= value.amount, "overdrawn balance"); + + from_acnts.modify(from, sender, [&](auto &a) { + a.balance -= value; + }); +} + +void token::add_balance(name owner, asset value, name ram_payer) +{ + accounts to_acnts(_self, owner.value); + auto to = to_acnts.find(value.symbol.code().raw()); + if (to == to_acnts.end()) + { + to_acnts.emplace(ram_payer, [&](auto &a) { + a.balance = value; + }); + } + else + { + to_acnts.modify(to, same_payer, [&](auto &a) { + a.balance += value; + }); + } +} + +ACTION token::open(name owner, const symbol &symbol, name ram_payer) +{ + require_auth(ram_payer); + + auto sym_code_raw = symbol.code().raw(); + + stats statstable(_self, sym_code_raw); + const auto &st = statstable.get(sym_code_raw, "symbol does not exist"); + eosio_assert(st.supply.symbol == symbol, "symbol precision mismatch"); + + accounts acnts(_self, owner.value); + auto it = acnts.find(sym_code_raw); + if (it == acnts.end()) + { + acnts.emplace(ram_payer, [&](auto &a) { + a.balance = asset{0, symbol}; + }); + } +} + +ACTION token::close(name owner, const symbol &symbol) +{ + require_auth(owner); + accounts acnts(_self, owner.value); + auto it = acnts.find(symbol.code().raw()); + eosio_assert(it != acnts.end(), "Balance row already deleted or never existed. Action won't have any effect."); + eosio_assert(it->balance.amount == 0, "Cannot close because the balance is not zero."); + acnts.erase(it); +} + +} // namespace eosio + +EOSIO_DISPATCH( eosio::token, (create)(issue)(transfer)(approve)(transferfrom)(open)(close)(retire)) \ No newline at end of file diff --git a/contracts/ore.standard_token/ore.standard_token.hpp b/contracts/ore.standard_token/ore.standard_token.hpp new file mode 100644 index 0000000..2aa875f --- /dev/null +++ b/contracts/ore.standard_token/ore.standard_token.hpp @@ -0,0 +1,151 @@ +/** + * @file + * @copyright defined in eos/LICENSE.txt + */ +#pragma once + +#include "eosiolib/asset.hpp" +#include "eosiolib/eosio.hpp" + +#include + +namespace eosiosystem +{ +class system_contract; +} + +namespace eosio +{ + +using std::string; + +class[[eosio::contract("ore.standard_token")]] token : public contract +{ + public: + using contract::contract; + + ACTION create(name issuer, asset maximum_supply); + + ACTION issue(name to, asset quantity, string memo); + + ACTION retire(asset quantity, string memo); + + ACTION transfer(name from, name to, asset quantity, string memo); + + ACTION approve(name from, name to, asset quantity, string memo); + + ACTION transferfrom(name sender, name from, name to, asset quantity, string memo); + + ACTION open(name owner, const symbol &symbol, name ram_payer); + + ACTION close(name owner, const symbol &symbol); + + static asset get_supply( name token_contract_account, symbol_code sym_code ) + { + stats statstable( token_contract_account, sym_code.raw() ); + const auto& st = statstable.get( sym_code.raw() ); + return st.supply; + } + + static asset get_balance( name token_contract_account, name owner, symbol_code sym_code ) + { + accounts accountstable( token_contract_account, owner.value ); + const auto& ac = accountstable.get( sym_code.raw() ); + return ac.balance; + } + + inline asset allowance_of(name from, name to); + + private: + inline void set_allowance(name from, name to, asset quantity, bool increment = false); + + TABLE account + { + asset balance; + + uint64_t primary_key() const { return balance.symbol.code().raw(); } + }; + + TABLE currencystat + { + asset supply; + asset max_supply; + name issuer; + + uint64_t primary_key() const { return supply.symbol.code().raw(); } + }; + + TABLE allowance + { + name to; + asset quantity; + + uint64_t primary_key() const { return to.value; } + + EOSLIB_SERIALIZE(allowance, (to)(quantity)) + }; + + typedef eosio::multi_index<"allowances"_n, allowance> _allowances; + typedef eosio::multi_index<"accounts"_n, account> accounts; + typedef eosio::multi_index<"stat"_n, currencystat> stats; + + void sub_balance(name owner, asset value); + void sub_balance_from(name sender, name owner, asset value); + void add_balance(name owner, asset value, name ram_payer); + + public: + struct transfer_args + { + name from; + name to; + asset quantity; + string memo; + }; +}; + +void token::set_allowance(name from, name to, asset quantity, bool increment) +{ + auto sym = quantity.symbol.code(); + stats statstable(_self, sym.raw()); + const auto &st = statstable.get(sym.raw()); + + eosio_assert(quantity.is_valid(), "invalid quantity"); + eosio_assert(quantity.amount >= 0, "must transfer positive quantity"); + eosio_assert(quantity.symbol == st.supply.symbol, "symbol precision mismatch"); + + name key = to; + + _allowances allowances(_self, from.value); + + auto allowanceitr = allowances.find(key.value); + + if (allowanceitr == allowances.end()) + { + allowances.emplace(from, [&](auto &a) { + a.to = to; + a.quantity = quantity; + }); + } + else + { + allowances.modify(allowanceitr, same_payer, [&](auto &a) { + if (!increment) + a.quantity = quantity; + else + a.quantity += quantity; + }); + } +} + +asset token::allowance_of(name from, name to) +{ + _allowances allowances(_self, from.value); + + auto allowanceitr = allowances.find(to.value); + + eosio_assert(allowanceitr != allowances.end(), "no allowance approved for this account"); + + return allowanceitr->quantity; +} + +} // namespace eosio \ No newline at end of file diff --git a/contracts/ore.usage_log/CMakeLists.txt b/contracts/ore.usage_log/CMakeLists.txt new file mode 100644 index 0000000..63d2373 --- /dev/null +++ b/contracts/ore.usage_log/CMakeLists.txt @@ -0,0 +1,8 @@ +file(GLOB ABI_FILES "*.abi") +configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) + +add_wast_executable(TARGET ore.usage_log + INCLUDE_FOLDERS "${STANDARD_INCLUDE_FOLDERS}" + LIBRARIES libc++ libc eosiolib + DESTINATION_FOLDER ${CMAKE_CURRENT_BINARY_DIR} +) diff --git a/contracts/ore.usage_log/ore.usage_log.cpp b/contracts/ore.usage_log/ore.usage_log.cpp new file mode 100644 index 0000000..3f1ad53 --- /dev/null +++ b/contracts/ore.usage_log/ore.usage_log.cpp @@ -0,0 +1,113 @@ +#include +#include +#include +#include +#include + +using namespace eosio; +using namespace std; + +class [[eosio::contract("ore.usage_log")]] usage_log : public eosio::contract +{ + public: + using contract::contract; + usage_log(name receiver, name code, datastream ds): contract(receiver, code, ds), _logs(receiver, receiver.value){} + + ACTION createlog(uint64_t instrument_id, string right_name, string token_hash, uint64_t timestamp) + { + uint64_t right_hash = hashStr(right_name); + + _logs.emplace(_self, [&](auto &a) { + a.instrument_id = instrument_id; + a.right_hash = right_hash; + a.right_name = right_name; + a.token_hash = hashStr(token_hash); + a.timestamp = timestamp; + }); + + print("action:createlog Log created for instrument id : " + to_string(instrument_id) + " and right name " + right_name + "\n"); + + } + + // TODO: require authority of the reconciler + // delets the entry from the log table with matching token_hash + ACTION deletelog(uint64_t instrument_id, string token_hash) + { + auto itr = _logs.find(hashStr(token_hash)); + + string msg = "No log exist for the given pair of instrument id " + to_string(instrument_id) + " and access token hash " + token_hash + "\n"; + eosio_assert(itr != _logs.end(), msg.c_str()); + + print("action:deletelog Log deleted for instrument id : " + to_string(instrument_id) + " and access token hash" + token_hash + "\n"); + + _logs.erase(itr); + } + + ACTION updatecount(uint64_t instrument_id, string right_name, asset cpu) + { + uint64_t right_hash = hashStr(right_name); + + counts_table _counts(_self, instrument_id); + + auto itr = _counts.find(right_hash); + + if (itr == _counts.end()) + { + _counts.emplace(_self, [&](auto &a) { + a.right_hash = right_hash; + a.right_name = right_name; + a.last_usage_time = time_point_sec(now()); + a.total_count = 1; + a.total_cpu = cpu; + }); + } + else + { + _counts.modify(itr, _self, [&](auto &a) { + a.last_usage_time = time_point_sec(now()); + a.total_count += 1; + a.total_cpu += cpu; + }); + } + + print("action:updatecount Call count updated for instrument id : " + to_string(instrument_id) + " and right name " + right_name + "\n"); + + } + + private: + TABLE log + { + uint64_t instrument_id; + uint64_t right_hash; + string right_name; + bool action_type; + uint64_t token_hash; + uint64_t timestamp; + auto primary_key() const { return token_hash; } + EOSLIB_SERIALIZE(log, (instrument_id)(right_hash)(right_name)(action_type)(token_hash)(timestamp)) + }; + + //following structure enables fast query of api call count for the verifier + TABLE callcount + { + uint64_t right_hash; + string right_name; + time_point_sec last_usage_time; + uint64_t total_count; + asset total_cpu; + auto primary_key() const { return right_hash; } + + EOSLIB_SERIALIZE(callcount, (right_hash)(right_name)(last_usage_time)(total_count)(total_cpu)) + }; + + typedef eosio::multi_index<"counts"_n, callcount> counts_table; + typedef eosio::multi_index<"logs"_n, log> logs_table; + + logs_table _logs; + + uint64_t hashStr(const string &strkey) + { + return hash{}(strkey); + } +}; +EOSIO_DISPATCH(usage_log, (createlog)(deletelog)(updatecount)) diff --git a/contracts/ore_types/ore_types.hpp b/contracts/ore_types/ore_types.hpp new file mode 100644 index 0000000..11a29dd --- /dev/null +++ b/contracts/ore_types/ore_types.hpp @@ -0,0 +1,80 @@ +#pragma once + +#include "eosiolib/transaction.hpp" +#include + +using namespace std; +using namespace eosio; + +class ore_types : public contract +{ + public: + struct args + { + string name; + string value; + }; + + // this struct is used to specify parameter_rules in an instrument + // for type such as required and locked, there is no value. Hence pass in an empty string as value. + struct param_type + { + string type; + vector values; + }; + + struct endpoint_url + { + string base_right; + string url; + string method; + vector matches_params; + uint64_t token_life_span; + bool is_default; + }; + + struct params + { + vector params; + }; + + struct url_params + { + vector url_params; + }; + + //right in instrument + struct right + { + string right_name; + string description; + string price_in_cpu; + vector additional_url_params; + }; + + //right in right registry + struct right_param + { + string right_name; + vector urls; + vector whitelist; + }; + + struct api_voucher_params + { + string right_name; + params additional_url_params; + }; + + struct offer_params + { + string right_name; + string right_description; + string right_price_in_cpu; + string api_name; + string api_description; + string api_price_in_cpu; + string api_payment_model; + string api_additional_url_params; + }; +}; \ No newline at end of file From 92b4dab76831970c273827b0d6293bb836407b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 22 Jan 2019 17:39:00 +0300 Subject: [PATCH 19/21] intr test update --- tests/instrument.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/instrument.py b/tests/instrument.py index d2b8473..39fb868 100644 --- a/tests/instrument.py +++ b/tests/instrument.py @@ -298,7 +298,7 @@ def test_06(self): ''') instr.push_action( - "updateinst", + "createinst", { "updater": app, "owner": app, From 647471093e9abf04b03ecbcbd4c5b2bd62057f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 22 Jan 2019 18:05:19 +0300 Subject: [PATCH 20/21] intr test update --- tests/instrument.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/instrument.py b/tests/instrument.py index 39fb868..090bd97 100644 --- a/tests/instrument.py +++ b/tests/instrument.py @@ -300,7 +300,7 @@ def test_06(self): instr.push_action( "createinst", { - "updater": app, + "minter": app, "owner": app, "instrumentId": 2, "instrument": { From af5c18e4102b6683f677ddb6d9bfa37e63577cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=C5=9Farcan=20Celebci?= Date: Tue, 22 Jan 2019 18:17:08 +0300 Subject: [PATCH 21/21] intr test update --- tests/instrument.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/instrument.py b/tests/instrument.py index 090bd97..f5aa4aa 100644 --- a/tests/instrument.py +++ b/tests/instrument.py @@ -1,5 +1,6 @@ import unittest from eosfactory.eosf import * +import time verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG]) @@ -296,7 +297,7 @@ def test_06(self): COMMENT(''' Update Instrument: ''') - + time.sleep(3) instr.push_action( "createinst", {