diff --git a/.cicd/build.sh b/.cicd/build.sh new file mode 100755 index 000000000..42975cd05 --- /dev/null +++ b/.cicd/build.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -eo pipefail +. ./.cicd/helpers/buildkite.sh +. ./.cicd/helpers/general.sh +. ./.cicd/helpers/dependency-info.sh +mkdir -p $BUILD_DIR +DOCKER_IMAGE=${DOCKER_IMAGE:-eosio/ci-contracts-builder:base-ubuntu-18.04-$SANITIZED_EOSIO_VERSION} +if [[ "$BUILDKITE" == 'true' ]]; then + buildkite-agent meta-data set cdt-url "$CDT_URL" + buildkite-agent meta-data set cdt-version "$CDT_VERSION" + buildkite-agent meta-data set docker-image "$DOCKER_IMAGE" +else + export CDT_URL + export CDT_VERSION + export DOCKER_IMAGE +fi +ARGS=${ARGS:-"--rm -v $(pwd):$MOUNTED_DIR"} +CDT_COMMANDS="dpkg -i $MOUNTED_DIR/eosio.cdt.deb && export PATH=/usr/opt/eosio.cdt/\\\$(ls /usr/opt/eosio.cdt/)/bin:\\\$PATH" +PRE_COMMANDS="$CDT_COMMANDS && cd /root/eosio/ && printf \\\"EOSIO commit: \\\$(git rev-parse --verify HEAD). Click \033]1339;url=https://github.com/EOSIO/eos/commit/\\\$(git rev-parse --verify HEAD);content=here\a for details.\n\\\" && cd $MOUNTED_DIR/build" +BUILD_COMMANDS="cmake -DBUILD_TESTS=true .. && make -j $JOBS" +COMMANDS="$PRE_COMMANDS && $BUILD_COMMANDS" +# Test CDT binary download to prevent failures due to eosio.cdt pipeline. +INDEX='1' +echo "$ curl -sSf $CDT_URL --output eosio.cdt.deb" +while ! $(curl -sSf $CDT_URL --output eosio.cdt.deb); do + echo "ERROR: Expected CDT binary for commit ${CDT_COMMIT} from $CDT_VERSION. It does not exist at $CDT_URL!" + printf "There must be a successful build against ${CDT_COMMIT} \033]1339;url=https://buildkite.com/EOSIO/eosio-dot-cdt/builds?commit=$CDT_COMMIT;content=here\a for this package to exist.\n" + echo "Attempt $INDEX, retry in 60 seconds..." + echo '' + INDEX=$(( $INDEX + 1 )) + sleep 60 +done +# retry docker pull to protect against failures due to race conditions with eosio pipeline +INDEX='1' +echo "$ docker pull $DOCKER_IMAGE" +while [[ "$(docker pull $DOCKER_IMAGE 2>&1 | grep -ice "manifest for $DOCKER_IMAGE not found")" != '0' ]]; do + echo "ERROR: Docker image \"$DOCKER_IMAGE\" not found for eosio \"$EOSIO_VERSION\""'!' + printf "There must be a successful build against ${EOSIO_VERSION} \033]1339;url=${EOSIO_BK_URL};content=here\a for this container to exist.\n" + echo "Attempt $INDEX, retry in 60 seconds..." + echo '' + INDEX=$(( $INDEX + 1 )) + sleep 60 +done +# run +echo "docker run $ARGS $(buildkite-intrinsics) $DOCKER_IMAGE bash -c \"$COMMANDS\"" +eval docker run $ARGS $(buildkite-intrinsics) $DOCKER_IMAGE bash -c \"$COMMANDS\" \ No newline at end of file diff --git a/.cicd/helpers/buildkite.sh b/.cicd/helpers/buildkite.sh new file mode 100755 index 000000000..1d2eee398 --- /dev/null +++ b/.cicd/helpers/buildkite.sh @@ -0,0 +1,11 @@ +# load buildkite intrinsic environment variables for use in docker run +function buildkite-intrinsics() +{ + BK_ENV='' + if [[ -f $BUILDKITE_ENV_FILE ]]; then + while read -r var; do + BK_ENV="$BK_ENV --env ${var%%=*}" + done < "$BUILDKITE_ENV_FILE" + fi + echo "$BK_ENV" +} \ No newline at end of file diff --git a/.cicd/helpers/dependency-info.sh b/.cicd/helpers/dependency-info.sh new file mode 100755 index 000000000..ef7e1d052 --- /dev/null +++ b/.cicd/helpers/dependency-info.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -eo pipefail +[[ "$RAW_PIPELINE_CONFIG" == '' ]] && export RAW_PIPELINE_CONFIG="$1" +[[ "$RAW_PIPELINE_CONFIG" == '' ]] && export RAW_PIPELINE_CONFIG='pipeline.jsonc' +[[ "$PIPELINE_CONFIG" == '' ]] && export PIPELINE_CONFIG='pipeline.json' +# read dependency file +if [[ -f "$RAW_PIPELINE_CONFIG" ]]; then + echo 'Reading pipeline configuration file...' + cat "$RAW_PIPELINE_CONFIG" | grep -Po '^[^"/]*("((?<=\\).|[^"])*"[^"/]*)*' | jq -c .\"eosio-dot-contracts\" > "$PIPELINE_CONFIG" + CDT_VERSION=$(cat "$PIPELINE_CONFIG" | jq -r '.dependencies."eosio.cdt"') + EOSIO_VERSION=$(cat "$PIPELINE_CONFIG" | jq -r '.dependencies.eosio') + SANITIZED_EOSIO_VERSION=$(echo $EOSIO_VERSION | sed 's/\//\_/') +else + echo 'ERROR: No pipeline configuration file or dependencies file found!' + exit 1 +fi +# search GitHub for commit hash by tag and branch, preferring tag if both match +if [[ "$BUILDKITE" == 'true' ]]; then + CDT_COMMIT=$((curl -s https://api.github.com/repos/EOSIO/eosio.cdt/git/refs/tags/$CDT_VERSION && curl -s https://api.github.com/repos/EOSIO/eosio.cdt/git/refs/heads/$CDT_VERSION) | jq '.object.sha' | sed "s/null//g" | sed "/^$/d" | tr -d '"' | sed -n '1p') + EOSIO_COMMIT=$((curl -s https://api.github.com/repos/EOSIO/eos/git/refs/tags/$EOSIO_VERSION && curl -s https://api.github.com/repos/EOSIO/eos/git/refs/heads/$EOSIO_VERSION) | jq '.object.sha' | sed "s/null//g" | sed "/^$/d" | tr -d '"' | sed -n '1p') + test -z "$CDT_COMMIT" && CDT_COMMIT=$(echo $CDT_VERSION | tr -d '"' | tr -d "''" | cut -d ' ' -f 1) # if both searches returned nothing, the version is probably specified by commit hash already + test -z "$EOSIO_COMMIT" && EOSIO_COMMIT=$(echo $EOSIO_VERSION | tr -d '"' | tr -d "''" | cut -d ' ' -f 1) # if both searches returned nothing, the version is probably specified by commit hash already +else + git clone https://github.com/EOSIO/eosio.cdt && cd eosio.cdt + git pull && git checkout $CDT_VERSION + CDT_COMMIT=$(git rev-parse --verify HEAD) + cd .. + git clone https://github.com/EOSIO/eos && cd eos + git pull && git checkout $EOSIO_VERSION + EOSIO_COMMIT=$(git rev-parse --verify HEAD) + cd .. +fi +if [[ "$EOSIO_COMMIT" == "$EOSIO_VERSION" ]]; then + EOSIO_BK_URL="https://buildkite.com/EOSIO/eosio/builds?commit=${EOSIO_COMMIT}" +else + EOSIO_BK_URL="https://buildkite.com/EOSIO/eosio/builds?branch=${EOSIO_VERSION}" +fi +echo "Using eosio \"$EOSIO_VERSION\"..." +echo "Using cdt ${CDT_COMMIT} from \"$CDT_VERSION\"..." +export CDT_URL="https://eos-public-oss-binaries.s3-us-west-2.amazonaws.com/${CDT_COMMIT:0:7}-eosio.cdt-ubuntu-18.04_amd64.deb" \ No newline at end of file diff --git a/.cicd/helpers/general.sh b/.cicd/helpers/general.sh new file mode 100644 index 000000000..42b041177 --- /dev/null +++ b/.cicd/helpers/general.sh @@ -0,0 +1,6 @@ +export ROOT_DIR=$( dirname "${BASH_SOURCE[0]}" )/../.. +export BUILD_DIR=$ROOT_DIR/build +export CICD_DIR=$ROOT_DIR/.cicd +export HELPERS_DIR=$CICD_DIR/helpers +export JOBS=${JOBS:-"$(getconf _NPROCESSORS_ONLN)"} +export MOUNTED_DIR='/workdir' diff --git a/.cicd/metrics/test-metrics.js b/.cicd/metrics/test-metrics.js new file mode 100644 index 000000000..b995134d9 --- /dev/null +++ b/.cicd/metrics/test-metrics.js @@ -0,0 +1,431 @@ +#!/usr/bin/env node +/* includes */ +const execSync = require('child_process').execSync; // run shell commands +const fetch = require('node-fetch'); // downloading +const fs = require('fs'); // file stream +const XML = require('xml2js'); // parse xml + +/* globals */ +const buildkiteAccessToken = `?access_token=${process.env.BUILDKITE_API_KEY}`; // import buildkite access token from environment +const debug = (process.env.DEBUG === 'true') ? true : false; +let errorCount = 0; // count number of jobs which caused an error +const EXIT_SUCCESS = 0; +const inBuildkite = (process.env.BUILDKITE === 'true') ? true : false; +const outputFile = 'test-metrics.json'; +const pipelineWhitelist = // the pipelines for which we run diagnostics +[ + 'eosio', + 'eosio-base-images', + 'eosio-beta', + 'eosio-build-unpinned', + 'eosio-debug', + 'eosio-lrt', + 'eosio-security' +]; + +/* functions */ +// given a url string, download a text document +async function download(url) +{ + if (debug) console.log(`download(${url.replace(buildkiteAccessToken, '')})`); // DEBUG + const httpResponse = await fetch(url); + const body = await httpResponse.text(); + if (isNullOrEmpty(body)) + { + console.log(`ERROR: URL returned nothing! URL: ${url.replace(buildkiteAccessToken, '')}`); + const error = + { + http: { body, response: httpResponse, url}, + message: 'http body is null or empty', + origin: 'download()', + } + throw error; + } + if (debug) console.log('Download complete.'); // DEBUG + return body; +} + +// given a pipeline and a build number, get a build object +async function getBuild(pipeline, buildNumber) +{ + if (debug) console.log(`getBuild(${pipeline}, ${buildNumber})`); // DEBUG + const httpResponse = await fetch(`https://api.buildkite.com/v2/organizations/EOSIO/pipelines/${pipeline}/builds/${buildNumber}${buildkiteAccessToken}`); + return httpResponse.json(); +} + +// given a buildkite job, return the environmental variables +async function getEnvironment(job) +{ + if (debug) console.log('getEnvironment()'); // DEBUG + const httpResponse = await fetch(`${job.build_url}/jobs/${job.id}/env${buildkiteAccessToken}`); + const environment = await httpResponse.json(); + return environment.env; +} + +// given a string to search, a key as regex or a string, and optionally a start index, return the lowest line number containing the key +function getLineNumber(text, key, startIndex) +{ + if (debug) console.log('getLineNumber()'); // DEBUG + const begin = (isNullOrEmpty(startIndex) || !Number.isInteger(startIndex) || startIndex < 1) ? 0 : startIndex; + let found = false; + let lineNumber = 0; + const regex = (key instanceof RegExp); + text.split('\n').some((line) => + { + if (lineNumber >= begin && ((regex && key.test(line)) || (!regex && line.includes(key)))) + { + found = true; + return true; // c-style break + } + lineNumber += 1; + return false; // for the linter, plz delete when linter is fixed + }); + return (found) ? lineNumber : -1; +} + +// given a buildkite job, return a sanitized log file +async function getLog(job) +{ + if (debug) console.log(`getLog(${job.raw_log_url})`); // DEBUG + const logText = await download(job.raw_log_url + buildkiteAccessToken); + // returns log lowercase, with single spaces and '\n' only, and only ascii-printable characters + return sanitize(logText); // made this a separate function for unit testing purposes +} + +// given a Buildkite environment, return the operating system used +function getOS(environment) +{ + if (debug) console.log(`getOS(${environment.BUILDKITE_LABEL})`); // DEBUG + if (isNullOrEmpty(environment) || isNullOrEmpty(environment.BUILDKITE_LABEL)) + { + console.log('ERROR: getOS() called with empty environment.BUILDKITE_LABEL!'); + console.log(JSON.stringify(environment)); + return null; + } + const label = environment.BUILDKITE_LABEL.toLowerCase(); + if ((/aws(?!.*[23])/.test(label) || /amazon(?!.*[23])/.test(label))) + return 'Amazon Linux 1'; + if (/aws.*2/.test(label) || /amazon.*2/.test(label)) + return 'Amazon Linux 2'; + if (/centos(?!.*[89])/.test(label)) + return 'CentOS 7'; + if (/fedora(?!.*2[89])/.test(label) && /fedora(?!.*3\d)/.test(label)) + return 'Fedora 27'; + if (/high.*sierra/.test(label)) + return 'High Sierra'; + if (/mojave/.test(label)) + return 'Mojave'; + if (/ubuntu.*16.*04/.test(label) || /ubuntu.*16(?!.*10)/.test(label)) + return 'Ubuntu 16.04'; + if (/ubuntu.*18.*04/.test(label) || /ubuntu.*18(?!.*10)/.test(label)) + return 'Ubuntu 18.04'; + if (/docker/.test(label)) + return 'Docker'; + return 'Unknown'; +} + +// given a Buildkite job, return the test-results.xml file as JSON +async function getXML(job) +{ + if (debug) console.log('getXML()'); // DEBUG + const xmlFilename = 'test-results.xml'; + const artifacts = await download(job.artifacts_url + buildkiteAccessToken); + const testResultsArtifact = JSON.parse(artifacts).filter(artifact => artifact.filename === xmlFilename); + if (isNullOrEmpty(testResultsArtifact)) + { + console.log(`WARNING: No ${xmlFilename} found for "${job.name}"! Link: ${job.web_url}`); + return null; + } + const urlBuildkite = testResultsArtifact[0].download_url; + const rawXML = await download(urlBuildkite + buildkiteAccessToken); + const xmlOptions = + { + attrNameProcessors: [function lower(name) { return name.toLowerCase(); }], + explicitArray: false, // do not put single strings in single-element arrays + mergeAttrs: true, // make attributes children of their node + normalizeTags: true, // convert all tag names to lowercase + }; + let xmlError, xmlTestResults; + await XML.parseString(rawXML, xmlOptions, (err, result) => {xmlTestResults = result; xmlError = err;}); + if (isNullOrEmpty(xmlError)) + return xmlTestResults; + console.log(`WARNING: Failed to parse xml for "${job.name}" job! Link: ${job.web_url}`); + console.log(JSON.stringify(xmlError)); + return null; +} + +// test if variable is empty +function isNullOrEmpty(str) +{ + return (str === null || str === undefined || str.length === 0 || /^\s*$/.test(str)); +} + +// return array of test results from a buildkite job log +function parseLog(logText) +{ + if (debug) console.log('parseLog()'); // DEBUG + const lines = logText.split('\n'); + const resultLines = lines.filter(line => /test\s+#\d+/.test(line)); // 'grep' for the test result lines + // parse the strings and make test records + return resultLines.map((line) => + { + const y = line.trim().split(/test\s+#\d+/).pop(); // remove everything before the test declaration + const parts = y.split(/\s+/).slice(1, -1); // split the line and remove the test number and time unit + const testName = parts[0]; + const testTime = parts[(parts.length - 1)]; + const rawResult = parts.slice(1, -1).join(); + let testResult; + if (rawResult.includes('failed')) + testResult = 'Failed'; + else if (rawResult.includes('passed')) + testResult = 'Passed'; + else + testResult = 'Exception'; + return { testName, testResult, testTime }; // create a test record + }); +} + +// return array of test results from an xUnit-formatted JSON object +function parseXunit(xUnit) +{ + if (debug) console.log('parseXunit()'); // DEBUG + if (isNullOrEmpty(xUnit)) + { + console.log('WARNING: xUnit is empty!'); + return null; + } + return xUnit.site.testing.test.map((test) => + { + const testName = test.name; + const testTime = test.results.namedmeasurement.filter(x => /execution\s+time/.test(x.name.toLowerCase()))[0].value; + let testResult; + if (test.status.includes('failed')) + testResult = 'Failed'; + else if (test.status.includes('passed')) + testResult = 'Passed'; + else + testResult = 'Exception'; + return { testName, testResult, testTime }; + }); +} + +// returns text lowercase, with single spaces and '\n' only, and only ascii-printable characters +function sanitize(text) +{ + if (debug) console.log(`sanitize(text) where text.length = ${text.length} bytes`); // DEBUG + const chunkSize = 131072; // process text in 128 kB chunks + if (text.length > chunkSize) + return sanitize(text.slice(0, chunkSize)).concat(sanitize(text.slice(chunkSize))); + return text + .replace(/(?!\n)\r(?!\n)/g, '\n').replace(/\r/g, '') // convert all line endings to '\n' + .replace(/[^\S\n]+/g, ' ') // convert all whitespace to ' ' + .replace(/[^ -~\n]+/g, '') // remove non-printable characters + .toLowerCase(); +} + +// input is array of whole lines containing "test #" and ("failed" or "exception") +function testDiagnostics(test, logText) +{ + if (debug) + { + console.log(`testDiagnostics(test, logText) where logText.length = ${logText.length} bytes and test is`); // DEBUG + console.log(JSON.stringify(test)); + } + // get basic information + const testResultLine = new RegExp(`test\\s+#\\d+.*${test.testName}`, 'g'); // regex defining "test #" line + const startIndex = getLineNumber(logText, testResultLine); + const output = { errorMsg: null, lineNumber: startIndex + 1, stackTrace: null }; // default output + // filter tests + if (test.testResult.toLowerCase() === 'passed') + return output; + output.errorMsg = 'test diangostics are not enabled for this pipeline'; + if (!pipelineWhitelist.includes(test.pipeline)) + return output; + // diagnostics + if (debug) console.log('Running diagnostics...'); // DEBUG + output.errorMsg = 'uncategorized'; + const testLog = logText.split(testResultLine)[1].split(/test\s*#/)[0].split('\n'); // get log output from this test only, as array of lines + let errorLine = testLog[0]; // first line, from "test ## name" to '\n' exclusive + if (/\.+ *\** *not run\s+0+\.0+ sec$/.test(errorLine)) // not run + output.errorMsg = 'test not run'; + else if (/\.+ *\** *time *out\s+\d+\.\d+ sec$/.test(errorLine)) // timeout + output.errorMsg = 'test timeout'; + else if (/exception/.test(errorLine)) // test exception + output.errorMsg = errorLine.split('exception')[1].replace(/[: \d.]/g, '').replace(/sec$/, ''); // isolate the error message after exception + else if (/fc::.*exception/.test(testLog.filter(line => !isNullOrEmpty(line))[1])) // fc exception + { + [, errorLine] = testLog.filter(line => !isNullOrEmpty(line)); // get first line + output.errorMsg = `fc::${errorLine.split('::')[1].replace(/['",]/g, '').split(' ')[0]}`; // isolate fx exception body + } + else if (testLog.join('\n').includes('ctest:')) // ctest exception + { + [errorLine] = testLog.filter(line => line.includes('ctest:')); + output.errorMsg = `ctest:${errorLine.split('ctest:')[1]}`; + } + else if (!isNullOrEmpty(testLog.filter(line => /boost.+exception/.test(line)))) // boost exception + { + [errorLine] = testLog.filter(line => /boost.+exception/.test(line)); + output.errorMsg = `boost: ${errorLine.replace(/[()]/g, '').split(/: (.+)/)[1]}`; // capturing parenthesis, split only at first ' :' + output.stackTrace = testLog.filter(line => /thread-\d+/.test(line))[0].split('thread-')[1].replace(/^\d+/, '').trim().replace(/[[]\d+m$/, ''); // get the bottom of the stack trace + } + else if (/unit[-_. ]+test/.test(test.testName) || /plugin[-_. ]+test/.test(test.testName)) // unit test, application exception + { + if (!isNullOrEmpty(testLog.filter(line => line.includes('exception: ')))) + { + [errorLine] = testLog.filter(line => line.includes('exception: ')); + [, output.errorMsg] = errorLine.replace(/[()]/g, '').split(/: (.+)/); // capturing parenthesis, split only at first ' :' + output.stackTrace = testLog.filter(line => /thread-\d+/.test(line))[0].split('thread-')[1].replace(/^\d+/, '').trim().replace(/[[]\d+m$/, ''); // get the bottom of the stack trace + } + // else uncategorized unit test + } + // else integration test, add cross-referencing code here (or uncategorized) + if (errorLine !== testLog[0]) // get real line number from log file + output.lineNumber = getLineNumber(logText, errorLine, startIndex) + 1; + return output; +} + +// return test metrics given a buildkite job or build +async function testMetrics(buildkiteObject) +{ + if (!isNullOrEmpty(buildkiteObject.type)) // input is a Buildkite job object + { + const job = buildkiteObject; + console.log(`Processing test metrics for "${job.name}"${(inBuildkite) ? '' : ` at ${job.web_url}`}...`); + if (isNullOrEmpty(job.exit_status)) + { + console.log(`${(inBuildkite) ? '+++ :warning: ' : ''}WARNING: "${job.name}" was skipped!`); + return null; + } + // get test results + const logText = await getLog(job); + let testResults; + let xUnit; + try + { + xUnit = await getXML(job); + testResults = parseXunit(xUnit); + } + catch (error) + { + console.log(`XML processing failed for "${job.name}"! Link: ${job.web_url}`); + console.log(JSON.stringify(error)); + testResults = null; + } + finally + { + if (isNullOrEmpty(testResults)) + testResults = parseLog(logText); + } + // get test metrics + const env = await getEnvironment(job); + env.BUILDKITE_REPO = env.BUILDKITE_REPO.replace(new RegExp('^git@github.com:(EOSIO/)?'), '').replace(new RegExp('.git$'), ''); + const metrics = []; + const os = getOS(env); + testResults.forEach((result) => + { + // add test properties + const test = + { + ...result, // add testName, testResult, testTime + agentName: env.BUILDKITE_AGENT_NAME, + agentRole: env.BUILDKITE_AGENT_META_DATA_QUEUE || env.BUILDKITE_AGENT_META_DATA_ROLE, + branch: env.BUILDKITE_BRANCH, + buildNumber: env.BUILDKITE_BUILD_NUMBER, + commit: env.BUILDKITE_COMMIT, + job: env.BUILDKITE_LABEL, + os, + pipeline: env.BUILDKITE_PIPELINE_SLUG, + repo: env.BUILDKITE_REPO, + testTime: parseFloat(result.testTime), + url: job.web_url, + }; + metrics.push({ ...test, ...testDiagnostics(test, logText) }); + }); + return metrics; + } + else if (!isNullOrEmpty(buildkiteObject.number)) // input is a Buildkite build object + { + const build = buildkiteObject; + console.log(`Processing test metrics for ${build.pipeline.slug} build ${build.number}${(inBuildkite) ? '' : ` at ${build.web_url}`}...`); + let metrics = [], promises = []; + // process test metrics + build.jobs.filter(job => job.type === 'script' && /test/.test(job.name.toLowerCase()) && ! /test metrics/.test(job.name.toLowerCase())).forEach((job) => + { + promises.push( + testMetrics(job) + .then((moreMetrics) => { + if (!isNullOrEmpty(moreMetrics)) + metrics = metrics.concat(moreMetrics); + else + console.log(`${(inBuildkite) ? '+++ :warning: ' : ''}WARNING: "${job.name}" metrics are empty!\nmetrics = ${JSON.stringify(moreMetrics)}`); + }).catch((error) => { + console.log(`${(inBuildkite) ? '+++ :no_entry: ' : ''}ERROR: Failed to process test metrics for "${job.name}"! Link: ${job.web_url}`); + console.log(JSON.stringify(error)); + errorCount++; + }) + ); + }); + await Promise.all(promises); + return metrics; + } + else // something else + { + console.log(`${(inBuildkite) ? '+++ :no_entry: ' : ''}ERROR: Buildkite object not recognized or not a test step!`); + console.log(JSON.stringify({buildkiteObject})); + return null; + } +} + +/* main */ +async function main() +{ + if (debug) console.log(`$ ${process.argv.join(' ')}`); + let build, metrics = null; + console.log(`${(inBuildkite) ? '+++ :evergreen_tree: ' : ''}Getting information from enviroment...`); + const buildNumber = process.env.BUILDKITE_BUILD_NUMBER || process.argv[2]; + const pipeline = process.env.BUILDKITE_PIPELINE_SLUG || process.argv[3]; + if (debug) + { + console.log(`BUILDKITE=${process.env.BUILDKITE}`); + console.log(`BUILDKITE_BUILD_NUMBER=${process.env.BUILDKITE_BUILD_NUMBER}`); + console.log(`BUILDKITE_PIPELINE_SLUG=${process.env.BUILDKITE_PIPELINE_SLUG}`); + console.log(' State:') + console.log(`inBuildkite = "${inBuildkite}"`); + console.log(`buildNumber = "${buildNumber}"`); + console.log(`pipeline = "${pipeline}"`); + } + if (isNullOrEmpty(buildNumber) || isNullOrEmpty(pipeline) || isNullOrEmpty(process.env.BUILDKITE_API_KEY)) + { + console.log(`${(inBuildkite) ? '+++ :no_entry: ' : ''}ERROR: Missing required inputs!`); + if (isNullOrEmpty(process.env.BUILDKITE_API_KEY)) console.log('- Buildkite API key, as BUILDKITE_API_KEY environment variable'); + if (isNullOrEmpty(buildNumber)) console.log('- Build Number, as BUILDKITE_BUILD_NUMBER or argument 1'); + if (isNullOrEmpty(pipeline)) console.log('- Pipeline Slug, as BUILDKITE_PIPELINE_SLUG or argument 2'); + errorCount = -1; + } + else + { + console.log(`${(inBuildkite) ? '+++ :bar_chart: ' : ''}Processing test metrics...`); + build = await getBuild(pipeline, buildNumber); + metrics = await testMetrics(build); + console.log('Done processing test metrics.'); + } + console.log(`${(inBuildkite) ? '+++ :pencil: ' : ''}Writing to file...`); + fs.writeFileSync(outputFile, JSON.stringify({ metrics })); + console.log(`Saved metrics to "${outputFile}" in "${process.cwd()}".`); + if (inBuildkite) + { + console.log('+++ :arrow_up: Uploading artifact...'); + execSync(`buildkite-agent artifact upload ${outputFile}`); + } + if (errorCount === 0) + console.log(`${(inBuildkite) ? '+++ :white_check_mark: ' : ''}Done!`); + else + { + console.log(`${(inBuildkite) ? '+++ :warning: ' : ''}Finished with errors.`); + console.log(`Please send automation a link to this job${(isNullOrEmpty(build)) ? '.' : `: ${build.web_url}`}`); + console.log('@kj4ezj or @zreyn on Telegram'); + } + return (inBuildkite) ? process.exit(EXIT_SUCCESS) : process.exit(errorCount); +}; + +main(); \ No newline at end of file diff --git a/.cicd/metrics/test-metrics.tar.gz b/.cicd/metrics/test-metrics.tar.gz new file mode 100644 index 000000000..2381787ca Binary files /dev/null and b/.cicd/metrics/test-metrics.tar.gz differ diff --git a/.cicd/pipeline.yml b/.cicd/pipeline.yml new file mode 100644 index 000000000..7d2839846 --- /dev/null +++ b/.cicd/pipeline.yml @@ -0,0 +1,38 @@ +steps: + - wait + + - label: ":ubuntu: Ubuntu 18.04 - Build" + command: | + ./.cicd/build.sh + tar -pczf build.tar.gz build + buildkite-agent artifact upload build.tar.gz + agents: + queue: "automation-eks-eos-builder-fleet" + timeout: "${TIMEOUT:-60}" + skip: "$SKIP_UBUNTU_18" + + - wait + + - label: ":ubuntu: Ubuntu 18.04 - Test" + command: | + buildkite-agent artifact download build.tar.gz . --step ':ubuntu: Ubuntu 18.04 - Build' + tar -xzf build.tar.gz + ./.cicd/test.sh + agents: + queue: "automation-eks-eos-tester-fleet" + timeout: "${TIMEOUT:-10}" + skip: "$SKIP_UBUNTU_18" + + - wait: + continue_on_failure: true + + - label: ":bar_chart: Test Metrics" + command: | + echo '+++ :compression: Extracting Test Metrics Code' + tar -zxf .cicd/metrics/test-metrics.tar.gz + echo '+++ :javascript: Running test-metrics.js' + node --max-old-space-size=32768 test-metrics.js + agents: + queue: "automation-eks-eos-tester-fleet" + timeout: 10 + soft_fail: true \ No newline at end of file diff --git a/.cicd/test.sh b/.cicd/test.sh new file mode 100755 index 000000000..ea0d181e4 --- /dev/null +++ b/.cicd/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -eo pipefail +. ./.cicd/helpers/buildkite.sh +. ./.cicd/helpers/general.sh +mkdir -p $BUILD_DIR +if [[ "$BUILDKITE" == 'true' ]]; then + CDT_URL="$(buildkite-agent meta-data get cdt-url)" + CDT_VERSION="$(buildkite-agent meta-data get cdt-version)" + DOCKER_IMAGE="$(buildkite-agent meta-data get docker-image)" +else # Actions + . ./.cicd/helpers/dependency-info.sh + DOCKER_IMAGE=${DOCKER_IMAGE:-eosio/ci-contracts-builder:base-ubuntu-18.04-$SANITIZED_EOSIO_VERSION} +fi +ARGS=${ARGS:-"--rm -v $(pwd):$MOUNTED_DIR"} +CDT_COMMANDS="dpkg -i $MOUNTED_DIR/eosio.cdt.deb && export PATH=/usr/opt/eosio.cdt/$CDT_VERSION/bin:\\\$PATH" +PRE_COMMANDS="$CDT_COMMANDS && cd $MOUNTED_DIR/build/tests" +TEST_COMMANDS="ctest -j $JOBS --output-on-failure -T Test" +COMMANDS="$PRE_COMMANDS && $TEST_COMMANDS" +curl -sSf $CDT_URL --output eosio.cdt.deb +set +e +echo "docker run $ARGS $(buildkite-intrinsics) $DOCKER_IMAGE bash -c \"$COMMANDS\"" +eval docker run $ARGS $(buildkite-intrinsics) $DOCKER_IMAGE bash -c \"$COMMANDS\" +EXIT_STATUS=$? +# buildkite +if [[ "$BUILDKITE" == 'true' ]]; then + cd build + # upload artifacts + echo '+++ :arrow_up: Uploading Artifacts' + echo 'Exporting xUnit XML' + mv -f ./tests/Testing/$(ls ./tests/Testing/ | grep '2' | tail -n 1)/Test.xml test-results.xml + echo 'Uploading artifacts' + buildkite-agent artifact upload test-results.xml + echo 'Done uploading artifacts.' +fi +# re-throw +if [[ "$EXIT_STATUS" != 0 ]]; then + echo "Failing due to non-zero exit status from ctest: $EXIT_STATUS" + exit $EXIT_STATUS +fi \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..bff172e40 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ + + + +## Change Description + + + +## Deployment Changes +- [ ] Deployment Changes + + + + +## API Changes +- [ ] API Changes + + + + +## Documentation Additions +- [ ] Documentation Additions + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..12bf291e8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: Pull Request +on: [pull_request] + +env: + PR_NUMBER: ${{ toJson(github.event.number) }} + +jobs: + ubuntu-1804-build: + if: github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id + name: Ubuntu 18.04 | Build + runs-on: ubuntu-latest + steps: + - name: Checkout + run: | + git clone https://github.com/${GITHUB_REPOSITORY} . + git fetch -v --prune origin +refs/pull/${PR_NUMBER}/merge:refs/remotes/pull/${PR_NUMBER}/merge + git checkout --force --progress refs/remotes/pull/${PR_NUMBER}/merge + git submodule sync --recursive + git submodule update --init --force --recursive + - name: Build + run: | + ./.cicd/build.sh + tar -pczf build.tar.gz build + - name: Upload Build Artifact + uses: actions/upload-artifact@v1 + with: + name: ubuntu-1804-build + path: build.tar.gz + ubuntu-1804-parallel-test: + name: Ubuntu 18.04 | Unit Test + runs-on: ubuntu-latest + needs: ubuntu-1804-build + steps: + - name: Checkout + run: | + git clone https://github.com/${GITHUB_REPOSITORY} . + git fetch -v --prune origin +refs/pull/${PR_NUMBER}/merge:refs/remotes/pull/${PR_NUMBER}/merge + git checkout --force --progress refs/remotes/pull/${PR_NUMBER}/merge + git submodule sync --recursive + git submodule update --init --force --recursive + - name: Download Build Artifact + uses: actions/download-artifact@v1 + with: + name: ubuntu-1804-build + - name: Parallel Test + run: | + tar -xzf ubuntu-1804-build/build.tar.gz + ./.cicd/test.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index c96467890..7ddd2b135 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,28 @@ cmake_minimum_required(VERSION 3.5) -project(eosio_contracts VERSION 1.5.1) -set(EOSIO_CDT_VERSION_MIN "1.4") -set(EOSIO_CDT_VERSION_SOFT_MAX "1.4") -#set(EOSIO_CDT_VERSION_HARD_MAX "") +project(eosio_contracts) + +set(VERSION_MAJOR 1) +set(VERSION_MINOR 9) +set(VERSION_PATCH 2) +#set(VERSION_SUFFIX rc4) + +if (VERSION_SUFFIX) + set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}") +else() + set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") +endif() + +include(ExternalProject) find_package(eosio.cdt) +message(STATUS "Building eosio.contracts v${VERSION_FULL}") + +set(EOSIO_CDT_VERSION_MIN "1.7") +set(EOSIO_CDT_VERSION_SOFT_MAX "1.7") +#set(EOSIO_CDT_VERSION_HARD_MAX "") + ### Check the version of eosio.cdt set(VERSION_MATCH_ERROR_MSG "") EOSIO_CHECK_VERSION(VERSION_OUTPUT "${EOSIO_CDT_VERSION}" @@ -29,12 +45,24 @@ else() set(TEST_BUILD_TYPE ${CMAKE_BUILD_TYPE}) endif() +ExternalProject_Add( + contracts_project + SOURCE_DIR ${CMAKE_SOURCE_DIR}/contracts + BINARY_DIR ${CMAKE_BINARY_DIR}/contracts + CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake + UPDATE_COMMAND "" + PATCH_COMMAND "" + TEST_COMMAND "" + INSTALL_COMMAND "" + BUILD_ALWAYS 1 +) -add_subdirectory(eosio.bios) -add_subdirectory(eosio.msig) -add_subdirectory(eosio.wrap) -add_subdirectory(eosio.system) -add_subdirectory(eosio.token) +if (APPLE) + set(OPENSSL_ROOT "/usr/local/opt/openssl") +elseif (UNIX) + set(OPENSSL_ROOT "/usr/include/openssl") +endif() +set(SECP256K1_ROOT "/usr/local") if (APPLE) set(OPENSSL_ROOT "/usr/local/opt/openssl") @@ -43,4 +71,24 @@ elseif (UNIX) endif() set(SECP256K1_ROOT "/usr/local") -include(UnitTestsExternalProject.txt) +string(REPLACE ";" "|" TEST_PREFIX_PATH "${CMAKE_PREFIX_PATH}") +string(REPLACE ";" "|" TEST_FRAMEWORK_PATH "${CMAKE_FRAMEWORK_PATH}") +string(REPLACE ";" "|" TEST_MODULE_PATH "${CMAKE_MODULE_PATH}") + +set(BUILD_TESTS FALSE CACHE BOOL "Build unit tests") + +if(BUILD_TESTS) + message(STATUS "Building unit tests.") + ExternalProject_Add( + contracts_unit_tests + LIST_SEPARATOR | # Use the alternate list separator + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${TEST_BUILD_TYPE} -DCMAKE_PREFIX_PATH=${TEST_PREFIX_PATH} -DCMAKE_FRAMEWORK_PATH=${TEST_FRAMEWORK_PATH} -DCMAKE_MODULE_PATH=${TEST_MODULE_PATH} -DEOSIO_ROOT=${EOSIO_ROOT} -DLLVM_DIR=${LLVM_DIR} -DBOOST_ROOT=${BOOST_ROOT} + SOURCE_DIR ${CMAKE_SOURCE_DIR}/tests + BINARY_DIR ${CMAKE_BINARY_DIR}/tests + BUILD_ALWAYS 1 + TEST_COMMAND "" + INSTALL_COMMAND "" + ) +else() + message(STATUS "Unit tests will not be built. To build unit tests, set BUILD_TESTS to true.") +endif() diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..b34132628 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,148 @@ +# Contributing to eosio.contracts + +Interested in contributing? That's awesome! Here are some guidelines to get started quickly and easily: + +- [Reporting An Issue](#reporting-an-issue) + - [Bug Reports](#bug-reports) + - [Feature Requests](#feature-requests) + - [Change Requests](#change-requests) +- [Working on eosio.contracts](#working-on-eosiocontracts) + - [Feature Branches](#feature-branches) + - [Submitting Pull Requests](#submitting-pull-requests) + - [Testing and Quality Assurance](#testing-and-quality-assurance) +- [Conduct](#conduct) +- [Contributor License & Acknowledgments](#contributor-license--acknowledgments) +- [References](#references) + +## Reporting An Issue + +If you're about to raise an issue because you think you've found a problem with eosio.contracts, or you'd like to make a request for a new feature in the codebase, or any other reason… please read this first. + +The GitHub issue tracker is the preferred channel for [bug reports](#bug-reports), [feature requests](#feature-requests), and [submitting pull requests](#submitting-pull-requests), but please respect the following restrictions: + +* Please **search for existing issues**. Help us keep duplicate issues to a minimum by checking to see if someone has already reported your problem or requested your idea. + +* Please **be civil**. Keep the discussion on topic and respect the opinions of others. See also our [Contributor Code of Conduct](#conduct). + +### Bug Reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you! + +Guidelines for bug reports: + +1. **Use the GitHub issue search** — check if the issue has already been + reported. + +1. **Check if the issue has been fixed** — look for [closed issues in the + current milestone](https://github.com/EOSIO/eosio.contracts/issues?q=is%3Aissue+is%3Aclosed) or try to reproduce it + using the latest `develop` branch. + +A good bug report shouldn't leave others needing to chase you up for more information. Be sure to include the details of your environment and relevant tests that demonstrate the failure. + +[Report a bug](https://github.com/EOSIO/eosio.contracts/issues/new?title=Bug%3A) + +### Feature Requests + +Feature requests are welcome. Before you submit one be sure to have: + +1. **Use the GitHub search** and check the feature hasn't already been requested. +1. Take a moment to think about whether your idea fits with the scope and aims of the project. +1. Remember, it's up to *you* to make a strong case to convince the project's leaders of the merits of this feature. Please provide as much detail and context as possible, this means explaining the use case and why it is likely to be common. + +### Change Requests + +Change requests cover both architectural and functional changes to how eosio.contracts works. If you have an idea for a new or different dependency, a refactor, or an improvement to a feature, etc - please be sure to: + +1. **Use the GitHub search** and check someone else didn't get there first +1. Take a moment to think about the best way to make a case for, and explain what you're thinking. Are you sure this shouldn't really be + a [bug report](#bug-reports) or a [feature request](#feature-requests)? Is it really one idea or is it many? What's the context? What problem are you solving? Why is what you are suggesting better than what's already there? + +## Working on eosio.contracts + +Code contributions are welcome and encouraged! If you are looking for a good place to start, check out the [good first issue](https://github.com/EOSIO/eosio.contracts/labels/good%20first%20issue) label in GitHub issues. + +Also, please follow these guidelines when submitting code: + +### Feature Branches + +To get it out of the way: + +- **[develop](https://github.com/EOSIO/eosio.contracts/tree/develop)** is the development branch. All work on the next release happens here so you should generally branch off `develop`. Do **NOT** use this branch for a production site. +- **[master](https://github.com/EOSIO/eosio.contracts/tree/master)** contains the latest release of eosio.contracts. This branch may be used in production. Do **NOT** use this branch to work on eosio.contracts's source. + +### Submitting Pull Requests + +Pull requests are awesome. If you're looking to raise a PR for something which doesn't have an open issue, please think carefully about [raising an issue](#reporting-an-issue) which your PR can close, especially if you're fixing a bug. This makes it more likely that there will be enough information available for your PR to be properly tested and merged. + +### Testing and Quality Assurance + +Never underestimate just how useful quality assurance is. If you're looking to get involved with the code base and don't know where to start, checking out and testing a pull request is one of the most useful things you could do. + +Essentially, [check out the latest develop branch](#working-on-eosio.contracts), take it for a spin, and if you find anything odd, please follow the [bug report guidelines](#bug-reports) and let us know! + +## Conduct + +While contributing, please be respectful and constructive, so that participation in our project is a positive experience for everyone. + +Examples of behavior that contributes to creating a positive environment include: +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior include: +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others’ private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Contributor License & Acknowledgments + +Whenever you make a contribution to this project, you license your contribution under the same terms as set out in [LICENSE](./LICENSE), and you represent and warrant that you have the right to license your contribution under those terms. Whenever you make a contribution to this project, you also certify in the terms of the Developer’s Certificate of Origin set out below: + +``` +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. +``` + +## References + +* Overall CONTRIB adapted from https://github.com/mathjax/MathJax/blob/master/CONTRIBUTING.md +* Conduct section adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html diff --git a/IMPORTANT.md b/IMPORTANT.md new file mode 100644 index 000000000..ed433799c --- /dev/null +++ b/IMPORTANT.md @@ -0,0 +1,27 @@ +# Important Notice + +We (block.one and its affiliates) make available EOSIO and other software, updates, patches and documentation (collectively, Software) on a voluntary basis as a member of the EOSIO community. A condition of you accessing any Software, websites, articles, media, publications, documents or other material (collectively, Material) is your acceptance of the terms of this important notice. + +## Software +We are not responsible for ensuring the overall performance of Software or any related applications. Any test results or performance figures are indicative and will not reflect performance under all conditions. Software may contain components that are open sourced and subject to their own licenses; you are responsible for ensuring your compliance with those licenses. + +We make no representation, warranty, guarantee or undertaking in respect of Software, whether expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software. + +Wallets and related components are complex software that require the highest levels of security. If incorrectly built or used, they may compromise users’ private keys and digital assets. Wallet applications and related components should undergo thorough security evaluations before being used. Only experienced developers should work with such Software. + +Material is not made available to any person or entity that is the subject of sanctions administered or enforced by any country or government or otherwise designated on any list of prohibited or restricted parties (including but not limited to the lists maintained by the United Nations Security Council, the U.S. Government, the European Union or its Member States, or other applicable government authority) or organized or resident in a country or territory that is the subject of country-wide or territory-wide sanctions. You represent and warrant that neither you nor any party having a direct or indirect beneficial interest in you or on whose behalf you are acting as agent or nominee is such a person or entity and you will comply with all applicable import, re-import, sanctions, anti-boycott, export, and re-export control laws and regulations. If this is not accurate or you do not agree, then you must immediately cease accessing our Material and delete all copies of Software. + +Any person using or offering Software in connection with providing software, goods or services to third parties shall advise such third parties of this important notice, including all limitations, restrictions and exclusions of liability. + +## Trademarks +Block.one, EOSIO, EOS, the heptahedron and associated logos and related marks are our trademarks. Other trademarks referenced in Material are the property of their respective owners. + +## Third parties +Any reference in Material to any third party or third-party product, resource or service is not an endorsement or recommendation by Block.one. We are not responsible for, and disclaim any and all responsibility and liability for, your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so information in Material may be out of date or inaccurate. + +## Forward-looking statements +Please note that in making statements expressing Block.one’s vision, we do not guarantee anything, and all aspects of our vision are subject to change at any time and in all respects at Block.one’s sole discretion, with or without notice. We call these “forward-looking statements”, which includes statements on our website and in other Material, other than statements of historical facts, such as statements regarding EOSIO’s development, expected performance, and future features, or our business strategy, plans, prospects, developments and objectives. These statements are only predictions and reflect Block.one’s current beliefs and expectations with respect to future events; they are based on assumptions and are subject to risk, uncertainties and change at any time. + +We operate in a rapidly changing environment and new risks emerge from time to time. Given these risks and uncertainties, you are cautioned not to rely on these forward-looking statements. Actual results, performance or events may differ materially from what is predicted in the forward-looking statements. Some of the factors that could cause actual results, performance or events to differ materially from the forward-looking statements include, without limitation: technical feasibility and barriers; market trends and volatility; continued availability of capital, financing and personnel; product acceptance; the commercial success of any new products or technologies; competition; government regulation and laws; and general economic, market or business conditions. + +All statements are valid only as of the date of first posting and Block.one is under no obligation to, and expressly disclaims any obligation to, update or alter any statements, whether as a result of new information, subsequent events or otherwise. Nothing in any Material constitutes technological, financial, investment, legal or other advice, either in general or with regard to any particular situation or implementation. Please consult with experts in appropriate areas before implementing or utilizing anything contained in Material. diff --git a/LICENSE b/LICENSE index 55e80764e..22d36d65d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018, Respective Authors all rights reserved. +Copyright (c) 2017-2019 block.one and its contributors. All rights reserved. The MIT License diff --git a/README.md b/README.md index d055e7a85..cb90a374d 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,41 @@ # eosio.contracts -## Version : 1.5.1 +## Version : 1.9.2 -The design of the EOSIO blockchain calls for a number of smart contracts that are run at a privileged permission level in order to support functions such as block producer registration and voting, token staking for CPU and network bandwidth, RAM purchasing, multi-sig, etc. These smart contracts are referred to as the system, token, msig and wrap (formerly known as sudo) contracts. +The design of the EOSIO blockchain calls for a number of smart contracts that are run at a privileged permission level in order to support functions such as block producer registration and voting, token staking for CPU and network bandwidth, RAM purchasing, multi-sig, etc. These smart contracts are referred to as the bios, system, msig, wrap (formerly known as sudo) and token contracts. This repository contains examples of these privileged contracts that are useful when deploying, managing, and/or using an EOSIO blockchain. They are provided for reference purposes: - * [eosio.system](https://github.com/eosio/eosio.contracts/tree/master/eosio.system) - * [eosio.msig](https://github.com/eosio/eosio.contracts/tree/master/eosio.msig) - * [eosio.wrap](https://github.com/eosio/eosio.contracts/tree/master/eosio.wrap) + * [eosio.bios](./contracts/eosio.bios) + * [eosio.system](./contracts/eosio.system) + * [eosio.msig](./contracts/eosio.msig) + * [eosio.wrap](./contracts/eosio.wrap) The following unprivileged contract(s) are also part of the system. - * [eosio.token](https://github.com/eosio/eosio.contracts/tree/master/eosio.token) + * [eosio.token](./contracts/eosio.token) Dependencies: -* [eosio v1.4.x](https://github.com/EOSIO/eos/releases/tag/v1.4.4) -* [eosio.cdt v1.4.x](https://github.com/EOSIO/eosio.cdt/releases/tag/v1.4.1) - -To build the contracts and the unit tests: -* First, ensure that your __eosio__ is compiled to the core symbol for the EOSIO blockchain that intend to deploy to. -* Second, make sure that you have ```sudo make install```ed __eosio__. -* Then just run the ```build.sh``` in the top directory to build all the contracts and the unit tests for these contracts. - -After build: -* The unit tests executable is placed in the _build/tests_ and is named __unit_test__. -* The contracts are built into a _bin/\_ folder in their respective directories. -* Finally, simply use __cleos__ to _set contract_ by pointing to the previously mentioned directory. +* [eosio.cdt v1.7.x](https://github.com/EOSIO/eosio.cdt/releases/tag/v1.7.0) +* [eosio v2.0.x](https://github.com/EOSIO/eos/releases/tag/v2.0.8) (optional dependency only needed to build unit tests) + +## Build + +To build the contracts follow the instructions in [Build and deploy](https://developers.eos.io/manuals/eosio.contracts/latest/build-and-deploy) section. + +## Contributing + +[Contributing Guide](./CONTRIBUTING.md) + +[Code of Conduct](./CONTRIBUTING.md#conduct) + +## License + +[MIT](./LICENSE) + +The included icons are provided under the same terms as the software and accompanying documentation, the MIT License. We welcome contributions from the artistically-inclined members of the community, and if you do send us alternative icons, then you are providing them under those same terms. + +## Important + +See [LICENSE](./LICENSE) for copyright and license terms. + +All repositories and other materials are provided subject to the terms of this [IMPORTANT](./IMPORTANT.md) notice and you must familiarize yourself with its terms. The notice contains important information, limitations and restrictions relating to our software, publications, trademarks, third-party resources, and forward-looking statements. By accessing any of our repositories and other materials, you accept and agree to the terms of the notice. diff --git a/UnitTestsExternalProject.txt b/UnitTestsExternalProject.txt deleted file mode 100644 index 30ba24fbe..000000000 --- a/UnitTestsExternalProject.txt +++ /dev/null @@ -1,17 +0,0 @@ -include(ExternalProject) -find_package(Git REQUIRED) -include(GNUInstallDirs) - -string(REPLACE ";" "|" TEST_FRAMEWORK_PATH "${CMAKE_FRAMEWORK_PATH}") -string(REPLACE ";" "|" TEST_MODULE_PATH "${CMAKE_MODULE_PATH}") - -ExternalProject_Add( - contracts_unit_tests - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${TEST_BUILD_TYPE} -DCMAKE_FRAMEWORK_PATH=${TEST_FRAMEWORK_PATH} -DCMAKE_MODULE_PATH=${TEST_MODULE_PATH} -DEOSIO_ROOT=${EOSIO_ROOT} -DLLVM_DIR=${LLVM_DIR} - SOURCE_DIR ${CMAKE_SOURCE_DIR}/tests - BINARY_DIR ${CMAKE_BINARY_DIR}/tests - BUILD_ALWAYS 1 - TEST_COMMAND "" - INSTALL_COMMAND "" -) diff --git a/build.sh b/build.sh index 5ef9e1ebf..558736ccc 100755 --- a/build.sh +++ b/build.sh @@ -1,13 +1,84 @@ -#! /bin/bash +#!/usr/bin/env bash +set -eo pipefail -printf "\t=========== Building eosio.contracts ===========\n\n" +function usage() { + printf "Usage: $0 OPTION... + -e DIR Directory where EOSIO is installed. (Default: $HOME/eosio/X.Y) + -c DIR Directory where EOSIO.CDT is installed. (Default: /usr/local/eosio.cdt) + -t Build unit tests. + -y Noninteractive mode (Uses defaults for each prompt.) + -h Print this help menu. + \\n" "$0" 1>&2 + exit 1 +} + +BUILD_TESTS=false + +if [ $# -ne 0 ]; then + while getopts "e:c:tyh" opt; do + case "${opt}" in + e ) + EOSIO_DIR_PROMPT=$OPTARG + ;; + c ) + CDT_DIR_PROMPT=$OPTARG + ;; + t ) + BUILD_TESTS=true + ;; + y ) + NONINTERACTIVE=true + PROCEED=true + ;; + h ) + usage + ;; + ? ) + echo "Invalid Option!" 1>&2 + usage + ;; + : ) + echo "Invalid Option: -${OPTARG} requires an argument." 1>&2 + usage + ;; + * ) + usage + ;; + esac + done +fi + +# Source helper functions and variables. +. ./scripts/.environment +. ./scripts/helper.sh + +if [[ ${BUILD_TESTS} == true ]]; then + # Prompt user for location of eosio. + eosio-directory-prompt +fi + +# Prompt user for location of eosio.cdt. +cdt-directory-prompt +# Include CDT_INSTALL_DIR in CMAKE_FRAMEWORK_PATH +echo "Using EOSIO.CDT installation at: $CDT_INSTALL_DIR" +export CMAKE_FRAMEWORK_PATH="${CDT_INSTALL_DIR}:${CMAKE_FRAMEWORK_PATH}" + +if [[ ${BUILD_TESTS} == true ]]; then + # Ensure eosio version is appropriate. + nodeos-version-check + + # Include EOSIO_INSTALL_DIR in CMAKE_FRAMEWORK_PATH + echo "Using EOSIO installation at: $EOSIO_INSTALL_DIR" + export CMAKE_FRAMEWORK_PATH="${EOSIO_INSTALL_DIR}:${CMAKE_FRAMEWORK_PATH}" +fi + +printf "\t=========== Building eosio.contracts ===========\n\n" RED='\033[0;31m' NC='\033[0m' - -CORES=`getconf _NPROCESSORS_ONLN` +CPU_CORES=$(getconf _NPROCESSORS_ONLN) mkdir -p build pushd build &> /dev/null -cmake ../ -make -j${CORES} +cmake -DBUILD_TESTS=${BUILD_TESTS} ../ +make -j $CPU_CORES popd &> /dev/null diff --git a/contracts/CMakeLists.txt b/contracts/CMakeLists.txt new file mode 100644 index 000000000..69d438e14 --- /dev/null +++ b/contracts/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required( VERSION 3.5 ) + +project(contracts) + +set(EOSIO_WASM_OLD_BEHAVIOR "Off") +find_package(eosio.cdt) + +set(ICON_BASE_URL "http://127.0.0.1/ricardian_assets/eosio.contracts/icons") + +set(ACCOUNT_ICON_URI "account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f") +set(ADMIN_ICON_URI "admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e") +set(MULTISIG_ICON_URI "multisig.png#4fb41d3cf02d0dd2d35a29308e93c2d826ec770d6bb520db668f530764be7153") +set(RESOURCE_ICON_URI "resource.png#3830f1ce8cb07f7757dbcf383b1ec1b11914ac34a1f9d8b065f07600fa9dac19") +set(REX_ICON_URI "rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8") +set(TOKEN_ICON_URI "token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654") +set(TRANSFER_ICON_URI "transfer.png#5dfad0df72772ee1ccc155e670c1d124f5c5122f1d5027565df38b418042d1dd") +set(VOTING_ICON_URI "voting.png#db28cd3db6e62d4509af3644ce7d377329482a14bb4bfaca2aa5f1400d8e8a84") + +add_subdirectory(eosio.bios) +add_subdirectory(eosio.msig) +add_subdirectory(eosio.system) +add_subdirectory(eosio.token) +add_subdirectory(eosio.wrap) diff --git a/contracts/eosio.bios/CMakeLists.txt b/contracts/eosio.bios/CMakeLists.txt new file mode 100644 index 000000000..3709f70c1 --- /dev/null +++ b/contracts/eosio.bios/CMakeLists.txt @@ -0,0 +1,13 @@ +add_contract(eosio.bios eosio.bios ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.bios.cpp) + +target_include_directories(eosio.bios + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include) + +set_target_properties(eosio.bios + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ricardian/eosio.bios.contracts.md.in ${CMAKE_CURRENT_BINARY_DIR}/ricardian/eosio.bios.contracts.md @ONLY ) + +target_compile_options( eosio.bios PUBLIC -R${CMAKE_CURRENT_SOURCE_DIR}/ricardian -R${CMAKE_CURRENT_BINARY_DIR}/ricardian ) diff --git a/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp b/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp new file mode 100644 index 000000000..643e562c8 --- /dev/null +++ b/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp @@ -0,0 +1,282 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace eosiobios { + + using eosio::action_wrapper; + using eosio::check; + using eosio::checksum256; + using eosio::ignore; + using eosio::name; + using eosio::permission_level; + using eosio::public_key; + + struct permission_level_weight { + permission_level permission; + uint16_t weight; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( permission_level_weight, (permission)(weight) ) + }; + + struct key_weight { + eosio::public_key key; + uint16_t weight; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( key_weight, (key)(weight) ) + }; + + struct wait_weight { + uint32_t wait_sec; + uint16_t weight; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( wait_weight, (wait_sec)(weight) ) + }; + + struct authority { + uint32_t threshold = 0; + std::vector keys; + std::vector accounts; + std::vector waits; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( authority, (threshold)(keys)(accounts)(waits) ) + }; + + struct block_header { + uint32_t timestamp; + name producer; + uint16_t confirmed = 0; + checksum256 previous; + checksum256 transaction_mroot; + checksum256 action_mroot; + uint32_t schedule_version = 0; + std::optional new_producers; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE(block_header, (timestamp)(producer)(confirmed)(previous)(transaction_mroot)(action_mroot) + (schedule_version)(new_producers)) + }; + + /** + * The `eosio.bios` is the first sample of system contract provided by `block.one` through the EOSIO platform. It is a minimalist system contract because it only supplies the actions that are absolutely critical to bootstrap a chain and nothing more. This allows for a chain agnostic approach to bootstrapping a chain. + * + * Just like in the `eosio.system` sample contract implementation, there are a few actions which are not implemented at the contract level (`newaccount`, `updateauth`, `deleteauth`, `linkauth`, `unlinkauth`, `canceldelay`, `onerror`, `setabi`, `setcode`), they are just declared in the contract so they will show in the contract's ABI and users will be able to push those actions to the chain via the account holding the `eosio.system` contract, but the implementation is at the EOSIO core level. They are referred to as EOSIO native actions. + */ + class [[eosio::contract("eosio.bios")]] bios : public eosio::contract { + public: + using contract::contract; + /** + * New account action, called after a new account is created. This code enforces resource-limits rules + * for new accounts as well as new account naming conventions. + * + * 1. accounts cannot contain '.' symbols which forces all acccounts to be 12 + * characters long without '.' until a future account auction process is implemented + * which prevents name squatting. + * + * 2. new accounts must stake a minimal number of tokens (as set in system parameters) + * therefore, this method will execute an inline buyram from receiver for newacnt in + * an amount equal to the current new account creation fee. + */ + [[eosio::action]] + void newaccount( name creator, + name name, + ignore owner, + ignore active){} + /** + * Update authorization action updates pemission for an account. + * + * @param account - the account for which the permission is updated, + * @param pemission - the permission name which is updated, + * @param parem - the parent of the permission which is updated, + * @param aut - the json describing the permission authorization. + */ + [[eosio::action]] + void updateauth( ignore account, + ignore permission, + ignore parent, + ignore auth ) {} + + /** + * Delete authorization action deletes the authorization for an account's permission. + * + * @param account - the account for which the permission authorization is deleted, + * @param permission - the permission name been deleted. + */ + [[eosio::action]] + void deleteauth( ignore account, + ignore permission ) {} + + /** + * Link authorization action assigns a specific action from a contract to a permission you have created. Five system + * actions can not be linked `updateauth`, `deleteauth`, `linkauth`, `unlinkauth`, and `canceldelay`. + * This is useful because when doing authorization checks, the EOSIO based blockchain starts with the + * action needed to be authorized (and the contract belonging to), and looks up which permission + * is needed to pass authorization validation. If a link is set, that permission is used for authoraization + * validation otherwise then active is the default, with the exception of `eosio.any`. + * `eosio.any` is an implicit permission which exists on every account; you can link actions to `eosio.any` + * and that will make it so linked actions are accessible to any permissions defined for the account. + * + * @param account - the permission's owner to be linked and the payer of the RAM needed to store this link, + * @param code - the owner of the action to be linked, + * @param type - the action to be linked, + * @param requirement - the permission to be linked. + */ + [[eosio::action]] + void linkauth( ignore account, + ignore code, + ignore type, + ignore requirement ) {} + + /** + * Unlink authorization action it's doing the reverse of linkauth action, by unlinking the given action. + * + * @param account - the owner of the permission to be unlinked and the receiver of the freed RAM, + * @param code - the owner of the action to be unlinked, + * @param type - the action to be unlinked. + */ + [[eosio::action]] + void unlinkauth( ignore account, + ignore code, + ignore type ) {} + + /** + * Cancel delay action cancels a deferred transaction. + * + * @param canceling_auth - the permission that authorizes this action, + * @param trx_id - the deferred transaction id to be cancelled. + */ + [[eosio::action]] + void canceldelay( ignore canceling_auth, ignore trx_id ) {} + + /** + * Set code action sets the contract code for an account. + * + * @param account - the account for which to set the contract code. + * @param vmtype - reserved, set it to zero. + * @param vmversion - reserved, set it to zero. + * @param code - the code content to be set, in the form of a blob binary.. + */ + [[eosio::action]] + void setcode( name account, uint8_t vmtype, uint8_t vmversion, const std::vector& code ) {} + + /** + * Set abi action sets the abi for contract identified by `account` name. Creates an entry in the abi_hash_table + * index, with `account` name as key, if it is not already present and sets its value with the abi hash. + * Otherwise it is updating the current abi hash value for the existing `account` key. + * + * @param account - the name of the account to set the abi for + * @param abi - the abi hash represented as a vector of characters + */ + [[eosio::action]] + void setabi( name account, const std::vector& abi ); + + /** + * On error action, notification of this action is delivered to the sender of a deferred transaction + * when an objective error occurs while executing the deferred transaction. + * This action is not meant to be called directly. + * + * @param sender_id - the id for the deferred transaction chosen by the sender, + * @param sent_trx - the deferred transaction that failed. + */ + [[eosio::action]] + void onerror( ignore sender_id, ignore> sent_trx ); + + /** + * Set privilege action allows to set privilege status for an account (turn it on/off). + * @param account - the account to set the privileged status for. + * @param is_priv - 0 for false, > 0 for true. + */ + [[eosio::action]] + void setpriv( name account, uint8_t is_priv ); + + /** + * Sets the resource limits of an account + * + * @param account - name of the account whose resource limit to be set + * @param ram_bytes - ram limit in absolute bytes + * @param net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts) + * @param cpu_weight - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts) + */ + [[eosio::action]] + void setalimits( name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight ); + + /** + * Set producers action, sets a new list of active producers, by proposing a schedule change, once the block that + * contains the proposal becomes irreversible, the schedule is promoted to "pending" + * automatically. Once the block that promotes the schedule is irreversible, the schedule will + * become "active". + * + * @param schedule - New list of active producers to set + */ + [[eosio::action]] + void setprods( const std::vector& schedule ); + + /** + * Set params action, sets the blockchain parameters. By tuning these parameters, various degrees of customization can be achieved. + * + * @param params - New blockchain parameters to set + */ + [[eosio::action]] + void setparams( const eosio::blockchain_parameters& params ); + + /** + * Require authorization action, checks if the account name `from` passed in as param has authorization to access + * current action, that is, if it is listed in the action’s allowed permissions vector. + * + * @param from - the account name to authorize + */ + [[eosio::action]] + void reqauth( name from ); + + /** + * Activate action, activates a protocol feature + * + * @param feature_digest - hash of the protocol feature to activate. + */ + [[eosio::action]] + void activate( const eosio::checksum256& feature_digest ); + + /** + * Require activated action, asserts that a protocol feature has been activated + * + * @param feature_digest - hash of the protocol feature to check for activation. + */ + [[eosio::action]] + void reqactivated( const eosio::checksum256& feature_digest ); + + struct [[eosio::table]] abi_hash { + name owner; + checksum256 hash; + uint64_t primary_key()const { return owner.value; } + + EOSLIB_SERIALIZE( abi_hash, (owner)(hash) ) + }; + + typedef eosio::multi_index< "abihash"_n, abi_hash > abi_hash_table; + + using newaccount_action = action_wrapper<"newaccount"_n, &bios::newaccount>; + using updateauth_action = action_wrapper<"updateauth"_n, &bios::updateauth>; + using deleteauth_action = action_wrapper<"deleteauth"_n, &bios::deleteauth>; + using linkauth_action = action_wrapper<"linkauth"_n, &bios::linkauth>; + using unlinkauth_action = action_wrapper<"unlinkauth"_n, &bios::unlinkauth>; + using canceldelay_action = action_wrapper<"canceldelay"_n, &bios::canceldelay>; + using setcode_action = action_wrapper<"setcode"_n, &bios::setcode>; + using setabi_action = action_wrapper<"setabi"_n, &bios::setabi>; + using setpriv_action = action_wrapper<"setpriv"_n, &bios::setpriv>; + using setalimits_action = action_wrapper<"setalimits"_n, &bios::setalimits>; + using setprods_action = action_wrapper<"setprods"_n, &bios::setprods>; + using setparams_action = action_wrapper<"setparams"_n, &bios::setparams>; + using reqauth_action = action_wrapper<"reqauth"_n, &bios::reqauth>; + using activate_action = action_wrapper<"activate"_n, &bios::activate>; + using reqactivated_action = action_wrapper<"reqactivated"_n, &bios::reqactivated>; + }; +} diff --git a/contracts/eosio.bios/ricardian/eosio.bios.contracts.md.in b/contracts/eosio.bios/ricardian/eosio.bios.contracts.md.in new file mode 100644 index 000000000..a08b66e43 --- /dev/null +++ b/contracts/eosio.bios/ricardian/eosio.bios.contracts.md.in @@ -0,0 +1,189 @@ +

activate

+ +--- +spec_version: "0.2.0" +title: Activate Protocol Feature +summary: 'Activate protocol feature {{nowrap feature_digest}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} activates the protocol feature with a digest of {{feature_digest}}. + +

canceldelay

+ +--- +spec_version: "0.2.0" +title: Cancel Delayed Transaction +summary: '{{nowrap canceling_auth.actor}} cancels a delayed transaction' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{canceling_auth.actor}} cancels the delayed transaction with id {{trx_id}}. + +

deleteauth

+ +--- +spec_version: "0.2.0" +title: Delete Account Permission +summary: 'Delete the {{nowrap permission}} permission of {{nowrap account}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Delete the {{permission}} permission of {{account}}. + +

linkauth

+ +--- +spec_version: "0.2.0" +title: Link Action to Permission +summary: '{{nowrap account}} sets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract to {{nowrap requirement}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{account}} sets the minimum required permission for the {{#if type}}{{type}} action of the{{/if}} {{code}} contract to {{requirement}}. + +{{#if type}}{{else}}Any links explicitly associated to specific actions of {{code}} will take precedence.{{/if}} + +

newaccount

+ +--- +spec_version: "0.2.0" +title: Create New Account +summary: '{{nowrap creator}} creates a new account with the name {{nowrap name}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{creator}} creates a new account with the name {{name}} and the following permissions: + +owner permission with authority: +{{to_json owner}} + +active permission with authority: +{{to_json active}} + +

reqactivated

+ +--- +spec_version: "0.2.0" +title: Assert Protocol Feature Activation +summary: 'Assert that protocol feature {{nowrap feature_digest}} has been activated' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +Assert that the protocol feature with a digest of {{feature_digest}} has been activated. + +

reqauth

+ +--- +spec_version: "0.2.0" +title: Assert Authorization +summary: 'Assert that authorization by {{nowrap from}} is provided' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Assert that authorization by {{from}} is provided. + +

setabi

+ +--- +spec_version: "0.2.0" +title: Deploy Contract ABI +summary: 'Deploy contract ABI on account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Deploy the ABI file associated with the contract on account {{account}}. + +

setalimits

+ +--- +spec_version: "0.2.0" +title: Adjust Resource Limits of Account +summary: 'Adjust resource limits of account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} updates {{account}}’s resource limits to have a RAM quota of {{ram_bytes}} bytes, a NET bandwidth quota of {{net_weight}} and a CPU bandwidth quota of {{cpu_weight}}. + +

setcode

+ +--- +spec_version: "0.2.0" +title: Deploy Contract Code +summary: 'Deploy contract code on account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Deploy compiled contract code to the account {{account}}. + +

setparams

+ +--- +spec_version: "0.2.0" +title: Set System Parameters +summary: 'Set system parameters' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} sets system parameters to: +{{to_json params}} + +

setpriv

+ +--- +spec_version: "0.2.0" +title: Make an Account Privileged or Unprivileged +summary: '{{#if is_priv}}Make {{nowrap account}} privileged{{else}}Remove privileged status of {{nowrap account}}{{/if}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{#if is_priv}} +{{$action.account}} makes {{account}} privileged. +{{else}} +{{$action.account}} removes privileged status of {{account}}. +{{/if}} + +

setprods

+ +--- +spec_version: "0.2.0" +title: Set Block Producers +summary: 'Set block producer schedule' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} proposes a block producer schedule of: +{{#each schedule}} + 1. {{this.producer_name}} +{{/each}} + +The block signing authorities of each of the producers in the above schedule are listed below: +{{#each schedule}} +### {{this.producer_name}} +{{to_json this.authority}} +{{/each}} + +

unlinkauth

+ +--- +spec_version: "0.2.0" +title: Unlink Action from Permission +summary: '{{nowrap account}} unsets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{account}} removes the association between the {{#if type}}{{type}} action of the{{/if}} {{code}} contract and its minimum required permission. + +{{#if type}}{{else}}This will not remove any links explicitly associated to specific actions of {{code}}.{{/if}} + +

updateauth

+ +--- +spec_version: "0.2.0" +title: Modify Account Permission +summary: 'Add or update the {{nowrap permission}} permission of {{nowrap account}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Modify, and create if necessary, the {{permission}} permission of {{account}} to have a parent permission of {{parent}} and the following authority: +{{to_json auth}} diff --git a/contracts/eosio.bios/src/eosio.bios.cpp b/contracts/eosio.bios/src/eosio.bios.cpp new file mode 100644 index 000000000..69d6758f3 --- /dev/null +++ b/contracts/eosio.bios/src/eosio.bios.cpp @@ -0,0 +1,57 @@ +#include + +namespace eosiobios { + +void bios::setabi( name account, const std::vector& abi ) { + abi_hash_table table(get_self(), get_self().value); + auto itr = table.find( account.value ); + if( itr == table.end() ) { + table.emplace( account, [&]( auto& row ) { + row.owner = account; + row.hash = eosio::sha256(const_cast(abi.data()), abi.size()); + }); + } else { + table.modify( itr, eosio::same_payer, [&]( auto& row ) { + row.hash = eosio::sha256(const_cast(abi.data()), abi.size()); + }); + } +} + +void bios::onerror( ignore, ignore> ) { + check( false, "the onerror action cannot be called directly" ); +} + +void bios::setpriv( name account, uint8_t is_priv ) { + require_auth( get_self() ); + set_privileged( account, is_priv ); +} + +void bios::setalimits( name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight ) { + require_auth( get_self() ); + set_resource_limits( account, ram_bytes, net_weight, cpu_weight ); +} + +void bios::setprods( const std::vector& schedule ) { + require_auth( get_self() ); + set_proposed_producers( schedule ); +} + +void bios::setparams( const eosio::blockchain_parameters& params ) { + require_auth( get_self() ); + set_blockchain_parameters( params ); +} + +void bios::reqauth( name from ) { + require_auth( from ); +} + +void bios::activate( const eosio::checksum256& feature_digest ) { + require_auth( get_self() ); + preactivate_feature( feature_digest ); +} + +void bios::reqactivated( const eosio::checksum256& feature_digest ) { + check( is_feature_activated( feature_digest ), "protocol feature is not activated" ); +} + +} diff --git a/contracts/eosio.msig/CMakeLists.txt b/contracts/eosio.msig/CMakeLists.txt new file mode 100644 index 000000000..0947ea9d0 --- /dev/null +++ b/contracts/eosio.msig/CMakeLists.txt @@ -0,0 +1,13 @@ +add_contract(eosio.msig eosio.msig ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.msig.cpp) + +target_include_directories(eosio.msig + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include) + +set_target_properties(eosio.msig + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ricardian/eosio.msig.contracts.md.in ${CMAKE_CURRENT_BINARY_DIR}/ricardian/eosio.msig.contracts.md @ONLY ) + +target_compile_options( eosio.msig PUBLIC -R${CMAKE_CURRENT_SOURCE_DIR}/ricardian -R${CMAKE_CURRENT_BINARY_DIR}/ricardian ) diff --git a/contracts/eosio.msig/include/eosio.msig/eosio.msig.hpp b/contracts/eosio.msig/include/eosio.msig/eosio.msig.hpp new file mode 100644 index 000000000..19f2600cc --- /dev/null +++ b/contracts/eosio.msig/include/eosio.msig/eosio.msig.hpp @@ -0,0 +1,162 @@ +#pragma once + +#include +#include +#include +#include + +namespace eosio { + + /** + * The `eosio.msig` system contract allows for creation of proposed transactions which require authorization from a list of accounts, approval of the proposed transactions by those accounts required to approve it, and finally, it also allows the execution of the approved transactions on the blockchain. + * + * In short, the workflow to propose, review, approve and then executed a transaction it can be described by the following: + * - first you create a transaction json file, + * - then you submit this proposal to the `eosio.msig` contract, and you also insert the account permissions required to approve this proposal into the command that submits the proposal to the blockchain, + * - the proposal then gets stored on the blockchain by the `eosio.msig` contract, and is accessible for review and approval to those accounts required to approve it, + * - after each of the appointed accounts required to approve the proposed transactions reviews and approves it, you can execute the proposed transaction. The `eosio.msig` contract will execute it automatically, but not before validating that the transaction has not expired, it is not cancelled, and it has been signed by all the permissions in the initial proposal's required permission list. + */ + class [[eosio::contract("eosio.msig")]] multisig : public contract { + public: + using contract::contract; + + /** + * Propose action, creates a proposal containing one transaction. + * Allows an account `proposer` to make a proposal `proposal_name` which has `requested` + * permission levels expected to approve the proposal, and if approved by all expected + * permission levels then `trx` transaction can we executed by this proposal. + * The `proposer` account is authorized and the `trx` transaction is verified if it was + * authorized by the provided keys and permissions, and if the proposal name doesn’t + * already exist; if all validations pass the `proposal_name` and `trx` trasanction are + * saved in the proposals table and the `requested` permission levels to the + * approvals table (for the `proposer` context). Storage changes are billed to `proposer`. + * + * @param proposer - The account proposing a transaction + * @param proposal_name - The name of the proposal (should be unique for proposer) + * @param requested - Permission levels expected to approve the proposal + * @param trx - Proposed transaction + */ + [[eosio::action]] + void propose(ignore proposer, ignore proposal_name, + ignore> requested, ignore trx); + /** + * Approve action approves an existing proposal. Allows an account, the owner of `level` permission, to approve a proposal `proposal_name` + * proposed by `proposer`. If the proposal's requested approval list contains the `level` + * permission then the `level` permission is moved from internal `requested_approvals` list to + * internal `provided_approvals` list of the proposal, thus persisting the approval for + * the `proposal_name` proposal. Storage changes are billed to `proposer`. + * + * @param proposer - The account proposing a transaction + * @param proposal_name - The name of the proposal (should be unique for proposer) + * @param level - Permission level approving the transaction + * @param proposal_hash - Transaction's checksum + */ + [[eosio::action]] + void approve( name proposer, name proposal_name, permission_level level, + const eosio::binary_extension& proposal_hash ); + /** + * Unapprove action revokes an existing proposal. This action is the reverse of the `approve` action: if all validations pass + * the `level` permission is erased from internal `provided_approvals` and added to the internal + * `requested_approvals` list, and thus un-approve or revoke the proposal. + * + * @param proposer - The account proposing a transaction + * @param proposal_name - The name of the proposal (should be an existing proposal) + * @param level - Permission level revoking approval for proposal + */ + [[eosio::action]] + void unapprove( name proposer, name proposal_name, permission_level level ); + /** + * Cancel action cancels an existing proposal. + * + * @param proposer - The account proposing a transaction + * @param proposal_name - The name of the proposal (should be an existing proposal) + * @param canceler - The account cancelling the proposal (only the proposer can cancel an unexpired transaction, and the canceler has to be different than the proposer) + * + * Allows the `canceler` account to cancel the `proposal_name` proposal, created by a `proposer`, + * only after time has expired on the proposed transaction. It removes corresponding entries from + * internal proptable and from approval (or old approvals) tables as well. + */ + [[eosio::action]] + void cancel( name proposer, name proposal_name, name canceler ); + /** + * Exec action allows an `executer` account to execute a proposal. + * + * Preconditions: + * - `executer` has authorization, + * - `proposal_name` is found in the proposals table, + * - all requested approvals are received, + * - proposed transaction is not expired, + * - and approval accounts are not found in invalidations table. + * + * If all preconditions are met the transaction is executed as a deferred transaction, + * and the proposal is erased from the proposals table. + * + * @param proposer - The account proposing a transaction + * @param proposal_name - The name of the proposal (should be an existing proposal) + * @param executer - The account executing the transaction + */ + [[eosio::action]] + void exec( name proposer, name proposal_name, name executer ); + /** + * Invalidate action allows an `account` to invalidate itself, that is, its name is added to + * the invalidations table and this table will be cross referenced when exec is performed. + * + * @param account - The account invalidating the transaction + */ + [[eosio::action]] + void invalidate( name account ); + + using propose_action = eosio::action_wrapper<"propose"_n, &multisig::propose>; + using approve_action = eosio::action_wrapper<"approve"_n, &multisig::approve>; + using unapprove_action = eosio::action_wrapper<"unapprove"_n, &multisig::unapprove>; + using cancel_action = eosio::action_wrapper<"cancel"_n, &multisig::cancel>; + using exec_action = eosio::action_wrapper<"exec"_n, &multisig::exec>; + using invalidate_action = eosio::action_wrapper<"invalidate"_n, &multisig::invalidate>; + + private: + struct [[eosio::table]] proposal { + name proposal_name; + std::vector packed_transaction; + + uint64_t primary_key()const { return proposal_name.value; } + }; + + typedef eosio::multi_index< "proposal"_n, proposal > proposals; + + struct [[eosio::table]] old_approvals_info { + name proposal_name; + std::vector requested_approvals; + std::vector provided_approvals; + + uint64_t primary_key()const { return proposal_name.value; } + }; + typedef eosio::multi_index< "approvals"_n, old_approvals_info > old_approvals; + + struct approval { + permission_level level; + time_point time; + }; + + struct [[eosio::table]] approvals_info { + uint8_t version = 1; + name proposal_name; + //requested approval doesn't need to cointain time, but we want requested approval + //to be of exact the same size ad provided approval, in this case approve/unapprove + //doesn't change serialized data size. So, we use the same type. + std::vector requested_approvals; + std::vector provided_approvals; + + uint64_t primary_key()const { return proposal_name.value; } + }; + typedef eosio::multi_index< "approvals2"_n, approvals_info > approvals; + + struct [[eosio::table]] invalidation { + name account; + time_point last_invalidation_time; + + uint64_t primary_key() const { return account.value; } + }; + + typedef eosio::multi_index< "invals"_n, invalidation > invalidations; + }; +} /// namespace eosio diff --git a/contracts/eosio.msig/ricardian/eosio.msig.contracts.md.in b/contracts/eosio.msig/ricardian/eosio.msig.contracts.md.in new file mode 100644 index 000000000..b9f3f35f8 --- /dev/null +++ b/contracts/eosio.msig/ricardian/eosio.msig.contracts.md.in @@ -0,0 +1,73 @@ +

approve

+ +--- +spec_version: "0.2.0" +title: Approve Proposed Transaction +summary: '{{nowrap level.actor}} approves the {{nowrap proposal_name}} proposal' +icon: @ICON_BASE_URL@/@MULTISIG_ICON_URI@ +--- + +{{level.actor}} approves the {{proposal_name}} proposal proposed by {{proposer}} with the {{level.permission}} permission of {{level.actor}}. + +

cancel

+ +--- +spec_version: "0.2.0" +title: Cancel Proposed Transaction +summary: '{{nowrap canceler}} cancels the {{nowrap proposal_name}} proposal' +icon: @ICON_BASE_URL@/@MULTISIG_ICON_URI@ +--- + +{{canceler}} cancels the {{proposal_name}} proposal submitted by {{proposer}}. + +

exec

+ +--- +spec_version: "0.2.0" +title: Execute Proposed Transaction +summary: '{{nowrap executer}} executes the {{nowrap proposal_name}} proposal' +icon: @ICON_BASE_URL@/@MULTISIG_ICON_URI@ +--- + +{{executer}} executes the {{proposal_name}} proposal submitted by {{proposer}} if the minimum required approvals for the proposal have been secured. + +

invalidate

+ +--- +spec_version: "0.2.0" +title: Invalidate All Approvals +summary: '{{nowrap account}} invalidates approvals on outstanding proposals' +icon: @ICON_BASE_URL@/@MULTISIG_ICON_URI@ +--- + +{{account}} invalidates all approvals on proposals which have not yet executed. + +

propose

+ +--- +spec_version: "0.2.0" +title: Propose Transaction +summary: '{{nowrap proposer}} creates the {{nowrap proposal_name}}' +icon: @ICON_BASE_URL@/@MULTISIG_ICON_URI@ +--- + +{{proposer}} creates the {{proposal_name}} proposal for the following transaction: +{{to_json trx}} + +The proposal requests approvals from the following accounts at the specified permission levels: +{{#each requested}} + + {{this.permission}} permission of {{this.actor}} +{{/each}} + +If the proposed transaction is not executed prior to {{trx.expiration}}, the proposal will automatically expire. + +

unapprove

+ +--- +spec_version: "0.2.0" +title: Unapprove Proposed Transaction +summary: '{{nowrap level.actor}} revokes the approval previously provided to {{nowrap proposal_name}} proposal' +icon: @ICON_BASE_URL@/@MULTISIG_ICON_URI@ +--- + +{{level.actor}} revokes the approval previously provided at their {{level.permission}} permission level from the {{proposal_name}} proposal proposed by {{proposer}}. diff --git a/eosio.msig/src/eosio.msig.cpp b/contracts/eosio.msig/src/eosio.msig.cpp similarity index 65% rename from eosio.msig/src/eosio.msig.cpp rename to contracts/eosio.msig/src/eosio.msig.cpp index 0b682b6c9..176921929 100644 --- a/eosio.msig/src/eosio.msig.cpp +++ b/contracts/eosio.msig/src/eosio.msig.cpp @@ -1,15 +1,11 @@ +#include +#include +#include + #include -#include -#include -#include namespace eosio { -time_point current_time_point() { - const static time_point ct{ microseconds{ static_cast( current_time() ) } }; - return ct; -} - void multisig::propose( ignore proposer, ignore proposal_name, ignore> requested, @@ -27,18 +23,20 @@ void multisig::propose( ignore proposer, _ds >> _trx_header; require_auth( _proposer ); - eosio_assert( _trx_header.expiration >= eosio::time_point_sec(current_time_point()), "transaction expired" ); - //eosio_assert( trx_header.actions.size() > 0, "transaction must have at least one action" ); + check( _trx_header.expiration >= eosio::time_point_sec(current_time_point()), "transaction expired" ); + //check( trx_header.actions.size() > 0, "transaction must have at least one action" ); - proposals proptable( _self, _proposer.value ); - eosio_assert( proptable.find( _proposal_name.value ) == proptable.end(), "proposal with the same name exists" ); + proposals proptable( get_self(), _proposer.value ); + check( proptable.find( _proposal_name.value ) == proptable.end(), "proposal with the same name exists" ); auto packed_requested = pack(_requested); - auto res = ::check_transaction_authorization( trx_pos, size, - (const char*)0, 0, - packed_requested.data(), packed_requested.size() - ); - eosio_assert( res > 0, "transaction authorization failed" ); + auto res = check_transaction_authorization( + trx_pos, size, + (const char*)0, 0, + packed_requested.data(), packed_requested.size() + ); + + check( res > 0, "transaction authorization failed" ); std::vector pkd_trans; pkd_trans.resize(size); @@ -48,7 +46,7 @@ void multisig::propose( ignore proposer, prop.packed_transaction = pkd_trans; }); - approvals apptable( _self, _proposer.value ); + approvals apptable( get_self(), _proposer.value ); apptable.emplace( _proposer, [&]( auto& a ) { a.proposal_name = _proposal_name; a.requested_approvals.reserve( _requested.size() ); @@ -64,27 +62,27 @@ void multisig::approve( name proposer, name proposal_name, permission_level leve require_auth( level ); if( proposal_hash ) { - proposals proptable( _self, proposer.value ); + proposals proptable( get_self(), proposer.value ); auto& prop = proptable.get( proposal_name.value, "proposal not found" ); assert_sha256( prop.packed_transaction.data(), prop.packed_transaction.size(), *proposal_hash ); } - approvals apptable( _self, proposer.value ); + approvals apptable( get_self(), proposer.value ); auto apps_it = apptable.find( proposal_name.value ); if ( apps_it != apptable.end() ) { auto itr = std::find_if( apps_it->requested_approvals.begin(), apps_it->requested_approvals.end(), [&](const approval& a) { return a.level == level; } ); - eosio_assert( itr != apps_it->requested_approvals.end(), "approval is not on the list of requested approvals" ); + check( itr != apps_it->requested_approvals.end(), "approval is not on the list of requested approvals" ); apptable.modify( apps_it, proposer, [&]( auto& a ) { a.provided_approvals.push_back( approval{ level, current_time_point() } ); a.requested_approvals.erase( itr ); }); } else { - old_approvals old_apptable( _self, proposer.value ); + old_approvals old_apptable( get_self(), proposer.value ); auto& apps = old_apptable.get( proposal_name.value, "proposal not found" ); auto itr = std::find( apps.requested_approvals.begin(), apps.requested_approvals.end(), level ); - eosio_assert( itr != apps.requested_approvals.end(), "approval is not on the list of requested approvals" ); + check( itr != apps.requested_approvals.end(), "approval is not on the list of requested approvals" ); old_apptable.modify( apps, proposer, [&]( auto& a ) { a.provided_approvals.push_back( level ); @@ -96,20 +94,20 @@ void multisig::approve( name proposer, name proposal_name, permission_level leve void multisig::unapprove( name proposer, name proposal_name, permission_level level ) { require_auth( level ); - approvals apptable( _self, proposer.value ); + approvals apptable( get_self(), proposer.value ); auto apps_it = apptable.find( proposal_name.value ); if ( apps_it != apptable.end() ) { auto itr = std::find_if( apps_it->provided_approvals.begin(), apps_it->provided_approvals.end(), [&](const approval& a) { return a.level == level; } ); - eosio_assert( itr != apps_it->provided_approvals.end(), "no approval previously granted" ); + check( itr != apps_it->provided_approvals.end(), "no approval previously granted" ); apptable.modify( apps_it, proposer, [&]( auto& a ) { a.requested_approvals.push_back( approval{ level, current_time_point() } ); a.provided_approvals.erase( itr ); }); } else { - old_approvals old_apptable( _self, proposer.value ); + old_approvals old_apptable( get_self(), proposer.value ); auto& apps = old_apptable.get( proposal_name.value, "proposal not found" ); auto itr = std::find( apps.provided_approvals.begin(), apps.provided_approvals.end(), level ); - eosio_assert( itr != apps.provided_approvals.end(), "no approval previously granted" ); + check( itr != apps.provided_approvals.end(), "no approval previously granted" ); old_apptable.modify( apps, proposer, [&]( auto& a ) { a.requested_approvals.push_back( level ); a.provided_approvals.erase( itr ); @@ -120,23 +118,23 @@ void multisig::unapprove( name proposer, name proposal_name, permission_level le void multisig::cancel( name proposer, name proposal_name, name canceler ) { require_auth( canceler ); - proposals proptable( _self, proposer.value ); + proposals proptable( get_self(), proposer.value ); auto& prop = proptable.get( proposal_name.value, "proposal not found" ); if( canceler != proposer ) { - eosio_assert( unpack( prop.packed_transaction ).expiration < eosio::time_point_sec(current_time_point()), "cannot cancel until expiration" ); + check( unpack( prop.packed_transaction ).expiration < eosio::time_point_sec(current_time_point()), "cannot cancel until expiration" ); } proptable.erase(prop); //remove from new table - approvals apptable( _self, proposer.value ); + approvals apptable( get_self(), proposer.value ); auto apps_it = apptable.find( proposal_name.value ); if ( apps_it != apptable.end() ) { apptable.erase(apps_it); } else { - old_approvals old_apptable( _self, proposer.value ); + old_approvals old_apptable( get_self(), proposer.value ); auto apps_it = old_apptable.find( proposal_name.value ); - eosio_assert( apps_it != old_apptable.end(), "proposal not found" ); + check( apps_it != old_apptable.end(), "proposal not found" ); old_apptable.erase(apps_it); } } @@ -144,17 +142,17 @@ void multisig::cancel( name proposer, name proposal_name, name canceler ) { void multisig::exec( name proposer, name proposal_name, name executer ) { require_auth( executer ); - proposals proptable( _self, proposer.value ); + proposals proptable( get_self(), proposer.value ); auto& prop = proptable.get( proposal_name.value, "proposal not found" ); transaction_header trx_header; datastream ds( prop.packed_transaction.data(), prop.packed_transaction.size() ); ds >> trx_header; - eosio_assert( trx_header.expiration >= eosio::time_point_sec(current_time_point()), "transaction expired" ); + check( trx_header.expiration >= eosio::time_point_sec(current_time_point()), "transaction expired" ); - approvals apptable( _self, proposer.value ); + approvals apptable( get_self(), proposer.value ); auto apps_it = apptable.find( proposal_name.value ); std::vector approvals; - invalidations inv_table( _self, _self.value ); + invalidations inv_table( get_self(), get_self().value ); if ( apps_it != apptable.end() ) { approvals.reserve( apps_it->provided_approvals.size() ); for ( auto& p : apps_it->provided_approvals ) { @@ -165,7 +163,7 @@ void multisig::exec( name proposer, name proposal_name, name executer ) { } apptable.erase(apps_it); } else { - old_approvals old_apptable( _self, proposer.value ); + old_approvals old_apptable( get_self(), proposer.value ); auto& apps = old_apptable.get( proposal_name.value, "proposal not found" ); for ( auto& level : apps.provided_approvals ) { auto it = inv_table.find( level.actor.value ); @@ -176,13 +174,15 @@ void multisig::exec( name proposer, name proposal_name, name executer ) { old_apptable.erase(apps); } auto packed_provided_approvals = pack(approvals); - auto res = ::check_transaction_authorization( prop.packed_transaction.data(), prop.packed_transaction.size(), - (const char*)0, 0, - packed_provided_approvals.data(), packed_provided_approvals.size() - ); - eosio_assert( res > 0, "transaction authorization failed" ); + auto res = check_transaction_authorization( + prop.packed_transaction.data(), prop.packed_transaction.size(), + (const char*)0, 0, + packed_provided_approvals.data(), packed_provided_approvals.size() + ); + + check( res > 0, "transaction authorization failed" ); - send_deferred( (uint128_t(proposer.value) << 64) | proposal_name.value, executer.value, + send_deferred( (uint128_t(proposer.value) << 64) | proposal_name.value, executer, prop.packed_transaction.data(), prop.packed_transaction.size() ); proptable.erase(prop); @@ -190,7 +190,7 @@ void multisig::exec( name proposer, name proposal_name, name executer ) { void multisig::invalidate( name account ) { require_auth( account ); - invalidations inv_table( _self, _self.value ); + invalidations inv_table( get_self(), get_self().value ); auto it = inv_table.find( account.value ); if ( it == inv_table.end() ) { inv_table.emplace( account, [&](auto& i) { @@ -205,5 +205,3 @@ void multisig::invalidate( name account ) { } } /// namespace eosio - -EOSIO_DISPATCH( eosio::multisig, (propose)(approve)(unapprove)(cancel)(exec)(invalidate) ) diff --git a/contracts/eosio.system/CMakeLists.txt b/contracts/eosio.system/CMakeLists.txt new file mode 100644 index 000000000..6b47d1563 --- /dev/null +++ b/contracts/eosio.system/CMakeLists.txt @@ -0,0 +1,43 @@ +add_contract(eosio.system eosio.system + ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.system.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/delegate_bandwidth.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/exchange_state.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/name_bidding.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/native.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/producer_pay.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/powerup.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/rex.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/voting.cpp +) + +target_include_directories(eosio.system + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/../eosio.token/include) + +set_target_properties(eosio.system + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + +add_contract(rex.results rex.results ${CMAKE_CURRENT_SOURCE_DIR}/src/rex.results.cpp) +add_contract(powup.results powup.results ${CMAKE_CURRENT_SOURCE_DIR}/src/powerup.results.cpp) + +target_include_directories(rex.results + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include) + +target_include_directories(powup.results + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include) + +set_target_properties(rex.results + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.rex") + +set_target_properties(powup.results + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.powerup") + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ricardian/eosio.system.contracts.md.in ${CMAKE_CURRENT_BINARY_DIR}/ricardian/eosio.system.contracts.md @ONLY ) + +target_compile_options( eosio.system PUBLIC -R${CMAKE_CURRENT_SOURCE_DIR}/ricardian -R${CMAKE_CURRENT_BINARY_DIR}/ricardian ) diff --git a/contracts/eosio.system/include/eosio.system/eosio.system.hpp b/contracts/eosio.system/include/eosio.system/eosio.system.hpp new file mode 100644 index 000000000..d49834cdb --- /dev/null +++ b/contracts/eosio.system/include/eosio.system/eosio.system.hpp @@ -0,0 +1,1489 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#ifdef CHANNEL_RAM_AND_NAMEBID_FEES_TO_REX +#undef CHANNEL_RAM_AND_NAMEBID_FEES_TO_REX +#endif +// CHANNEL_RAM_AND_NAMEBID_FEES_TO_REX macro determines whether ramfee and namebid proceeds are +// channeled to REX pool. In order to stop these proceeds from being channeled, the macro must +// be set to 0. +#define CHANNEL_RAM_AND_NAMEBID_FEES_TO_REX 1 + +namespace eosiosystem { + + using eosio::asset; + using eosio::block_timestamp; + using eosio::check; + using eosio::const_mem_fun; + using eosio::datastream; + using eosio::indexed_by; + using eosio::name; + using eosio::same_payer; + using eosio::symbol; + using eosio::symbol_code; + using eosio::time_point; + using eosio::time_point_sec; + using eosio::unsigned_int; + + inline constexpr int64_t powerup_frac = 1'000'000'000'000'000ll; // 1.0 = 10^15 + + template + static inline auto has_field( F flags, E field ) + -> std::enable_if_t< std::is_integral_v && std::is_unsigned_v && + std::is_enum_v && std::is_same_v< F, std::underlying_type_t >, bool> + { + return ( (flags & static_cast(field)) != 0 ); + } + + template + static inline auto set_field( F flags, E field, bool value = true ) + -> std::enable_if_t< std::is_integral_v && std::is_unsigned_v && + std::is_enum_v && std::is_same_v< F, std::underlying_type_t >, F > + { + if( value ) + return ( flags | static_cast(field) ); + else + return ( flags & ~static_cast(field) ); + } + + static constexpr uint32_t seconds_per_year = 52 * 7 * 24 * 3600; + static constexpr uint32_t seconds_per_day = 24 * 3600; + static constexpr uint32_t seconds_per_hour = 3600; + static constexpr int64_t useconds_per_year = int64_t(seconds_per_year) * 1000'000ll; + static constexpr int64_t useconds_per_day = int64_t(seconds_per_day) * 1000'000ll; + static constexpr int64_t useconds_per_hour = int64_t(seconds_per_hour) * 1000'000ll; + static constexpr uint32_t blocks_per_day = 2 * seconds_per_day; // half seconds per day + + static constexpr int64_t min_activated_stake = 150'000'000'0000; + static constexpr int64_t ram_gift_bytes = 1400; + static constexpr int64_t min_pervote_daily_pay = 100'0000; + static constexpr uint32_t refund_delay_sec = 3 * seconds_per_day; + + static constexpr int64_t inflation_precision = 100; // 2 decimals + static constexpr int64_t default_annual_rate = 500; // 5% annual rate + static constexpr int64_t pay_factor_precision = 10000; + static constexpr int64_t default_inflation_pay_factor = 50000; // producers pay share = 10000 / 50000 = 20% of the inflation + static constexpr int64_t default_votepay_factor = 40000; // per-block pay share = 10000 / 40000 = 25% of the producer pay + + /** + * The `eosio.system` smart contract is provided by `block.one` as a sample system contract, and it defines the structures and actions needed for blockchain's core functionality. + * + * Just like in the `eosio.bios` sample contract implementation, there are a few actions which are not implemented at the contract level (`newaccount`, `updateauth`, `deleteauth`, `linkauth`, `unlinkauth`, `canceldelay`, `onerror`, `setabi`, `setcode`), they are just declared in the contract so they will show in the contract's ABI and users will be able to push those actions to the chain via the account holding the `eosio.system` contract, but the implementation is at the EOSIO core level. They are referred to as EOSIO native actions. + * + * - Users can stake tokens for CPU and Network bandwidth, and then vote for producers or + * delegate their vote to a proxy. + * - Producers register in order to be voted for, and can claim per-block and per-vote rewards. + * - Users can buy and sell RAM at a market-determined price. + * - Users can bid on premium names. + * - A resource exchange system (REX) allows token holders to lend their tokens, + * and users to rent CPU and Network resources in return for a market-determined fee. + */ + + // A name bid, which consists of: + // - a `newname` name that the bid is for + // - a `high_bidder` account name that is the one with the highest bid so far + // - the `high_bid` which is amount of highest bid + // - and `last_bid_time` which is the time of the highest bid + struct [[eosio::table, eosio::contract("eosio.system")]] name_bid { + name newname; + name high_bidder; + int64_t high_bid = 0; ///< negative high_bid == closed auction waiting to be claimed + time_point last_bid_time; + + uint64_t primary_key()const { return newname.value; } + uint64_t by_high_bid()const { return static_cast(-high_bid); } + }; + + // A bid refund, which is defined by: + // - the `bidder` account name owning the refund + // - the `amount` to be refunded + struct [[eosio::table, eosio::contract("eosio.system")]] bid_refund { + name bidder; + asset amount; + + uint64_t primary_key()const { return bidder.value; } + }; + typedef eosio::multi_index< "namebids"_n, name_bid, + indexed_by<"highbid"_n, const_mem_fun > + > name_bid_table; + + typedef eosio::multi_index< "bidrefunds"_n, bid_refund > bid_refund_table; + + // Defines new global state parameters. + struct [[eosio::table("global"), eosio::contract("eosio.system")]] eosio_global_state : eosio::blockchain_parameters { + uint64_t free_ram()const { return max_ram_size - total_ram_bytes_reserved; } + + uint64_t max_ram_size = 64ll*1024 * 1024 * 1024; + uint64_t total_ram_bytes_reserved = 0; + int64_t total_ram_stake = 0; + + block_timestamp last_producer_schedule_update; + time_point last_pervote_bucket_fill; + int64_t pervote_bucket = 0; + int64_t perblock_bucket = 0; + uint32_t total_unpaid_blocks = 0; /// all blocks which have been produced but not paid + int64_t total_activated_stake = 0; + time_point thresh_activated_stake_time; + uint16_t last_producer_schedule_size = 0; + double total_producer_vote_weight = 0; /// the sum of all producer votes + block_timestamp last_name_close; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE_DERIVED( eosio_global_state, eosio::blockchain_parameters, + (max_ram_size)(total_ram_bytes_reserved)(total_ram_stake) + (last_producer_schedule_update)(last_pervote_bucket_fill) + (pervote_bucket)(perblock_bucket)(total_unpaid_blocks)(total_activated_stake)(thresh_activated_stake_time) + (last_producer_schedule_size)(total_producer_vote_weight)(last_name_close) ) + }; + + // Defines new global state parameters added after version 1.0 + struct [[eosio::table("global2"), eosio::contract("eosio.system")]] eosio_global_state2 { + eosio_global_state2(){} + + uint16_t new_ram_per_block = 0; + block_timestamp last_ram_increase; + block_timestamp last_block_num; /* deprecated */ + double total_producer_votepay_share = 0; + uint8_t revision = 0; ///< used to track version updates in the future. + + EOSLIB_SERIALIZE( eosio_global_state2, (new_ram_per_block)(last_ram_increase)(last_block_num) + (total_producer_votepay_share)(revision) ) + }; + + // Defines new global state parameters added after version 1.3.0 + struct [[eosio::table("global3"), eosio::contract("eosio.system")]] eosio_global_state3 { + eosio_global_state3() { } + time_point last_vpay_state_update; + double total_vpay_share_change_rate = 0; + + EOSLIB_SERIALIZE( eosio_global_state3, (last_vpay_state_update)(total_vpay_share_change_rate) ) + }; + + // Defines new global state parameters to store inflation rate and distribution + struct [[eosio::table("global4"), eosio::contract("eosio.system")]] eosio_global_state4 { + eosio_global_state4() { } + double continuous_rate; + int64_t inflation_pay_factor; + int64_t votepay_factor; + + EOSLIB_SERIALIZE( eosio_global_state4, (continuous_rate)(inflation_pay_factor)(votepay_factor) ) + }; + + inline eosio::block_signing_authority convert_to_block_signing_authority( const eosio::public_key& producer_key ) { + return eosio::block_signing_authority_v0{ .threshold = 1, .keys = {{producer_key, 1}} }; + } + + // Defines `producer_info` structure to be stored in `producer_info` table, added after version 1.0 + struct [[eosio::table, eosio::contract("eosio.system")]] producer_info { + name owner; + double total_votes = 0; + eosio::public_key producer_key; /// a packed public key object + bool is_active = true; + std::string url; + uint32_t unpaid_blocks = 0; + time_point last_claim_time; + uint16_t location = 0; + eosio::binary_extension producer_authority; // added in version 1.9.0 + + uint64_t primary_key()const { return owner.value; } + double by_votes()const { return is_active ? -total_votes : total_votes; } + bool active()const { return is_active; } + void deactivate() { producer_key = public_key(); producer_authority.reset(); is_active = false; } + + eosio::block_signing_authority get_producer_authority()const { + if( producer_authority.has_value() ) { + bool zero_threshold = std::visit( [](auto&& auth ) -> bool { + return (auth.threshold == 0); + }, *producer_authority ); + // zero_threshold could be true despite the validation done in regproducer2 because the v1.9.0 eosio.system + // contract has a bug which may have modified the producer table such that the producer_authority field + // contains a default constructed eosio::block_signing_authority (which has a 0 threshold and so is invalid). + if( !zero_threshold ) return *producer_authority; + } + return convert_to_block_signing_authority( producer_key ); + } + + // The unregprod and claimrewards actions modify unrelated fields of the producers table and under the default + // serialization behavior they would increase the size of the serialized table if the producer_authority field + // was not already present. This is acceptable (though not necessarily desired) because those two actions require + // the authority of the producer who pays for the table rows. + // However, the rmvproducer action and the onblock transaction would also modify the producer table in a similar + // way and increasing its serialized size is not acceptable in that context. + // So, a custom serialization is defined to handle the binary_extension producer_authority + // field in the desired way. (Note: v1.9.0 did not have this custom serialization behavior.) + + template + friend DataStream& operator << ( DataStream& ds, const producer_info& t ) { + ds << t.owner + << t.total_votes + << t.producer_key + << t.is_active + << t.url + << t.unpaid_blocks + << t.last_claim_time + << t.location; + + if( !t.producer_authority.has_value() ) return ds; + + return ds << t.producer_authority; + } + + template + friend DataStream& operator >> ( DataStream& ds, producer_info& t ) { + return ds >> t.owner + >> t.total_votes + >> t.producer_key + >> t.is_active + >> t.url + >> t.unpaid_blocks + >> t.last_claim_time + >> t.location + >> t.producer_authority; + } + }; + + // Defines new producer info structure to be stored in new producer info table, added after version 1.3.0 + struct [[eosio::table, eosio::contract("eosio.system")]] producer_info2 { + name owner; + double votepay_share = 0; + time_point last_votepay_share_update; + + uint64_t primary_key()const { return owner.value; } + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( producer_info2, (owner)(votepay_share)(last_votepay_share_update) ) + }; + + // Voter info. Voter info stores information about the voter: + // - `owner` the voter + // - `proxy` the proxy set by the voter, if any + // - `producers` the producers approved by this voter if no proxy set + // - `staked` the amount staked + struct [[eosio::table, eosio::contract("eosio.system")]] voter_info { + name owner; /// the voter + name proxy; /// the proxy set by the voter, if any + std::vector producers; /// the producers approved by this voter if no proxy set + int64_t staked = 0; + + // Every time a vote is cast we must first "undo" the last vote weight, before casting the + // new vote weight. Vote weight is calculated as: + // stated.amount * 2 ^ ( weeks_since_launch/weeks_per_year) + double last_vote_weight = 0; /// the vote weight cast the last time the vote was updated + + // Total vote weight delegated to this voter. + double proxied_vote_weight= 0; /// the total vote weight delegated to this voter as a proxy + bool is_proxy = 0; /// whether the voter is a proxy for others + + + uint32_t flags1 = 0; + uint32_t reserved2 = 0; + eosio::asset reserved3; + + uint64_t primary_key()const { return owner.value; } + + enum class flags1_fields : uint32_t { + ram_managed = 1, + net_managed = 2, + cpu_managed = 4 + }; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( voter_info, (owner)(proxy)(producers)(staked)(last_vote_weight)(proxied_vote_weight)(is_proxy)(flags1)(reserved2)(reserved3) ) + }; + + + typedef eosio::multi_index< "voters"_n, voter_info > voters_table; + + + typedef eosio::multi_index< "producers"_n, producer_info, + indexed_by<"prototalvote"_n, const_mem_fun > + > producers_table; + + typedef eosio::multi_index< "producers2"_n, producer_info2 > producers_table2; + + + typedef eosio::singleton< "global"_n, eosio_global_state > global_state_singleton; + + typedef eosio::singleton< "global2"_n, eosio_global_state2 > global_state2_singleton; + + typedef eosio::singleton< "global3"_n, eosio_global_state3 > global_state3_singleton; + + typedef eosio::singleton< "global4"_n, eosio_global_state4 > global_state4_singleton; + + struct [[eosio::table, eosio::contract("eosio.system")]] user_resources { + name owner; + asset net_weight; + asset cpu_weight; + int64_t ram_bytes = 0; + + bool is_empty()const { return net_weight.amount == 0 && cpu_weight.amount == 0 && ram_bytes == 0; } + uint64_t primary_key()const { return owner.value; } + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( user_resources, (owner)(net_weight)(cpu_weight)(ram_bytes) ) + }; + + // Every user 'from' has a scope/table that uses every receipient 'to' as the primary key. + struct [[eosio::table, eosio::contract("eosio.system")]] delegated_bandwidth { + name from; + name to; + asset net_weight; + asset cpu_weight; + + bool is_empty()const { return net_weight.amount == 0 && cpu_weight.amount == 0; } + uint64_t primary_key()const { return to.value; } + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( delegated_bandwidth, (from)(to)(net_weight)(cpu_weight) ) + + }; + + struct [[eosio::table, eosio::contract("eosio.system")]] refund_request { + name owner; + time_point_sec request_time; + eosio::asset net_amount; + eosio::asset cpu_amount; + + bool is_empty()const { return net_amount.amount == 0 && cpu_amount.amount == 0; } + uint64_t primary_key()const { return owner.value; } + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( refund_request, (owner)(request_time)(net_amount)(cpu_amount) ) + }; + + + typedef eosio::multi_index< "userres"_n, user_resources > user_resources_table; + typedef eosio::multi_index< "delband"_n, delegated_bandwidth > del_bandwidth_table; + typedef eosio::multi_index< "refunds"_n, refund_request > refunds_table; + + // `rex_pool` structure underlying the rex pool table. A rex pool table entry is defined by: + // - `version` defaulted to zero, + // - `total_lent` total amount of CORE_SYMBOL in open rex_loans + // - `total_unlent` total amount of CORE_SYMBOL available to be lent (connector), + // - `total_rent` fees received in exchange for lent (connector), + // - `total_lendable` total amount of CORE_SYMBOL that have been lent (total_unlent + total_lent), + // - `total_rex` total number of REX shares allocated to contributors to total_lendable, + // - `namebid_proceeds` the amount of CORE_SYMBOL to be transferred from namebids to REX pool, + // - `loan_num` increments with each new loan + struct [[eosio::table,eosio::contract("eosio.system")]] rex_pool { + uint8_t version = 0; + asset total_lent; + asset total_unlent; + asset total_rent; + asset total_lendable; + asset total_rex; + asset namebid_proceeds; + uint64_t loan_num = 0; + + uint64_t primary_key()const { return 0; } + }; + + typedef eosio::multi_index< "rexpool"_n, rex_pool > rex_pool_table; + + // `rex_return_pool` structure underlying the rex return pool table. A rex return pool table entry is defined by: + // - `version` defaulted to zero, + // - `last_dist_time` the last time proceeds from renting, ram fees, and name bids were added to the rex pool, + // - `pending_bucket_time` timestamp of the pending 12-hour return bucket, + // - `oldest_bucket_time` cached timestamp of the oldest 12-hour return bucket, + // - `pending_bucket_proceeds` proceeds in the pending 12-hour return bucket, + // - `current_rate_of_increase` the current rate per dist_interval at which proceeds are added to the rex pool, + // - `proceeds` the maximum amount of proceeds that can be added to the rex pool at any given time + struct [[eosio::table,eosio::contract("eosio.system")]] rex_return_pool { + uint8_t version = 0; + time_point_sec last_dist_time; + time_point_sec pending_bucket_time = time_point_sec::maximum(); + time_point_sec oldest_bucket_time = time_point_sec::min(); + int64_t pending_bucket_proceeds = 0; + int64_t current_rate_of_increase = 0; + int64_t proceeds = 0; + + static constexpr uint32_t total_intervals = 30 * 144; // 30 days + static constexpr uint32_t dist_interval = 10 * 60; // 10 minutes + static constexpr uint8_t hours_per_bucket = 12; + static_assert( total_intervals * dist_interval == 30 * seconds_per_day ); + + uint64_t primary_key()const { return 0; } + }; + + typedef eosio::multi_index< "rexretpool"_n, rex_return_pool > rex_return_pool_table; + + // `rex_return_buckets` structure underlying the rex return buckets table. A rex return buckets table is defined by: + // - `version` defaulted to zero, + // - `return_buckets` buckets of proceeds accumulated in 12-hour intervals + struct [[eosio::table,eosio::contract("eosio.system")]] rex_return_buckets { + uint8_t version = 0; + std::map return_buckets; + + uint64_t primary_key()const { return 0; } + }; + + typedef eosio::multi_index< "retbuckets"_n, rex_return_buckets > rex_return_buckets_table; + + // `rex_fund` structure underlying the rex fund table. A rex fund table entry is defined by: + // - `version` defaulted to zero, + // - `owner` the owner of the rex fund, + // - `balance` the balance of the fund. + struct [[eosio::table,eosio::contract("eosio.system")]] rex_fund { + uint8_t version = 0; + name owner; + asset balance; + + uint64_t primary_key()const { return owner.value; } + }; + + typedef eosio::multi_index< "rexfund"_n, rex_fund > rex_fund_table; + + // `rex_balance` structure underlying the rex balance table. A rex balance table entry is defined by: + // - `version` defaulted to zero, + // - `owner` the owner of the rex fund, + // - `vote_stake` the amount of CORE_SYMBOL currently included in owner's vote, + // - `rex_balance` the amount of REX owned by owner, + // - `matured_rex` matured REX available for selling + struct [[eosio::table,eosio::contract("eosio.system")]] rex_balance { + uint8_t version = 0; + name owner; + asset vote_stake; + asset rex_balance; + int64_t matured_rex = 0; + std::deque> rex_maturities; /// REX daily maturity buckets + + uint64_t primary_key()const { return owner.value; } + }; + + typedef eosio::multi_index< "rexbal"_n, rex_balance > rex_balance_table; + + // `rex_loan` structure underlying the `rex_cpu_loan_table` and `rex_net_loan_table`. A rex net/cpu loan table entry is defined by: + // - `version` defaulted to zero, + // - `from` account creating and paying for loan, + // - `receiver` account receiving rented resources, + // - `payment` SYS tokens paid for the loan, + // - `balance` is the amount of SYS tokens available to be used for loan auto-renewal, + // - `total_staked` total amount staked, + // - `loan_num` loan number/id, + // - `expiration` the expiration time when loan will be either closed or renewed + // If payment <= balance, the loan is renewed, and closed otherwise. + struct [[eosio::table,eosio::contract("eosio.system")]] rex_loan { + uint8_t version = 0; + name from; + name receiver; + asset payment; + asset balance; + asset total_staked; + uint64_t loan_num; + eosio::time_point expiration; + + uint64_t primary_key()const { return loan_num; } + uint64_t by_expr()const { return expiration.elapsed.count(); } + uint64_t by_owner()const { return from.value; } + }; + + typedef eosio::multi_index< "cpuloan"_n, rex_loan, + indexed_by<"byexpr"_n, const_mem_fun>, + indexed_by<"byowner"_n, const_mem_fun> + > rex_cpu_loan_table; + + typedef eosio::multi_index< "netloan"_n, rex_loan, + indexed_by<"byexpr"_n, const_mem_fun>, + indexed_by<"byowner"_n, const_mem_fun> + > rex_net_loan_table; + + struct [[eosio::table,eosio::contract("eosio.system")]] rex_order { + uint8_t version = 0; + name owner; + asset rex_requested; + asset proceeds; + asset stake_change; + eosio::time_point order_time; + bool is_open = true; + + void close() { is_open = false; } + uint64_t primary_key()const { return owner.value; } + uint64_t by_time()const { return is_open ? order_time.elapsed.count() : std::numeric_limits::max(); } + }; + + typedef eosio::multi_index< "rexqueue"_n, rex_order, + indexed_by<"bytime"_n, const_mem_fun>> rex_order_table; + + struct rex_order_outcome { + bool success; + asset proceeds; + asset stake_change; + }; + + struct powerup_config_resource { + std::optional current_weight_ratio; // Immediately set weight_ratio to this amount. 1x = 10^15. 0.01x = 10^13. + // Do not specify to preserve the existing setting or use the default; + // this avoids sudden price jumps. For new chains which don't need + // to gradually phase out staking and REX, 0.01x (10^13) is a good + // value for both current_weight_ratio and target_weight_ratio. + std::optional target_weight_ratio; // Linearly shrink weight_ratio to this amount. 1x = 10^15. 0.01x = 10^13. + // Do not specify to preserve the existing setting or use the default. + std::optional assumed_stake_weight; // Assumed stake weight for ratio calculations. Use the sum of total + // staked and total rented by REX at the time the power market + // is first activated. Do not specify to preserve the existing + // setting (no default exists); this avoids sudden price jumps. + // For new chains which don't need to phase out staking and REX, + // 10^12 is probably a good value. + std::optional target_timestamp; // Stop automatic weight_ratio shrinkage at this time. Once this + // time hits, weight_ratio will be target_weight_ratio. Ignored + // if current_weight_ratio == target_weight_ratio. Do not specify + // this to preserve the existing setting (no default exists). + std::optional exponent; // Exponent of resource price curve. Must be >= 1. Do not specify + // to preserve the existing setting or use the default. + std::optional decay_secs; // Number of seconds for the gap between adjusted resource + // utilization and instantaneous resource utilization to shrink + // by 63%. Do not specify to preserve the existing setting or + // use the default. + std::optional min_price; // Fee needed to reserve the entire resource market weight at the + // minimum price. For example, this could be set to 0.005% of + // total token supply. Do not specify to preserve the existing + // setting or use the default. + std::optional max_price; // Fee needed to reserve the entire resource market weight at the + // maximum price. For example, this could be set to 10% of total + // token supply. Do not specify to preserve the existing + // setting (no default exists). + + EOSLIB_SERIALIZE( powerup_config_resource, (current_weight_ratio)(target_weight_ratio)(assumed_stake_weight) + (target_timestamp)(exponent)(decay_secs)(min_price)(max_price) ) + }; + + struct powerup_config { + powerup_config_resource net; // NET market configuration + powerup_config_resource cpu; // CPU market configuration + std::optional powerup_days; // `powerup` `days` argument must match this. Do not specify to preserve the + // existing setting or use the default. + std::optional min_powerup_fee; // Fees below this amount are rejected. Do not specify to preserve the + // existing setting (no default exists). + + EOSLIB_SERIALIZE( powerup_config, (net)(cpu)(powerup_days)(min_powerup_fee) ) + }; + + struct powerup_state_resource { + static constexpr double default_exponent = 2.0; // Exponent of 2.0 means that the price to reserve a + // tiny amount of resources increases linearly + // with utilization. + static constexpr uint32_t default_decay_secs = 1 * seconds_per_day; // 1 day; if 100% of bandwidth resources are in a + // single loan, then, assuming no further powerup usage, + // 1 day after it expires the adjusted utilization + // will be at approximately 37% and after 3 days + // the adjusted utilization will be less than 5%. + + uint8_t version = 0; + int64_t weight = 0; // resource market weight. calculated; varies over time. + // 1 represents the same amount of resources as 1 + // satoshi of SYS staked. + int64_t weight_ratio = 0; // resource market weight ratio: + // assumed_stake_weight / (assumed_stake_weight + weight). + // calculated; varies over time. 1x = 10^15. 0.01x = 10^13. + int64_t assumed_stake_weight = 0; // Assumed stake weight for ratio calculations. + int64_t initial_weight_ratio = powerup_frac; // Initial weight_ratio used for linear shrinkage. + int64_t target_weight_ratio = powerup_frac / 100; // Linearly shrink the weight_ratio to this amount. + time_point_sec initial_timestamp = {}; // When weight_ratio shrinkage started + time_point_sec target_timestamp = {}; // Stop automatic weight_ratio shrinkage at this time. Once this + // time hits, weight_ratio will be target_weight_ratio. + double exponent = default_exponent; // Exponent of resource price curve. + uint32_t decay_secs = default_decay_secs; // Number of seconds for the gap between adjusted resource + // utilization and instantaneous utilization to shrink by 63%. + asset min_price = {}; // Fee needed to reserve the entire resource market weight at + // the minimum price (defaults to 0). + asset max_price = {}; // Fee needed to reserve the entire resource market weight at + // the maximum price. + int64_t utilization = 0; // Instantaneous resource utilization. This is the current + // amount sold. utilization <= weight. + int64_t adjusted_utilization = 0; // Adjusted resource utilization. This is >= utilization and + // <= weight. It grows instantly but decays exponentially. + time_point_sec utilization_timestamp = {}; // When adjusted_utilization was last updated + }; + + struct [[eosio::table("powup.state"),eosio::contract("eosio.system")]] powerup_state { + static constexpr uint32_t default_powerup_days = 30; // 30 day resource powerups + + uint8_t version = 0; + powerup_state_resource net = {}; // NET market state + powerup_state_resource cpu = {}; // CPU market state + uint32_t powerup_days = default_powerup_days; // `powerup` `days` argument must match this. + asset min_powerup_fee = {}; // fees below this amount are rejected + + uint64_t primary_key()const { return 0; } + }; + + typedef eosio::singleton<"powup.state"_n, powerup_state> powerup_state_singleton; + + struct [[eosio::table("powup.order"),eosio::contract("eosio.system")]] powerup_order { + uint8_t version = 0; + uint64_t id; + name owner; + int64_t net_weight; + int64_t cpu_weight; + time_point_sec expires; + + uint64_t primary_key()const { return id; } + uint64_t by_owner()const { return owner.value; } + uint64_t by_expires()const { return expires.utc_seconds; } + }; + + typedef eosio::multi_index< "powup.order"_n, powerup_order, + indexed_by<"byowner"_n, const_mem_fun>, + indexed_by<"byexpires"_n, const_mem_fun> + > powerup_order_table; + + /** + * The `eosio.system` smart contract is provided by `block.one` as a sample system contract, and it defines the structures and actions needed for blockchain's core functionality. + * + * Just like in the `eosio.bios` sample contract implementation, there are a few actions which are not implemented at the contract level (`newaccount`, `updateauth`, `deleteauth`, `linkauth`, `unlinkauth`, `canceldelay`, `onerror`, `setabi`, `setcode`), they are just declared in the contract so they will show in the contract's ABI and users will be able to push those actions to the chain via the account holding the `eosio.system` contract, but the implementation is at the EOSIO core level. They are referred to as EOSIO native actions. + * + * - Users can stake tokens for CPU and Network bandwidth, and then vote for producers or + * delegate their vote to a proxy. + * - Producers register in order to be voted for, and can claim per-block and per-vote rewards. + * - Users can buy and sell RAM at a market-determined price. + * - Users can bid on premium names. + * - A resource exchange system (REX) allows token holders to lend their tokens, + * and users to rent CPU and Network resources in return for a market-determined fee. + * - A resource market separate from REX: `power`. + */ + class [[eosio::contract("eosio.system")]] system_contract : public native { + + private: + voters_table _voters; + producers_table _producers; + producers_table2 _producers2; + global_state_singleton _global; + global_state2_singleton _global2; + global_state3_singleton _global3; + global_state4_singleton _global4; + eosio_global_state _gstate; + eosio_global_state2 _gstate2; + eosio_global_state3 _gstate3; + eosio_global_state4 _gstate4; + rammarket _rammarket; + rex_pool_table _rexpool; + rex_return_pool_table _rexretpool; + rex_return_buckets_table _rexretbuckets; + rex_fund_table _rexfunds; + rex_balance_table _rexbalance; + rex_order_table _rexorders; + + public: + static constexpr eosio::name active_permission{"active"_n}; + static constexpr eosio::name token_account{"eosio.token"_n}; + static constexpr eosio::name ram_account{"eosio.ram"_n}; + static constexpr eosio::name ramfee_account{"eosio.ramfee"_n}; + static constexpr eosio::name stake_account{"eosio.stake"_n}; + static constexpr eosio::name bpay_account{"eosio.bpay"_n}; + static constexpr eosio::name vpay_account{"eosio.vpay"_n}; + static constexpr eosio::name names_account{"eosio.names"_n}; + static constexpr eosio::name saving_account{"eosio.saving"_n}; + static constexpr eosio::name rex_account{"eosio.rex"_n}; + static constexpr eosio::name reserv_account{"eosio.reserv"_n}; + static constexpr eosio::name null_account{"eosio.null"_n}; + static constexpr symbol ramcore_symbol = symbol(symbol_code("RAMCORE"), 4); + static constexpr symbol ram_symbol = symbol(symbol_code("RAM"), 0); + static constexpr symbol rex_symbol = symbol(symbol_code("REX"), 4); + + system_contract( name s, name code, datastream ds ); + ~system_contract(); + + // Returns the core symbol by system account name + // @param system_account - the system account to get the core symbol for. + static symbol get_core_symbol( name system_account = "eosio"_n ) { + rammarket rm(system_account, system_account.value); + const static auto sym = get_core_symbol( rm ); + return sym; + } + + // Actions: + /** + * The Init action initializes the system contract for a version and a symbol. + * Only succeeds when: + * - version is 0 and + * - symbol is found and + * - system token supply is greater than 0, + * - and system contract wasn’t already been initialized. + * + * @param version - the version, has to be 0, + * @param core - the system symbol. + */ + [[eosio::action]] + void init( unsigned_int version, const symbol& core ); + + /** + * On block action. This special action is triggered when a block is applied by the given producer + * and cannot be generated from any other source. It is used to pay producers and calculate + * missed blocks of other producers. Producer pay is deposited into the producer's stake + * balance and can be withdrawn over time. If blocknum is the start of a new round this may + * update the active producer config from the producer votes. + * + * @param header - the block header produced. + */ + [[eosio::action]] + void onblock( ignore header ); + + /** + * Set account limits action sets the resource limits of an account + * + * @param account - name of the account whose resource limit to be set, + * @param ram_bytes - ram limit in absolute bytes, + * @param net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts), + * @param cpu_weight - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts). + */ + [[eosio::action]] + void setalimits( const name& account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight ); + + /** + * Set account RAM limits action, which sets the RAM limits of an account + * + * @param account - name of the account whose resource limit to be set, + * @param ram_bytes - ram limit in absolute bytes. + */ + [[eosio::action]] + void setacctram( const name& account, const std::optional& ram_bytes ); + + /** + * Set account NET limits action, which sets the NET limits of an account + * + * @param account - name of the account whose resource limit to be set, + * @param net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts). + */ + [[eosio::action]] + void setacctnet( const name& account, const std::optional& net_weight ); + + /** + * Set account CPU limits action, which sets the CPU limits of an account + * + * @param account - name of the account whose resource limit to be set, + * @param cpu_weight - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts). + */ + [[eosio::action]] + void setacctcpu( const name& account, const std::optional& cpu_weight ); + + + /** + * The activate action, activates a protocol feature + * + * @param feature_digest - hash of the protocol feature to activate. + */ + [[eosio::action]] + void activate( const eosio::checksum256& feature_digest ); + + // functions defined in delegate_bandwidth.cpp + + /** + * Delegate bandwidth and/or cpu action. Stakes SYS from the balance of `from` for the benefit of `receiver`. + * + * @param from - the account to delegate bandwidth from, that is, the account holding + * tokens to be staked, + * @param receiver - the account to delegate bandwith to, that is, the account to + * whose resources staked tokens are added + * @param stake_net_quantity - tokens staked for NET bandwidth, + * @param stake_cpu_quantity - tokens staked for CPU bandwidth, + * @param transfer - if true, ownership of staked tokens is transfered to `receiver`. + * + * @post All producers `from` account has voted for will have their votes updated immediately. + */ + [[eosio::action]] + void delegatebw( const name& from, const name& receiver, + const asset& stake_net_quantity, const asset& stake_cpu_quantity, bool transfer ); + + /** + * Setrex action, sets total_rent balance of REX pool to the passed value. + * @param balance - amount to set the REX pool balance. + */ + [[eosio::action]] + void setrex( const asset& balance ); + + /** + * Deposit to REX fund action. Deposits core tokens to user REX fund. + * All proceeds and expenses related to REX are added to or taken out of this fund. + * An inline transfer from 'owner' liquid balance is executed. + * All REX-related costs and proceeds are deducted from and added to 'owner' REX fund, + * with one exception being buying REX using staked tokens. + * Storage change is billed to 'owner'. + * + * @param owner - REX fund owner account, + * @param amount - amount of tokens to be deposited. + */ + [[eosio::action]] + void deposit( const name& owner, const asset& amount ); + + /** + * Withdraw from REX fund action, withdraws core tokens from user REX fund. + * An inline token transfer to user balance is executed. + * + * @param owner - REX fund owner account, + * @param amount - amount of tokens to be withdrawn. + */ + [[eosio::action]] + void withdraw( const name& owner, const asset& amount ); + + /** + * Buyrex action, buys REX in exchange for tokens taken out of user's REX fund by transfering + * core tokens from user REX fund and converts them to REX stake. By buying REX, user is + * lending tokens in order to be rented as CPU or NET resourses. + * Storage change is billed to 'from' account. + * + * @param from - owner account name, + * @param amount - amount of tokens taken out of 'from' REX fund. + * + * @pre A voting requirement must be satisfied before action can be executed. + * @pre User must vote for at least 21 producers or delegate vote to proxy before buying REX. + * + * @post User votes are updated following this action. + * @post Tokens used in purchase are added to user's voting power. + * @post Bought REX cannot be sold before 4 days counting from end of day of purchase. + */ + [[eosio::action]] + void buyrex( const name& from, const asset& amount ); + + /** + * Unstaketorex action, uses staked core tokens to buy REX. + * Storage change is billed to 'owner' account. + * + * @param owner - owner of staked tokens, + * @param receiver - account name that tokens have previously been staked to, + * @param from_net - amount of tokens to be unstaked from NET bandwidth and used for REX purchase, + * @param from_cpu - amount of tokens to be unstaked from CPU bandwidth and used for REX purchase. + * + * @pre A voting requirement must be satisfied before action can be executed. + * @pre User must vote for at least 21 producers or delegate vote to proxy before buying REX. + * + * @post User votes are updated following this action. + * @post Tokens used in purchase are added to user's voting power. + * @post Bought REX cannot be sold before 4 days counting from end of day of purchase. + */ + [[eosio::action]] + void unstaketorex( const name& owner, const name& receiver, const asset& from_net, const asset& from_cpu ); + + /** + * Sellrex action, sells REX in exchange for core tokens by converting REX stake back into core tokens + * at current exchange rate. If order cannot be processed, it gets queued until there is enough + * in REX pool to fill order, and will be processed within 30 days at most. If successful, user + * votes are updated, that is, proceeds are deducted from user's voting power. In case sell order + * is queued, storage change is billed to 'from' account. + * + * @param from - owner account of REX, + * @param rex - amount of REX to be sold. + */ + [[eosio::action]] + void sellrex( const name& from, const asset& rex ); + + /** + * Cnclrexorder action, cancels unfilled REX sell order by owner if one exists. + * + * @param owner - owner account name. + * + * @pre Order cannot be cancelled once it's been filled. + */ + [[eosio::action]] + void cnclrexorder( const name& owner ); + + /** + * Rentcpu action, uses payment to rent as many SYS tokens as possible as determined by market price and + * stake them for CPU for the benefit of receiver, after 30 days the rented core delegation of CPU + * will expire. At expiration, if balance is greater than or equal to `loan_payment`, `loan_payment` + * is taken out of loan balance and used to renew the loan. Otherwise, the loan is closed and user + * is refunded any remaining balance. + * Owner can fund or refund a loan at any time before its expiration. + * All loan expenses and refunds come out of or are added to owner's REX fund. + * + * @param from - account creating and paying for CPU loan, 'from' account can add tokens to loan + * balance using action `fundcpuloan` and withdraw from loan balance using `defcpuloan` + * @param receiver - account receiving rented CPU resources, + * @param loan_payment - tokens paid for the loan, it has to be greater than zero, + * amount of rented resources is calculated from `loan_payment`, + * @param loan_fund - additional tokens can be zero, and is added to loan balance. + * Loan balance represents a reserve that is used at expiration for automatic loan renewal. + */ + [[eosio::action]] + void rentcpu( const name& from, const name& receiver, const asset& loan_payment, const asset& loan_fund ); + + /** + * Rentnet action, uses payment to rent as many SYS tokens as possible as determined by market price and + * stake them for NET for the benefit of receiver, after 30 days the rented core delegation of NET + * will expire. At expiration, if balance is greater than or equal to `loan_payment`, `loan_payment` + * is taken out of loan balance and used to renew the loan. Otherwise, the loan is closed and user + * is refunded any remaining balance. + * Owner can fund or refund a loan at any time before its expiration. + * All loan expenses and refunds come out of or are added to owner's REX fund. + * + * @param from - account creating and paying for NET loan, 'from' account can add tokens to loan + * balance using action `fundnetloan` and withdraw from loan balance using `defnetloan`, + * @param receiver - account receiving rented NET resources, + * @param loan_payment - tokens paid for the loan, it has to be greater than zero, + * amount of rented resources is calculated from `loan_payment`, + * @param loan_fund - additional tokens can be zero, and is added to loan balance. + * Loan balance represents a reserve that is used at expiration for automatic loan renewal. + */ + [[eosio::action]] + void rentnet( const name& from, const name& receiver, const asset& loan_payment, const asset& loan_fund ); + + /** + * Fundcpuloan action, transfers tokens from REX fund to the fund of a specific CPU loan in order to + * be used for loan renewal at expiry. + * + * @param from - loan creator account, + * @param loan_num - loan id, + * @param payment - tokens transfered from REX fund to loan fund. + */ + [[eosio::action]] + void fundcpuloan( const name& from, uint64_t loan_num, const asset& payment ); + + /** + * Fundnetloan action, transfers tokens from REX fund to the fund of a specific NET loan in order to + * be used for loan renewal at expiry. + * + * @param from - loan creator account, + * @param loan_num - loan id, + * @param payment - tokens transfered from REX fund to loan fund. + */ + [[eosio::action]] + void fundnetloan( const name& from, uint64_t loan_num, const asset& payment ); + + /** + * Defcpuloan action, withdraws tokens from the fund of a specific CPU loan and adds them to REX fund. + * + * @param from - loan creator account, + * @param loan_num - loan id, + * @param amount - tokens transfered from CPU loan fund to REX fund. + */ + [[eosio::action]] + void defcpuloan( const name& from, uint64_t loan_num, const asset& amount ); + + /** + * Defnetloan action, withdraws tokens from the fund of a specific NET loan and adds them to REX fund. + * + * @param from - loan creator account, + * @param loan_num - loan id, + * @param amount - tokens transfered from NET loan fund to REX fund. + */ + [[eosio::action]] + void defnetloan( const name& from, uint64_t loan_num, const asset& amount ); + + /** + * Updaterex action, updates REX owner vote weight to current value of held REX tokens. + * + * @param owner - REX owner account. + */ + [[eosio::action]] + void updaterex( const name& owner ); + + /** + * Rexexec action, processes max CPU loans, max NET loans, and max queued sellrex orders. + * Action does not execute anything related to a specific user. + * + * @param user - any account can execute this action, + * @param max - number of each of CPU loans, NET loans, and sell orders to be processed. + */ + [[eosio::action]] + void rexexec( const name& user, uint16_t max ); + + /** + * Consolidate action, consolidates REX maturity buckets into one bucket that can be sold after 4 days + * starting from the end of the day. + * + * @param owner - REX owner account name. + */ + [[eosio::action]] + void consolidate( const name& owner ); + + /** + * Mvtosavings action, moves a specified amount of REX into savings bucket. REX savings bucket + * never matures. In order for it to be sold, it has to be moved explicitly + * out of that bucket. Then the moved amount will have the regular maturity + * period of 4 days starting from the end of the day. + * + * @param owner - REX owner account name. + * @param rex - amount of REX to be moved. + */ + [[eosio::action]] + void mvtosavings( const name& owner, const asset& rex ); + + /** + * Mvfrsavings action, moves a specified amount of REX out of savings bucket. The moved amount + * will have the regular REX maturity period of 4 days. + * + * @param owner - REX owner account name. + * @param rex - amount of REX to be moved. + */ + [[eosio::action]] + void mvfrsavings( const name& owner, const asset& rex ); + + /** + * Closerex action, deletes owner records from REX tables and frees used RAM. Owner must not have + * an outstanding REX balance. + * + * @param owner - user account name. + * + * @pre If owner has a non-zero REX balance, the action fails; otherwise, + * owner REX balance entry is deleted. + * @pre If owner has no outstanding loans and a zero REX fund balance, + * REX fund entry is deleted. + */ + [[eosio::action]] + void closerex( const name& owner ); + + /** + * Undelegate bandwitdh action, decreases the total tokens delegated by `from` to `receiver` and/or + * frees the memory associated with the delegation if there is nothing + * left to delegate. + * This will cause an immediate reduction in net/cpu bandwidth of the + * receiver. + * A transaction is scheduled to send the tokens back to `from` after + * the staking period has passed. If existing transaction is scheduled, it + * will be canceled and a new transaction issued that has the combined + * undelegated amount. + * The `from` account loses voting power as a result of this call and + * all producer tallies are updated. + * + * @param from - the account to undelegate bandwidth from, that is, + * the account whose tokens will be unstaked, + * @param receiver - the account to undelegate bandwith to, that is, + * the account to whose benefit tokens have been staked, + * @param unstake_net_quantity - tokens to be unstaked from NET bandwidth, + * @param unstake_cpu_quantity - tokens to be unstaked from CPU bandwidth, + * + * @post Unstaked tokens are transferred to `from` liquid balance via a + * deferred transaction with a delay of 3 days. + * @post If called during the delay period of a previous `undelegatebw` + * action, pending action is canceled and timer is reset. + * @post All producers `from` account has voted for will have their votes updated immediately. + * @post Bandwidth and storage for the deferred transaction are billed to `from`. + */ + [[eosio::action]] + void undelegatebw( const name& from, const name& receiver, + const asset& unstake_net_quantity, const asset& unstake_cpu_quantity ); + + /** + * Buy ram action, increases receiver's ram quota based upon current price and quantity of + * tokens provided. An inline transfer from receiver to system contract of + * tokens will be executed. + * + * @param payer - the ram buyer, + * @param receiver - the ram receiver, + * @param quant - the quntity of tokens to buy ram with. + */ + [[eosio::action]] + void buyram( const name& payer, const name& receiver, const asset& quant ); + + /** + * Buy a specific amount of ram bytes action. Increases receiver's ram in quantity of bytes provided. + * An inline transfer from receiver to system contract of tokens will be executed. + * + * @param payer - the ram buyer, + * @param receiver - the ram receiver, + * @param bytes - the quntity of ram to buy specified in bytes. + */ + [[eosio::action]] + void buyrambytes( const name& payer, const name& receiver, uint32_t bytes ); + + /** + * Sell ram action, reduces quota by bytes and then performs an inline transfer of tokens + * to receiver based upon the average purchase price of the original quota. + * + * @param account - the ram seller account, + * @param bytes - the amount of ram to sell in bytes. + */ + [[eosio::action]] + void sellram( const name& account, int64_t bytes ); + + /** + * Refund action, this action is called after the delegation-period to claim all pending + * unstaked tokens belonging to owner. + * + * @param owner - the owner of the tokens claimed. + */ + [[eosio::action]] + void refund( const name& owner ); + + // functions defined in voting.cpp + + /** + * Register producer action, indicates that a particular account wishes to become a producer, + * this action will create a `producer_config` and a `producer_info` object for `producer` scope + * in producers tables. + * + * @param producer - account registering to be a producer candidate, + * @param producer_key - the public key of the block producer, this is the key used by block producer to sign blocks, + * @param url - the url of the block producer, normally the url of the block producer presentation website, + * @param location - is the country code as defined in the ISO 3166, https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes + * + * @pre Producer to register is an account + * @pre Authority of producer to register + */ + [[eosio::action]] + void regproducer( const name& producer, const public_key& producer_key, const std::string& url, uint16_t location ); + + /** + * Register producer action, indicates that a particular account wishes to become a producer, + * this action will create a `producer_config` and a `producer_info` object for `producer` scope + * in producers tables. + * + * @param producer - account registering to be a producer candidate, + * @param producer_authority - the weighted threshold multisig block signing authority of the block producer used to sign blocks, + * @param url - the url of the block producer, normally the url of the block producer presentation website, + * @param location - is the country code as defined in the ISO 3166, https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes + * + * @pre Producer to register is an account + * @pre Authority of producer to register + */ + [[eosio::action]] + void regproducer2( const name& producer, const eosio::block_signing_authority& producer_authority, const std::string& url, uint16_t location ); + + /** + * Unregister producer action, deactivates the block producer with account name `producer`. + * + * Deactivate the block producer with account name `producer`. + * @param producer - the block producer account to unregister. + */ + [[eosio::action]] + void unregprod( const name& producer ); + + /** + * Set ram action sets the ram supply. + * @param max_ram_size - the amount of ram supply to set. + */ + [[eosio::action]] + void setram( uint64_t max_ram_size ); + + /** + * Set ram rate action, sets the rate of increase of RAM in bytes per block. It is capped by the uint16_t to + * a maximum rate of 3 TB per year. If update_ram_supply hasn't been called for the most recent block, + * then new ram will be allocated at the old rate up to the present block before switching the rate. + * + * @param bytes_per_block - the amount of bytes per block increase to set. + */ + [[eosio::action]] + void setramrate( uint16_t bytes_per_block ); + + /** + * Vote producer action, votes for a set of producers. This action updates the list of `producers` voted for, + * for `voter` account. If voting for a `proxy`, the producer votes will not change until the + * proxy updates their own vote. Voter can vote for a proxy __or__ a list of at most 30 producers. + * Storage change is billed to `voter`. + * + * @param voter - the account to change the voted producers for, + * @param proxy - the proxy to change the voted producers for, + * @param producers - the list of producers to vote for, a maximum of 30 producers is allowed. + * + * @pre Producers must be sorted from lowest to highest and must be registered and active + * @pre If proxy is set then no producers can be voted for + * @pre If proxy is set then proxy account must exist and be registered as a proxy + * @pre Every listed producer or proxy must have been previously registered + * @pre Voter must authorize this action + * @pre Voter must have previously staked some EOS for voting + * @pre Voter->staked must be up to date + * + * @post Every producer previously voted for will have vote reduced by previous vote weight + * @post Every producer newly voted for will have vote increased by new vote amount + * @post Prior proxy will proxied_vote_weight decremented by previous vote weight + * @post New proxy will proxied_vote_weight incremented by new vote weight + */ + [[eosio::action]] + void voteproducer( const name& voter, const name& proxy, const std::vector& producers ); + + /** + * Register proxy action, sets `proxy` account as proxy. + * An account marked as a proxy can vote with the weight of other accounts which + * have selected it as a proxy. Other accounts must refresh their voteproducer to + * update the proxy's weight. + * Storage change is billed to `proxy`. + * + * @param rpoxy - the account registering as voter proxy (or unregistering), + * @param isproxy - if true, proxy is registered; if false, proxy is unregistered. + * + * @pre Proxy must have something staked (existing row in voters table) + * @pre New state must be different than current state + */ + [[eosio::action]] + void regproxy( const name& proxy, bool isproxy ); + + /** + * Set the blockchain parameters. By tunning these parameters a degree of + * customization can be achieved. + * @param params - New blockchain parameters to set. + */ + [[eosio::action]] + void setparams( const eosio::blockchain_parameters& params ); + + /** + * Claim rewards action, claims block producing and vote rewards. + * @param owner - producer account claiming per-block and per-vote rewards. + */ + [[eosio::action]] + void claimrewards( const name& owner ); + + /** + * Set privilege status for an account. Allows to set privilege status for an account (turn it on/off). + * @param account - the account to set the privileged status for. + * @param is_priv - 0 for false, > 0 for true. + */ + [[eosio::action]] + void setpriv( const name& account, uint8_t is_priv ); + + /** + * Remove producer action, deactivates a producer by name, if not found asserts. + * @param producer - the producer account to deactivate. + */ + [[eosio::action]] + void rmvproducer( const name& producer ); + + /** + * Update revision action, updates the current revision. + * @param revision - it has to be incremented by 1 compared with current revision. + * + * @pre Current revision can not be higher than 254, and has to be smaller + * than or equal 1 (“set upper bound to greatest revision supported in the code”). + */ + [[eosio::action]] + void updtrevision( uint8_t revision ); + + /** + * Bid name action, allows an account `bidder` to place a bid for a name `newname`. + * @param bidder - the account placing the bid, + * @param newname - the name the bid is placed for, + * @param bid - the amount of system tokens payed for the bid. + * + * @pre Bids can be placed only on top-level suffix, + * @pre Non empty name, + * @pre Names longer than 12 chars are not allowed, + * @pre Names equal with 12 chars can be created without placing a bid, + * @pre Bid has to be bigger than zero, + * @pre Bid's symbol must be system token, + * @pre Bidder account has to be different than current highest bidder, + * @pre Bid must increase current bid by 10%, + * @pre Auction must still be opened. + */ + [[eosio::action]] + void bidname( const name& bidder, const name& newname, const asset& bid ); + + /** + * Bid refund action, allows the account `bidder` to get back the amount it bid so far on a `newname` name. + * + * @param bidder - the account that gets refunded, + * @param newname - the name for which the bid was placed and now it gets refunded for. + */ + [[eosio::action]] + void bidrefund( const name& bidder, const name& newname ); + + /** + * Change the annual inflation rate of the core token supply and specify how + * the new issued tokens will be distributed based on the following structure. + * + * @param annual_rate - Annual inflation rate of the core token supply. + * (eg. For 5% Annual inflation => annual_rate=500 + * For 1.5% Annual inflation => annual_rate=150 + * @param inflation_pay_factor - Inverse of the fraction of the inflation used to reward block producers. + * The remaining inflation will be sent to the `eosio.saving` account. + * (eg. For 20% of inflation going to block producer rewards => inflation_pay_factor = 50000 + * For 100% of inflation going to block producer rewards => inflation_pay_factor = 10000). + * @param votepay_factor - Inverse of the fraction of the block producer rewards to be distributed proportional to blocks produced. + * The remaining rewards will be distributed proportional to votes received. + * (eg. For 25% of block producer rewards going towards block pay => votepay_factor = 40000 + * For 75% of block producer rewards going towards block pay => votepay_factor = 13333). + */ + [[eosio::action]] + void setinflation( int64_t annual_rate, int64_t inflation_pay_factor, int64_t votepay_factor ); + + /** + * Configure the `power` market. The market becomes available the first time this + * action is invoked. + */ + [[eosio::action]] + void cfgpowerup( powerup_config& args ); + + /** + * Process power queue and update state. Action does not execute anything related to a specific user. + * + * @param user - any account can execute this action + * @param max - number of queue items to process + */ + [[eosio::action]] + void powerupexec( const name& user, uint16_t max ); + + /** + * Powerup NET and CPU resources by percentage + * + * @param payer - the resource buyer + * @param receiver - the resource receiver + * @param days - number of days of resource availability. Must match market configuration. + * @param net_frac - fraction of net (100% = 10^15) managed by this market + * @param cpu_frac - fraction of cpu (100% = 10^15) managed by this market + * @param max_payment - the maximum amount `payer` is willing to pay. Tokens are withdrawn from + * `payer`'s token balance. + */ + [[eosio::action]] + void powerup( const name& payer, const name& receiver, uint32_t days, int64_t net_frac, int64_t cpu_frac, const asset& max_payment ); + + using init_action = eosio::action_wrapper<"init"_n, &system_contract::init>; + using setacctram_action = eosio::action_wrapper<"setacctram"_n, &system_contract::setacctram>; + using setacctnet_action = eosio::action_wrapper<"setacctnet"_n, &system_contract::setacctnet>; + using setacctcpu_action = eosio::action_wrapper<"setacctcpu"_n, &system_contract::setacctcpu>; + using activate_action = eosio::action_wrapper<"activate"_n, &system_contract::activate>; + using delegatebw_action = eosio::action_wrapper<"delegatebw"_n, &system_contract::delegatebw>; + using deposit_action = eosio::action_wrapper<"deposit"_n, &system_contract::deposit>; + using withdraw_action = eosio::action_wrapper<"withdraw"_n, &system_contract::withdraw>; + using buyrex_action = eosio::action_wrapper<"buyrex"_n, &system_contract::buyrex>; + using unstaketorex_action = eosio::action_wrapper<"unstaketorex"_n, &system_contract::unstaketorex>; + using sellrex_action = eosio::action_wrapper<"sellrex"_n, &system_contract::sellrex>; + using cnclrexorder_action = eosio::action_wrapper<"cnclrexorder"_n, &system_contract::cnclrexorder>; + using rentcpu_action = eosio::action_wrapper<"rentcpu"_n, &system_contract::rentcpu>; + using rentnet_action = eosio::action_wrapper<"rentnet"_n, &system_contract::rentnet>; + using fundcpuloan_action = eosio::action_wrapper<"fundcpuloan"_n, &system_contract::fundcpuloan>; + using fundnetloan_action = eosio::action_wrapper<"fundnetloan"_n, &system_contract::fundnetloan>; + using defcpuloan_action = eosio::action_wrapper<"defcpuloan"_n, &system_contract::defcpuloan>; + using defnetloan_action = eosio::action_wrapper<"defnetloan"_n, &system_contract::defnetloan>; + using updaterex_action = eosio::action_wrapper<"updaterex"_n, &system_contract::updaterex>; + using rexexec_action = eosio::action_wrapper<"rexexec"_n, &system_contract::rexexec>; + using setrex_action = eosio::action_wrapper<"setrex"_n, &system_contract::setrex>; + using mvtosavings_action = eosio::action_wrapper<"mvtosavings"_n, &system_contract::mvtosavings>; + using mvfrsavings_action = eosio::action_wrapper<"mvfrsavings"_n, &system_contract::mvfrsavings>; + using consolidate_action = eosio::action_wrapper<"consolidate"_n, &system_contract::consolidate>; + using closerex_action = eosio::action_wrapper<"closerex"_n, &system_contract::closerex>; + using undelegatebw_action = eosio::action_wrapper<"undelegatebw"_n, &system_contract::undelegatebw>; + using buyram_action = eosio::action_wrapper<"buyram"_n, &system_contract::buyram>; + using buyrambytes_action = eosio::action_wrapper<"buyrambytes"_n, &system_contract::buyrambytes>; + using sellram_action = eosio::action_wrapper<"sellram"_n, &system_contract::sellram>; + using refund_action = eosio::action_wrapper<"refund"_n, &system_contract::refund>; + using regproducer_action = eosio::action_wrapper<"regproducer"_n, &system_contract::regproducer>; + using regproducer2_action = eosio::action_wrapper<"regproducer2"_n, &system_contract::regproducer2>; + using unregprod_action = eosio::action_wrapper<"unregprod"_n, &system_contract::unregprod>; + using setram_action = eosio::action_wrapper<"setram"_n, &system_contract::setram>; + using setramrate_action = eosio::action_wrapper<"setramrate"_n, &system_contract::setramrate>; + using voteproducer_action = eosio::action_wrapper<"voteproducer"_n, &system_contract::voteproducer>; + using regproxy_action = eosio::action_wrapper<"regproxy"_n, &system_contract::regproxy>; + using claimrewards_action = eosio::action_wrapper<"claimrewards"_n, &system_contract::claimrewards>; + using rmvproducer_action = eosio::action_wrapper<"rmvproducer"_n, &system_contract::rmvproducer>; + using updtrevision_action = eosio::action_wrapper<"updtrevision"_n, &system_contract::updtrevision>; + using bidname_action = eosio::action_wrapper<"bidname"_n, &system_contract::bidname>; + using bidrefund_action = eosio::action_wrapper<"bidrefund"_n, &system_contract::bidrefund>; + using setpriv_action = eosio::action_wrapper<"setpriv"_n, &system_contract::setpriv>; + using setalimits_action = eosio::action_wrapper<"setalimits"_n, &system_contract::setalimits>; + using setparams_action = eosio::action_wrapper<"setparams"_n, &system_contract::setparams>; + using setinflation_action = eosio::action_wrapper<"setinflation"_n, &system_contract::setinflation>; + using cfgpowerup_action = eosio::action_wrapper<"cfgpowerup"_n, &system_contract::cfgpowerup>; + using powerupexec_action = eosio::action_wrapper<"powerupexec"_n, &system_contract::powerupexec>; + using powerup_action = eosio::action_wrapper<"powerup"_n, &system_contract::powerup>; + + private: + // Implementation details: + + static symbol get_core_symbol( const rammarket& rm ) { + auto itr = rm.find(ramcore_symbol.raw()); + check(itr != rm.end(), "system contract must first be initialized"); + return itr->quote.balance.symbol; + } + + //defined in eosio.system.cpp + static eosio_global_state get_default_parameters(); + static eosio_global_state4 get_default_inflation_parameters(); + symbol core_symbol()const; + void update_ram_supply(); + + // defined in rex.cpp + void runrex( uint16_t max ); + void update_rex_pool(); + void update_resource_limits( const name& from, const name& receiver, int64_t delta_net, int64_t delta_cpu ); + void check_voting_requirement( const name& owner, + const char* error_msg = "must vote for at least 21 producers or for a proxy before buying REX" )const; + rex_order_outcome fill_rex_order( const rex_balance_table::const_iterator& bitr, const asset& rex ); + asset update_rex_account( const name& owner, const asset& proceeds, const asset& unstake_quant, bool force_vote_update = false ); + void channel_to_rex( const name& from, const asset& amount, bool required = false ); + void channel_namebid_to_rex( const int64_t highest_bid ); + template + int64_t rent_rex( T& table, const name& from, const name& receiver, const asset& loan_payment, const asset& loan_fund ); + template + void fund_rex_loan( T& table, const name& from, uint64_t loan_num, const asset& payment ); + template + void defund_rex_loan( T& table, const name& from, uint64_t loan_num, const asset& amount ); + void transfer_from_fund( const name& owner, const asset& amount ); + void transfer_to_fund( const name& owner, const asset& amount ); + bool rex_loans_available()const; + bool rex_system_initialized()const { return _rexpool.begin() != _rexpool.end(); } + bool rex_available()const { return rex_system_initialized() && _rexpool.begin()->total_rex.amount > 0; } + static time_point_sec get_rex_maturity(); + asset add_to_rex_balance( const name& owner, const asset& payment, const asset& rex_received ); + asset add_to_rex_pool( const asset& payment ); + void add_to_rex_return_pool( const asset& fee ); + void process_rex_maturities( const rex_balance_table::const_iterator& bitr ); + void consolidate_rex_balance( const rex_balance_table::const_iterator& bitr, + const asset& rex_in_sell_order ); + int64_t read_rex_savings( const rex_balance_table::const_iterator& bitr ); + void put_rex_savings( const rex_balance_table::const_iterator& bitr, int64_t rex ); + void update_rex_stake( const name& voter ); + + void add_loan_to_rex_pool( const asset& payment, int64_t rented_tokens, bool new_loan ); + void remove_loan_from_rex_pool( const rex_loan& loan ); + template + int64_t update_renewed_loan( Index& idx, const Iterator& itr, int64_t rented_tokens ); + + // defined in delegate_bandwidth.cpp + void changebw( name from, const name& receiver, + const asset& stake_net_quantity, const asset& stake_cpu_quantity, bool transfer ); + void update_voting_power( const name& voter, const asset& total_update ); + + // defined in voting.cpp + void register_producer( const name& producer, const eosio::block_signing_authority& producer_authority, const std::string& url, uint16_t location ); + void update_elected_producers( const block_timestamp& timestamp ); + void update_votes( const name& voter, const name& proxy, const std::vector& producers, bool voting ); + void propagate_weight_change( const voter_info& voter ); + double update_producer_votepay_share( const producers_table2::const_iterator& prod_itr, + const time_point& ct, + double shares_rate, bool reset_to_zero = false ); + double update_total_votepay_share( const time_point& ct, + double additional_shares_delta = 0.0, double shares_rate_delta = 0.0 ); + + template + class registration { + public: + template + struct for_each { + template + static constexpr void call( system_contract* this_contract, Args&&... args ) + { + std::invoke( P, this_contract, args... ); + for_each::call( this_contract, std::forward(args)... ); + } + }; + template + struct for_each

{ + template + static constexpr void call( system_contract* this_contract, Args&&... args ) + { + std::invoke( P, this_contract, std::forward(args)... ); + } + }; + + template + constexpr void operator() ( Args&&... args ) + { + for_each::call( this_contract, std::forward(args)... ); + } + + system_contract* this_contract; + }; + + registration<&system_contract::update_rex_stake> vote_stake_updater{ this }; + + // defined in power.cpp + void adjust_resources(name payer, name account, symbol core_symbol, int64_t net_delta, int64_t cpu_delta, bool must_not_be_managed = false); + void process_powerup_queue( + time_point_sec now, symbol core_symbol, powerup_state& state, + powerup_order_table& orders, uint32_t max_items, int64_t& net_delta_available, + int64_t& cpu_delta_available); + }; + +} diff --git a/contracts/eosio.system/include/eosio.system/exchange_state.hpp b/contracts/eosio.system/include/eosio.system/exchange_state.hpp new file mode 100644 index 000000000..c339b9706 --- /dev/null +++ b/contracts/eosio.system/include/eosio.system/exchange_state.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include +#include + +namespace eosiosystem { + + using eosio::asset; + using eosio::symbol; + + /** + * Uses Bancor math to create a 50/50 relay between two asset types. + * + * The state of the bancor exchange is entirely contained within this struct. + * There are no external side effects associated with using this API. + */ + struct [[eosio::table, eosio::contract("eosio.system")]] exchange_state { + asset supply; + + struct connector { + asset balance; + double weight = .5; + + EOSLIB_SERIALIZE( connector, (balance)(weight) ) + }; + + connector base; + connector quote; + + uint64_t primary_key()const { return supply.symbol.raw(); } + + asset convert_to_exchange( connector& reserve, const asset& payment ); + asset convert_from_exchange( connector& reserve, const asset& tokens ); + asset convert( const asset& from, const symbol& to ); + asset direct_convert( const asset& from, const symbol& to ); + + static int64_t get_bancor_output( int64_t inp_reserve, + int64_t out_reserve, + int64_t inp ); + static int64_t get_bancor_input( int64_t out_reserve, + int64_t inp_reserve, + int64_t out ); + + EOSLIB_SERIALIZE( exchange_state, (supply)(base)(quote) ) + }; + + typedef eosio::multi_index< "rammarket"_n, exchange_state > rammarket; +} /// namespace eosiosystem diff --git a/contracts/eosio.system/include/eosio.system/native.hpp b/contracts/eosio.system/include/eosio.system/native.hpp new file mode 100644 index 000000000..a0931cde2 --- /dev/null +++ b/contracts/eosio.system/include/eosio.system/native.hpp @@ -0,0 +1,260 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace eosiosystem { + + using eosio::checksum256; + using eosio::ignore; + using eosio::name; + using eosio::permission_level; + using eosio::public_key; + + /** + * A weighted permission. + * + * Defines a weighted permission, that is a permission which has a weight associated. + * A permission is defined by an account name plus a permission name. + */ + struct permission_level_weight { + permission_level permission; + uint16_t weight; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( permission_level_weight, (permission)(weight) ) + }; + + /** + * Weighted key. + * + * A weighted key is defined by a public key and an associated weight. + */ + struct key_weight { + eosio::public_key key; + uint16_t weight; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( key_weight, (key)(weight) ) + }; + + /** + * Wait weight. + * + * A wait weight is defined by a number of seconds to wait for and a weight. + */ + struct wait_weight { + uint32_t wait_sec; + uint16_t weight; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( wait_weight, (wait_sec)(weight) ) + }; + + /** + * Blockchain authority. + * + * An authority is defined by: + * - a vector of key_weights (a key_weight is a public key plus a wieght), + * - a vector of permission_level_weights, (a permission_level is an account name plus a permission name) + * - a vector of wait_weights (a wait_weight is defined by a number of seconds to wait and a weight) + * - a threshold value + */ + struct authority { + uint32_t threshold = 0; + std::vector keys; + std::vector accounts; + std::vector waits; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE( authority, (threshold)(keys)(accounts)(waits) ) + }; + + /** + * Blockchain block header. + * + * A block header is defined by: + * - a timestamp, + * - the producer that created it, + * - a confirmed flag default as zero, + * - a link to previous block, + * - a link to the transaction merkel root, + * - a link to action root, + * - a schedule version, + * - and a producers' schedule. + */ + struct block_header { + uint32_t timestamp; + name producer; + uint16_t confirmed = 0; + checksum256 previous; + checksum256 transaction_mroot; + checksum256 action_mroot; + uint32_t schedule_version = 0; + std::optional new_producers; + + // explicit serialization macro is not necessary, used here only to improve compilation time + EOSLIB_SERIALIZE(block_header, (timestamp)(producer)(confirmed)(previous)(transaction_mroot)(action_mroot) + (schedule_version)(new_producers)) + }; + + /** + * abi_hash is the structure underlying the abihash table and consists of: + * - `owner`: the account owner of the contract's abi + * - `hash`: is the sha256 hash of the abi/binary + */ + struct [[eosio::table("abihash"), eosio::contract("eosio.system")]] abi_hash { + name owner; + checksum256 hash; + uint64_t primary_key()const { return owner.value; } + + EOSLIB_SERIALIZE( abi_hash, (owner)(hash) ) + }; + + // Method parameters commented out to prevent generation of code that parses input data. + /** + * The EOSIO core `native` contract that governs authorization and contracts' abi. + */ + class [[eosio::contract("eosio.system")]] native : public eosio::contract { + public: + + using eosio::contract::contract; + + /** + * These actions map one-on-one with the ones defined in core layer of EOSIO, that's where their implementation + * actually is done. + * They are present here only so they can show up in the abi file and thus user can send them + * to this contract, but they have no specific implementation at this contract level, + * they will execute the implementation at the core layer and nothing else. + */ + /** + * New account action is called after a new account is created. This code enforces resource-limits rules + * for new accounts as well as new account naming conventions. + * + * 1. accounts cannot contain '.' symbols which forces all acccounts to be 12 + * characters long without '.' until a future account auction process is implemented + * which prevents name squatting. + * + * 2. new accounts must stake a minimal number of tokens (as set in system parameters) + * therefore, this method will execute an inline buyram from receiver for newacnt in + * an amount equal to the current new account creation fee. + */ + [[eosio::action]] + void newaccount( const name& creator, + const name& name, + ignore owner, + ignore active); + + /** + * Update authorization action updates pemission for an account. + * + * @param account - the account for which the permission is updated + * @param pemission - the permission name which is updated + * @param parem - the parent of the permission which is updated + * @param aut - the json describing the permission authorization + */ + [[eosio::action]] + void updateauth( ignore account, + ignore permission, + ignore parent, + ignore auth ) {} + + /** + * Delete authorization action deletes the authorization for an account's permission. + * + * @param account - the account for which the permission authorization is deleted, + * @param permission - the permission name been deleted. + */ + [[eosio::action]] + void deleteauth( ignore account, + ignore permission ) {} + + /** + * Link authorization action assigns a specific action from a contract to a permission you have created. Five system + * actions can not be linked `updateauth`, `deleteauth`, `linkauth`, `unlinkauth`, and `canceldelay`. + * This is useful because when doing authorization checks, the EOSIO based blockchain starts with the + * action needed to be authorized (and the contract belonging to), and looks up which permission + * is needed to pass authorization validation. If a link is set, that permission is used for authoraization + * validation otherwise then active is the default, with the exception of `eosio.any`. + * `eosio.any` is an implicit permission which exists on every account; you can link actions to `eosio.any` + * and that will make it so linked actions are accessible to any permissions defined for the account. + * + * @param account - the permission's owner to be linked and the payer of the RAM needed to store this link, + * @param code - the owner of the action to be linked, + * @param type - the action to be linked, + * @param requirement - the permission to be linked. + */ + [[eosio::action]] + void linkauth( ignore account, + ignore code, + ignore type, + ignore requirement ) {} + + /** + * Unlink authorization action it's doing the reverse of linkauth action, by unlinking the given action. + * + * @param account - the owner of the permission to be unlinked and the receiver of the freed RAM, + * @param code - the owner of the action to be unlinked, + * @param type - the action to be unlinked. + */ + [[eosio::action]] + void unlinkauth( ignore account, + ignore code, + ignore type ) {} + + /** + * Cancel delay action cancels a deferred transaction. + * + * @param canceling_auth - the permission that authorizes this action, + * @param trx_id - the deferred transaction id to be cancelled. + */ + [[eosio::action]] + void canceldelay( ignore canceling_auth, ignore trx_id ) {} + + /** + * On error action, notification of this action is delivered to the sender of a deferred transaction + * when an objective error occurs while executing the deferred transaction. + * This action is not meant to be called directly. + * + * @param sender_id - the id for the deferred transaction chosen by the sender, + * @param sent_trx - the deferred transaction that failed. + */ + [[eosio::action]] + void onerror( ignore sender_id, ignore> sent_trx ); + + /** + * Set abi action sets the contract abi for an account. + * + * @param account - the account for which to set the contract abi. + * @param abi - the abi content to be set, in the form of a blob binary. + */ + [[eosio::action]] + void setabi( const name& account, const std::vector& abi ); + + /** + * Set code action sets the contract code for an account. + * + * @param account - the account for which to set the contract code. + * @param vmtype - reserved, set it to zero. + * @param vmversion - reserved, set it to zero. + * @param code - the code content to be set, in the form of a blob binary.. + */ + [[eosio::action]] + void setcode( const name& account, uint8_t vmtype, uint8_t vmversion, const std::vector& code ) {} + + using newaccount_action = eosio::action_wrapper<"newaccount"_n, &native::newaccount>; + using updateauth_action = eosio::action_wrapper<"updateauth"_n, &native::updateauth>; + using deleteauth_action = eosio::action_wrapper<"deleteauth"_n, &native::deleteauth>; + using linkauth_action = eosio::action_wrapper<"linkauth"_n, &native::linkauth>; + using unlinkauth_action = eosio::action_wrapper<"unlinkauth"_n, &native::unlinkauth>; + using canceldelay_action = eosio::action_wrapper<"canceldelay"_n, &native::canceldelay>; + using setcode_action = eosio::action_wrapper<"setcode"_n, &native::setcode>; + using setabi_action = eosio::action_wrapper<"setabi"_n, &native::setabi>; + }; +} diff --git a/contracts/eosio.system/include/eosio.system/powerup.results.hpp b/contracts/eosio.system/include/eosio.system/powerup.results.hpp new file mode 100644 index 000000000..716be93a0 --- /dev/null +++ b/contracts/eosio.system/include/eosio.system/powerup.results.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include +#include +#include + +using eosio::action_wrapper; +using eosio::asset; +using eosio::name; + +/** + * The action `powerresult` of `power.results` is a no-op. + * It is added as an inline convenience action to `powerup` reservation. + * This inline convenience action does not have any effect, however, + * its data includes the result of the parent action and appears in its trace. + */ +class [[eosio::contract("powup.results")]] powup_results : eosio::contract { + public: + + using eosio::contract::contract; + + /** + * powupresult action. + * + * @param fee - powerup fee amount + * @param powup_net - amount of powup NET tokens + * @param powup_cpu - amount of powup CPU tokens + */ + [[eosio::action]] + void powupresult( const asset& fee, const int64_t powup_net, const int64_t powup_cpu ); + + using powupresult_action = action_wrapper<"powupresult"_n, &powup_results::powupresult>; +}; diff --git a/contracts/eosio.system/include/eosio.system/rex.results.hpp b/contracts/eosio.system/include/eosio.system/rex.results.hpp new file mode 100644 index 000000000..378d6add3 --- /dev/null +++ b/contracts/eosio.system/include/eosio.system/rex.results.hpp @@ -0,0 +1,59 @@ +#pragma once + +#include +#include +#include + +using eosio::action_wrapper; +using eosio::asset; +using eosio::name; + +/** + * The actions `buyresult`, `sellresult`, `rentresult`, and `orderresult` of `rex.results` are all no-ops. + * They are added as inline convenience actions to `rentnet`, `rentcpu`, `buyrex`, `unstaketorex`, and `sellrex`. + * An inline convenience action does not have any effect, however, + * its data includes the result of the parent action and appears in its trace. + */ +class [[eosio::contract("rex.results")]] rex_results : eosio::contract { + public: + + using eosio::contract::contract; + + /** + * Buyresult action. + * + * @param rex_received - amount of tokens used in buy order + */ + [[eosio::action]] + void buyresult( const asset& rex_received ); + + /** + * Sellresult action. + * + * @param proceeds - amount of tokens used in sell order + */ + [[eosio::action]] + void sellresult( const asset& proceeds ); + + /** + * Orderresult action. + * + * @param owner - the owner of the order + * @param proceeds - amount of tokens used in order + */ + [[eosio::action]] + void orderresult( const name& owner, const asset& proceeds ); + + /** + * Rentresult action. + * + * @param rented_tokens - amount of rented tokens + */ + [[eosio::action]] + void rentresult( const asset& rented_tokens ); + + using buyresult_action = action_wrapper<"buyresult"_n, &rex_results::buyresult>; + using sellresult_action = action_wrapper<"sellresult"_n, &rex_results::sellresult>; + using orderresult_action = action_wrapper<"orderresult"_n, &rex_results::orderresult>; + using rentresult_action = action_wrapper<"rentresult"_n, &rex_results::rentresult>; +}; diff --git a/contracts/eosio.system/ricardian/eosio.system.clauses.md b/contracts/eosio.system/ricardian/eosio.system.clauses.md new file mode 100644 index 000000000..ef5bfc987 --- /dev/null +++ b/contracts/eosio.system/ricardian/eosio.system.clauses.md @@ -0,0 +1,63 @@ +

UserAgreement

+ +User agreement for the chain can go here. + +

BlockProducerAgreement

+ +I, {{producer}}, hereby nominate myself for consideration as an elected block producer. + +If {{producer}} is selected to produce blocks by the system contract, I will sign blocks with my registered block signing keys and I hereby attest that I will keep these keys secret and secure. + +If {{producer}} is unable to perform obligations under this contract I will resign my position using the unregprod action. + +I acknowledge that a block is 'objectively valid' if it conforms to the deterministic blockchain rules in force at the time of its creation, and is 'objectively invalid' if it fails to conform to those rules. + +{{producer}} hereby agrees to only use my registered block signing keys to sign messages under the following scenarios: + +* proposing an objectively valid block at the time appointed by the block scheduling algorithm; +* pre-confirming a block produced by another producer in the schedule when I find said block objectively valid; +* and, confirming a block for which {{producer}} has received pre-confirmation messages from more than two-thirds of the active block producers. + +I hereby accept liability for any and all provable damages that result from my: + +* signing two different block proposals with the same timestamp; +* signing two different block proposals with the same block number; +* signing any block proposal which builds off of an objectively invalid block; +* signing a pre-confirmation for an objectively invalid block; +* or, signing a confirmation for a block for which I do not possess pre-confirmation messages from more than two-thirds of the active block producers. + +I hereby agree that double-signing for a timestamp or block number in concert with two or more other block producers shall automatically be deemed malicious and cause {{producer}} to be subject to: + +* a fine equal to the past year of compensation received, +* immediate disqualification from being a producer, +* and/or other damages. + +An exception may be made if {{producer}} can demonstrate that the double-signing occurred due to a bug in the reference software; the burden of proof is on {{producer}}. + +I hereby agree not to interfere with the producer election process. I agree to process all producer election transactions that occur in blocks I create, to sign all objectively valid blocks I create that contain election transactions, and to sign all pre-confirmations and confirmations necessary to facilitate transfer of control to the next set of producers as determined by the system contract. + +I hereby acknowledge that more than two-thirds of the active block producers may vote to disqualify {{producer}} in the event {{producer}} is unable to produce blocks or is unable to be reached, according to criteria agreed to among block producers. + +If {{producer}} qualifies for and chooses to collect compensation due to votes received, {{producer}} will provide a public endpoint allowing at least 100 peers to maintain synchronization with the blockchain and/or submit transactions to be included. {{producer}} shall maintain at least one validating node with full state and signature checking and shall report any objectively invalid blocks produced by the active block producers. Reporting shall be via a method to be agreed to among block producers, said method and reports to be made public. + +The community agrees to allow {{producer}} to authenticate peers as necessary to prevent abuse and denial of service attacks; however, {{producer}} agrees not to discriminate against non-abusive peers. + +I agree to process transactions on a FIFO (first in, first out) best-effort basis and to honestly bill transactions for measured execution time. + +I {{producer}} agree not to manipulate the contents of blocks in order to derive profit from: the order in which transactions are included, or the hash of the block that is produced. + +I, {{producer}}, hereby agree to disclose and attest under penalty of perjury all ultimate beneficial owners of my business entity who own more than 10% and all direct shareholders. + +I, {{producer}}, hereby agree to cooperate with other block producers to carry out our respective and mutual obligations under this agreement, including but not limited to maintaining network stability and a valid blockchain. + +I, {{producer}}, agree to maintain a website hosted at {{url}} which contains up-to-date information on all disclosures required by this contract. + +I, {{producer}}, agree to set the location value of {{location}} such that {{producer}} is scheduled with minimal latency between my previous and next peer. + +I, {{producer}}, agree to maintain time synchronization within 10 ms of global atomic clock time, using a method agreed to among block producers. + +I, {{producer}}, agree not to produce blocks before my scheduled time unless I have received all blocks produced by the prior block producer. + +I, {{producer}}, agree not to publish blocks with timestamps more than 500ms in the future unless the prior block is more than 75% full by either NET or CPU bandwidth metrics. + +I, {{producer}}, agree not to set the RAM supply to more RAM than my nodes contain and to resign if I am unable to provide the RAM approved by more than two-thirds of active block producers, as shown in the system parameters. diff --git a/contracts/eosio.system/ricardian/eosio.system.contracts.md.in b/contracts/eosio.system/ricardian/eosio.system.contracts.md.in new file mode 100644 index 000000000..9ab33cd88 --- /dev/null +++ b/contracts/eosio.system/ricardian/eosio.system.contracts.md.in @@ -0,0 +1,703 @@ +

activate

+ +--- +spec_version: "0.2.0" +title: Activate Protocol Feature +summary: 'Activate protocol feature {{nowrap feature_digest}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} activates the protocol feature with a digest of {{feature_digest}}. + +

bidname

+ +--- +spec_version: "0.2.0" +title: Bid On a Premium Account Name +summary: '{{nowrap bidder}} bids on the premium account name {{nowrap newname}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{bidder}} bids {{bid}} on an auction to own the premium account name {{newname}}. + +{{bidder}} transfers {{bid}} to the system to cover the cost of the bid, which will be returned to {{bidder}} only if {{bidder}} is later outbid in the auction for {{newname}} by another account. + +If the auction for {{newname}} closes with {{bidder}} remaining as the highest bidder, {{bidder}} will be authorized to create the account with name {{newname}}. + +## Bid refund behavior + +If {{bidder}}’s bid on {{newname}} is later outbid by another account, {{bidder}} will be able to claim back the transferred amount of {{bid}}. The system will attempt to automatically do this on behalf of {{bidder}}, but the automatic refund may occasionally fail which will then require {{bidder}} to manually claim the refund with the bidrefund action. + +## Auction close criteria + +The system should automatically close the auction for {{newname}} if it satisfies the condition that over a period of two minutes the following two properties continuously hold: + +- no one has bid on {{newname}} within the last 24 hours; +- and, the value of the latest bid on {{newname}} is greater than the value of the bids on each of the other open auctions. + +Be aware that the condition to close the auction described above are sufficient but not necessary. The auction for {{newname}} cannot close unless both of the properties are simultaneously satisfied, but it may be closed without requiring the properties to hold for a period of 2 minutes. + +

bidrefund

+ +--- +spec_version: "0.2.0" +title: Claim Refund on Name Bid +summary: 'Claim refund on {{nowrap newname}} bid' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{bidder}} claims refund on {{newname}} bid after being outbid by someone else. + +

buyram

+ +--- +spec_version: "0.2.0" +title: Buy RAM +summary: '{{nowrap payer}} buys RAM on behalf of {{nowrap receiver}} by paying {{nowrap quant}}' +icon: @ICON_BASE_URL@/@RESOURCE_ICON_URI@ +--- + +{{payer}} buys RAM on behalf of {{receiver}} by paying {{quant}}. This transaction will incur a 0.5% fee out of {{quant}} and the amount of RAM delivered will depend on market rates. + +

buyrambytes

+ +--- +spec_version: "0.2.0" +title: Buy RAM +summary: '{{nowrap payer}} buys {{nowrap bytes}} bytes of RAM on behalf of {{nowrap receiver}}' +icon: @ICON_BASE_URL@/@RESOURCE_ICON_URI@ +--- + +{{payer}} buys approximately {{bytes}} bytes of RAM on behalf of {{receiver}} by paying market rates for RAM. This transaction will incur a 0.5% fee and the cost will depend on market rates. + +

buyrex

+ +--- +spec_version: "0.2.0" +title: Buy REX Tokens +summary: '{{nowrap from}} buys REX tokens in exchange for {{nowrap amount}} and their vote stake increases by {{nowrap amount}}' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{amount}} is taken out of {{from}}’s REX fund and used to purchase REX tokens at the current market exchange rate. In order for the action to succeed, {{from}} must have voted for a proxy or at least 21 block producers. {{amount}} is added to {{from}}’s vote stake. + +A sell order of the purchased amount can only be initiated after waiting for the maturity period of 4 to 5 days to pass. Even then, depending on the market conditions, the initiated sell order may not be executed immediately. + +

canceldelay

+ +--- +spec_version: "0.2.0" +title: Cancel Delayed Transaction +summary: '{{nowrap canceling_auth.actor}} cancels a delayed transaction' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{canceling_auth.actor}} cancels the delayed transaction with id {{trx_id}}. + +

claimrewards

+ +--- +spec_version: "0.2.0" +title: Claim Block Producer Rewards +summary: '{{nowrap owner}} claims block and vote rewards' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{owner}} claims block and vote rewards from the system. + +

closerex

+ +--- +spec_version: "0.2.0" +title: Cleanup Unused REX Data +summary: 'Delete REX related DB entries and free associated RAM' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +Delete REX related DB entries and free associated RAM for {{owner}}. + +To fully delete all REX related DB entries, {{owner}} must ensure that their REX balance and REX fund amounts are both zero and they have no outstanding loans. + +

cnclrexorder

+ +--- +spec_version: "0.2.0" +title: Cancel Scheduled REX Sell Order +summary: '{{nowrap owner}} cancels a scheduled sell order if not yet filled' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{owner}} cancels their open sell order. + +

consolidate

+ +--- +spec_version: "0.2.0" +title: Consolidate REX Maturity Buckets Into One +summary: 'Consolidate REX maturity buckets into one' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +Consolidate REX maturity buckets into one bucket that {{owner}} will not be able to sell until 4 to 5 days later. + +

defcpuloan

+ +--- +spec_version: "0.2.0" +title: Withdraw from the Fund of a Specific CPU Loan +summary: '{{nowrap from}} transfers {{nowrap amount}} from the fund of CPU loan number {{nowrap loan_num}} back to REX fund' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{from}} transfers {{amount}} from the fund of CPU loan number {{loan_num}} back to REX fund. + +

defnetloan

+ +--- +spec_version: "0.2.0" +title: Withdraw from the Fund of a Specific NET Loan +summary: '{{nowrap from}} transfers {{nowrap amount}} from the fund of NET loan number {{nowrap loan_num}} back to REX fund' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{from}} transfers {{amount}} from the fund of NET loan number {{loan_num}} back to REX fund. + +

delegatebw

+ +--- +spec_version: "0.2.0" +title: Stake Tokens for NET and/or CPU +summary: 'Stake tokens for NET and/or CPU and optionally transfer ownership' +icon: @ICON_BASE_URL@/@RESOURCE_ICON_URI@ +--- + +{{#if transfer}} {{from}} stakes on behalf of {{receiver}} {{stake_net_quantity}} for NET bandwidth and {{stake_cpu_quantity}} for CPU bandwidth. + +Staked tokens will also be transferred to {{receiver}}. The sum of these two quantities will be deducted from {{from}}’s liquid balance and add to the vote weight of {{receiver}}. +{{else}} +{{from}} stakes to self and delegates to {{receiver}} {{stake_net_quantity}} for NET bandwidth and {{stake_cpu_quantity}} for CPU bandwidth. + +The sum of these two quantities add to the vote weight of {{from}}. +{{/if}} + +

deleteauth

+ +--- +spec_version: "0.2.0" +title: Delete Account Permission +summary: 'Delete the {{nowrap permission}} permission of {{nowrap account}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Delete the {{permission}} permission of {{account}}. + +

deposit

+ +--- +spec_version: "0.2.0" +title: Deposit Into REX Fund +summary: 'Add to {{nowrap owner}}’s REX fund by transferring {{nowrap amount}} from {{nowrap owner}}’s liquid balance' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +Transfer {{amount}} from {{owner}}’s liquid balance to {{owner}}’s REX fund. All proceeds and expenses related to REX are added to or taken out of this fund. + +

fundcpuloan

+ +--- +spec_version: "0.2.0" +title: Deposit into the Fund of a Specific CPU Loan +summary: '{{nowrap from}} funds a CPU loan' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{from}} transfers {{payment}} from REX fund to the fund of CPU loan number {{loan_num}} in order to be used in loan renewal at expiry. {{from}} can withdraw the total balance of the loan fund at any time. + +

fundnetloan

+ +--- +spec_version: "0.2.0" +title: Deposit into the Fund of a Specific NET Loan +summary: '{{nowrap from}} funds a NET loan' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{from}} transfers {{payment}} from REX fund to the fund of NET loan number {{loan_num}} in order to be used in loan renewal at expiry. {{from}} can withdraw the total balance of the loan fund at any time. + +

init

+ +--- +spec_version: "0.2.0" +title: Initialize System Contract +summary: 'Initialize system contract' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +Initialize system contract. The core token symbol will be set to {{core}}. + +

linkauth

+ +--- +spec_version: "0.2.0" +title: Link Action to Permission +summary: '{{nowrap account}} sets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract to {{nowrap requirement}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{account}} sets the minimum required permission for the {{#if type}}{{type}} action of the{{/if}} {{code}} contract to {{requirement}}. + +{{#if type}}{{else}}Any links explicitly associated to specific actions of {{code}} will take precedence.{{/if}} + +

newaccount

+ +--- +spec_version: "0.2.0" +title: Create New Account +summary: '{{nowrap creator}} creates a new account with the name {{nowrap name}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{creator}} creates a new account with the name {{name}} and the following permissions: + +owner permission with authority: +{{to_json owner}} + +active permission with authority: +{{to_json active}} + +

mvfrsavings

+ +--- +spec_version: "0.2.0" +title: Unlock REX Tokens +summary: '{{nowrap owner}} unlocks REX Tokens' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{owner}} unlocks {{rex}} by moving it out of the REX savings bucket. The unlocked REX tokens cannot be sold until 4 to 5 days later. + +

mvtosavings

+ +--- +spec_version: "0.2.0" +title: Lock REX Tokens +summary: '{{nowrap owner}} locks REX Tokens' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{owner}} locks {{rex}} by moving it into the REX savings bucket. The locked REX tokens cannot be sold directly and will have to be unlocked explicitly before selling. + +

refund

+ +--- +spec_version: "0.2.0" +title: Claim Unstaked Tokens +summary: 'Return previously unstaked tokens to {{nowrap owner}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Return previously unstaked tokens to {{owner}} after the unstaking period has elapsed. + +

regproducer

+ +--- +spec_version: "0.2.0" +title: Register as a Block Producer Candidate +summary: 'Register {{nowrap producer}} account as a block producer candidate' +icon: @ICON_BASE_URL@/@VOTING_ICON_URI@ +--- + +Register {{producer}} account as a block producer candidate. + +URL: {{url}} +Location code: {{location}} +Block signing key: {{producer_key}} + +## Block Producer Agreement +{{$clauses.BlockProducerAgreement}} + +

regproducer2

+ +--- +spec_version: "0.2.0" +title: Register as a Block Producer Candidate +summary: 'Register {{nowrap producer}} account as a block producer candidate' +icon: @ICON_BASE_URL@/@VOTING_ICON_URI@ +--- + +Register {{producer}} account as a block producer candidate. + +URL: {{url}} +Location code: {{location}} +Block signing authority: +{{to_json producer_authority}} + +## Block Producer Agreement +{{$clauses.BlockProducerAgreement}} + +

regproxy

+ +--- +spec_version: "0.2.0" +title: Register/unregister as a Proxy +summary: 'Register/unregister {{nowrap proxy}} as a proxy account' +icon: @ICON_BASE_URL@/@VOTING_ICON_URI@ +--- + +{{#if isproxy}} +{{proxy}} registers as a proxy that can vote on behalf of accounts that appoint it as their proxy. +{{else}} +{{proxy}} unregisters as a proxy that can vote on behalf of accounts that appoint it as their proxy. +{{/if}} + +

rentcpu

+ +--- +spec_version: "0.2.0" +title: Rent CPU Bandwidth for 30 Days +summary: '{{nowrap from}} pays {{nowrap loan_payment}} to rent CPU bandwidth for {{nowrap receiver}}' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{from}} pays {{loan_payment}} to rent CPU bandwidth on behalf of {{receiver}} for a period of 30 days. + +{{loan_payment}} is taken out of {{from}}’s REX fund. The market price determines the number of tokens to be staked to {{receiver}}’s CPU resources. In addition, {{from}} provides {{loan_fund}}, which is also taken out of {{from}}’s REX fund, to be used for automatic renewal of the loan. + +At expiration, if the loan has less funds than {{loan_payment}}, it is closed and lent tokens that have been staked are taken out of {{receiver}}’s CPU bandwidth. Otherwise, it is renewed at the market price at the time of renewal, that is, the number of staked tokens is recalculated and {{receiver}}’s CPU bandwidth is updated accordingly. {{from}} can fund or defund a loan at any time before expiration. When the loan is closed, {{from}} is refunded any tokens remaining in the loan fund. + +

rentnet

+ +--- +spec_version: "0.2.0" +title: Rent NET Bandwidth for 30 Days +summary: '{{nowrap from}} pays {{nowrap loan_payment}} to rent NET bandwidth for {{nowrap receiver}}' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{from}} pays {{loan_payment}} to rent NET bandwidth on behalf of {{receiver}} for a period of 30 days. + +{{loan_payment}} is taken out of {{from}}’s REX fund. The market price determines the number of tokens to be staked to {{receiver}}’s NET resources for 30 days. In addition, {{from}} provides {{loan_fund}}, which is also taken out of {{from}}’s REX fund, to be used for automatic renewal of the loan. + +At expiration, if the loan has less funds than {{loan_payment}}, it is closed and lent tokens that have been staked are taken out of {{receiver}}’s NET bandwidth. Otherwise, it is renewed at the market price at the time of renewal, that is, the number of staked tokens is recalculated and {{receiver}}’s NET bandwidth is updated accordingly. {{from}} can fund or defund a loan at any time before expiration. When the loan is closed, {{from}} is refunded any tokens remaining in the loan fund. + +

rexexec

+ +--- +spec_version: "0.2.0" +title: Perform REX Maintenance +summary: 'Process sell orders and expired loans' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +Performs REX maintenance by processing a maximum of {{max}} REX sell orders and expired loans. Any account can execute this action. + +

rmvproducer

+ +--- +spec_version: "0.2.0" +title: Forcibly Unregister a Block Producer Candidate +summary: '{{nowrap producer}} is unregistered as a block producer candidate' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} unregisters {{producer}} as a block producer candidate. {{producer}} account will retain its votes and those votes can change based on voter stake changes or votes removed from {{producer}}. However new voters will not be able to vote for {{producer}} while it remains unregistered. + +

sellram

+ +--- +spec_version: "0.2.0" +title: Sell RAM From Account +summary: 'Sell unused RAM from {{nowrap account}}' +icon: @ICON_BASE_URL@/@RESOURCE_ICON_URI@ +--- + +Sell {{bytes}} bytes of unused RAM from account {{account}} at market price. This transaction will incur a 0.5% fee on the proceeds which depend on market rates. + +

sellrex

+ +--- +spec_version: "0.2.0" +title: Sell REX Tokens in Exchange for EOS +summary: '{{nowrap from}} sells {{nowrap rex}} tokens' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{from}} initiates a sell order to sell {{rex}} tokens at the market exchange rate during the time at which the order is ultimately executed. If {{from}} already has an open sell order in the sell queue, {{rex}} will be added to the amount of the sell order without change the position of the sell order within the queue. Once the sell order is executed, proceeds are added to {{from}}’s REX fund, the value of sold REX tokens is deducted from {{from}}’s vote stake, and votes are updated accordingly. + +Depending on the market conditions, it may not be possible to fill the entire sell order immediately. In such a case, the sell order is added to the back of a sell queue. A sell order at the front of the sell queue will automatically be executed when the market conditions allow for the entire order to be filled. Regardless of the market conditions, the system is designed to execute this sell order within 30 days. {{from}} can cancel the order at any time before it is filled using the cnclrexorder action. + +

setabi

+ +--- +spec_version: "0.2.0" +title: Deploy Contract ABI +summary: 'Deploy contract ABI on account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Deploy the ABI file associated with the contract on account {{account}}. + +

setacctcpu

+ +--- +spec_version: "0.2.0" +title: Explicitly Manage the CPU Quota of Account +summary: 'Explicitly manage the CPU bandwidth quota of account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{#if_has_value cpu_weight}} +Explicitly manage the CPU bandwidth quota of account {{account}} by pinning it to a weight of {{cpu_weight}}. + +{{account}} can stake and unstake, however, it will not change their CPU bandwidth quota as long as it remains pinned. +{{else}} +Unpin the CPU bandwidth quota of account {{account}}. The CPU bandwidth quota of {{account}} will be driven by the current tokens staked for CPU bandwidth by {{account}}. +{{/if_has_value}} + +

setacctnet

+ +--- +spec_version: "0.2.0" +title: Explicitly Manage the NET Quota of Account +summary: 'Explicitly manage the NET bandwidth quota of account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{#if_has_value net_weight}} +Explicitly manage the network bandwidth quota of account {{account}} by pinning it to a weight of {{net_weight}}. + +{{account}} can stake and unstake, however, it will not change their NET bandwidth quota as long as it remains pinned. +{{else}} +Unpin the NET bandwidth quota of account {{account}}. The NET bandwidth quota of {{account}} will be driven by the current tokens staked for NET bandwidth by {{account}}. +{{/if_has_value}} + +

setacctram

+ +--- +spec_version: "0.2.0" +title: Explicitly Manage the RAM Quota of Account +summary: 'Explicitly manage the RAM quota of account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{#if_has_value ram_bytes}} +Explicitly manage the RAM quota of account {{account}} by pinning it to {{ram_bytes}} bytes. + +{{account}} can buy and sell RAM, however, it will not change their RAM quota as long as it remains pinned. +{{else}} +Unpin the RAM quota of account {{account}}. The RAM quota of {{account}} will be driven by the current RAM holdings of {{account}}. +{{/if_has_value}} + +

setalimits

+ +--- +spec_version: "0.2.0" +title: Adjust Resource Limits of Account +summary: 'Adjust resource limits of account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} updates {{account}}’s resource limits to have a RAM quota of {{ram_bytes}} bytes, a NET bandwidth quota of {{net_weight}} and a CPU bandwidth quota of {{cpu_weight}}. + +

setcode

+ +--- +spec_version: "0.2.0" +title: Deploy Contract Code +summary: 'Deploy contract code on account {{nowrap account}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Deploy compiled contract code to the account {{account}}. + +

setparams

+ +--- +spec_version: "0.2.0" +title: Set System Parameters +summary: 'Set System Parameters' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} sets system parameters to: +{{to_json params}} + +

setpriv

+ +--- +spec_version: "0.2.0" +title: Make an Account Privileged or Unprivileged +summary: '{{#if is_priv}}Make {{nowrap account}} privileged{{else}}Remove privileged status of {{nowrap account}}{{/if}}' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{#if is_priv}} +{{$action.account}} makes {{account}} privileged. +{{else}} +{{$action.account}} removes privileged status of {{account}}. +{{/if}} + +

setram

+ +--- +spec_version: "0.2.0" +title: Configure the Available RAM +summary: 'Configure the available RAM' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} configures the available RAM to {{max_ram_size}} bytes. + +

setramrate

+ +--- +spec_version: "0.2.0" +title: Set the Rate of Increase of RAM +summary: 'Set the rate of increase of RAM per block' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} sets the rate of increase of RAM to {{bytes_per_block}} bytes/block. + +

setrex

+ +--- +spec_version: "0.2.0" +title: Adjust REX Pool Virtual Balance +summary: 'Adjust REX Pool Virtual Balance' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} adjusts REX loan rate by setting REX pool virtual balance to {{balance}}. No token transfer or issue is executed in this action. + +

setinflation

+ +--- +spec_version: "0.2.0" +title: Set Inflation Parameters +summary: 'Set inflation parameters' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} sets the inflation parameters as follows: + +* Annual inflation rate (in units of a hundredth of a percent): {{annual_rate}} +* Fraction of inflation used to reward block producers: 10000/{{inflation_pay_factor}} +* Fraction of block producer rewards to be distributed proportional to blocks produced: 10000/{{votepay_factor}} + +

undelegatebw

+ +--- +spec_version: "0.2.0" +title: Unstake Tokens for NET and/or CPU +summary: 'Unstake tokens for NET and/or CPU from {{nowrap receiver}}' +icon: @ICON_BASE_URL@/@RESOURCE_ICON_URI@ +--- + +{{from}} unstakes from {{receiver}} {{unstake_net_quantity}} for NET bandwidth and {{unstake_cpu_quantity}} for CPU bandwidth. + +The sum of these two quantities will be removed from the vote weight of {{receiver}} and will be made available to {{from}} after an uninterrupted 3 day period without further unstaking by {{from}}. After the uninterrupted 3 day period passes, the system will attempt to automatically return the funds to {{from}}’s regular token balance. However, this automatic refund may occasionally fail which will then require {{from}} to manually claim the funds with the refund action. + +

unlinkauth

+ +--- +spec_version: "0.2.0" +title: Unlink Action from Permission +summary: '{{nowrap account}} unsets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +{{account}} removes the association between the {{#if type}}{{type}} action of the{{/if}} {{code}} contract and its minimum required permission. + +{{#if type}}{{else}}This will not remove any links explicitly associated to specific actions of {{code}}.{{/if}} + +

unregprod

+ +--- +spec_version: "0.2.0" +title: Unregister as a Block Producer Candidate +summary: '{{nowrap producer}} unregisters as a block producer candidate' +icon: @ICON_BASE_URL@/@VOTING_ICON_URI@ +--- + +{{producer}} unregisters as a block producer candidate. {{producer}} account will retain its votes and those votes can change based on voter stake changes or votes removed from {{producer}}. However new voters will not be able to vote for {{producer}} while it remains unregistered. + +

unstaketorex

+ +--- +spec_version: "0.2.0" +title: Buy REX Tokens Using Staked Tokens +summary: '{{nowrap owner}} buys REX tokens in exchange for tokens currently staked to NET and/or CPU' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +{{from_net}} and {{from_cpu}} are withdrawn from {{receiver}}’s NET and CPU bandwidths respectively. These funds are used to purchase REX tokens at the current market exchange rate. In order for the action to succeed, {{owner}} must have voted for a proxy or at least 21 block producers. + +A sell order of the purchased amount can only be initiated after waiting for the maturity period of 4 to 5 days to pass. Even then, depending on the market conditions, the initiated sell order may not be executed immediately. + +

updateauth

+ +--- +spec_version: "0.2.0" +title: Modify Account Permission +summary: 'Add or update the {{nowrap permission}} permission of {{nowrap account}}' +icon: @ICON_BASE_URL@/@ACCOUNT_ICON_URI@ +--- + +Modify, and create if necessary, the {{permission}} permission of {{account}} to have a parent permission of {{parent}} and the following authority: +{{to_json auth}} + +

updaterex

+ +--- +spec_version: "0.2.0" +title: Update REX Owner Vote Weight +summary: 'Update vote weight to current value of held REX tokens' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +Update vote weight of {{owner}} account to current value of held REX tokens. + +

updtrevision

+ +--- +spec_version: "0.2.0" +title: Update System Contract Revision Number +summary: 'Update system contract revision number' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{$action.account}} advances the system contract revision number to {{revision}}. + +

voteproducer

+ +--- +spec_version: "0.2.0" +title: Vote for Block Producers +summary: '{{nowrap voter}} votes for {{#if proxy}}the proxy {{nowrap proxy}}{{else}}up to 30 block producer candidates{{/if}}' +icon: @ICON_BASE_URL@/@VOTING_ICON_URI@ +--- + +{{#if proxy}} +{{voter}} votes for the proxy {{proxy}}. +At the time of voting the full weight of voter’s staked (CPU + NET) tokens will be cast towards each of the producers voted by {{proxy}}. +{{else}} +{{voter}} votes for the following block producer candidates: + +{{#each producers}} + + {{this}} +{{/each}} + +At the time of voting the full weight of voter’s staked (CPU + NET) tokens will be cast towards each of the above producers. +{{/if}} + +

withdraw

+ +--- +spec_version: "0.2.0" +title: Withdraw from REX Fund +summary: 'Withdraw {{nowrap amount}} from {{nowrap owner}}’s REX fund by transferring to {{owner}}’s liquid balance' +icon: @ICON_BASE_URL@/@REX_ICON_URI@ +--- + +Withdraws {{amount}} from {{owner}}’s REX fund and transfer them to {{owner}}’s liquid balance. diff --git a/contracts/eosio.system/src/delegate_bandwidth.cpp b/contracts/eosio.system/src/delegate_bandwidth.cpp new file mode 100644 index 000000000..a64506c01 --- /dev/null +++ b/contracts/eosio.system/src/delegate_bandwidth.cpp @@ -0,0 +1,413 @@ +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace eosiosystem { + + using eosio::asset; + using eosio::const_mem_fun; + using eosio::current_time_point; + using eosio::indexed_by; + using eosio::permission_level; + using eosio::seconds; + using eosio::time_point_sec; + using eosio::token; + + /** + * This action will buy an exact amount of ram and bill the payer the current market price. + */ + void system_contract::buyrambytes( const name& payer, const name& receiver, uint32_t bytes ) { + auto itr = _rammarket.find(ramcore_symbol.raw()); + const int64_t ram_reserve = itr->base.balance.amount; + const int64_t eos_reserve = itr->quote.balance.amount; + const int64_t cost = exchange_state::get_bancor_input( ram_reserve, eos_reserve, bytes ); + const int64_t cost_plus_fee = cost / double(0.995); + buyram( payer, receiver, asset{ cost_plus_fee, core_symbol() } ); + } + + + /** + * When buying ram the payer irreversiblly transfers quant to system contract and only + * the receiver may reclaim the tokens via the sellram action. The receiver pays for the + * storage of all database records associated with this action. + * + * RAM is a scarce resource whose supply is defined by global properties max_ram_size. RAM is + * priced using the bancor algorithm such that price-per-byte with a constant reserve ratio of 100:1. + */ + void system_contract::buyram( const name& payer, const name& receiver, const asset& quant ) + { + require_auth( payer ); + update_ram_supply(); + + check( quant.symbol == core_symbol(), "must buy ram with core token" ); + check( quant.amount > 0, "must purchase a positive amount" ); + + auto fee = quant; + fee.amount = ( fee.amount + 199 ) / 200; /// .5% fee (round up) + // fee.amount cannot be 0 since that is only possible if quant.amount is 0 which is not allowed by the assert above. + // If quant.amount == 1, then fee.amount == 1, + // otherwise if quant.amount > 1, then 0 < fee.amount < quant.amount. + auto quant_after_fee = quant; + quant_after_fee.amount -= fee.amount; + // quant_after_fee.amount should be > 0 if quant.amount > 1. + // If quant.amount == 1, then quant_after_fee.amount == 0 and the next inline transfer will fail causing the buyram action to fail. + { + token::transfer_action transfer_act{ token_account, { {payer, active_permission}, {ram_account, active_permission} } }; + transfer_act.send( payer, ram_account, quant_after_fee, "buy ram" ); + } + if ( fee.amount > 0 ) { + token::transfer_action transfer_act{ token_account, { {payer, active_permission} } }; + transfer_act.send( payer, ramfee_account, fee, "ram fee" ); + channel_to_rex( ramfee_account, fee ); + } + + int64_t bytes_out; + + const auto& market = _rammarket.get(ramcore_symbol.raw(), "ram market does not exist"); + _rammarket.modify( market, same_payer, [&]( auto& es ) { + bytes_out = es.direct_convert( quant_after_fee, ram_symbol ).amount; + }); + + check( bytes_out > 0, "must reserve a positive amount" ); + + _gstate.total_ram_bytes_reserved += uint64_t(bytes_out); + _gstate.total_ram_stake += quant_after_fee.amount; + + user_resources_table userres( get_self(), receiver.value ); + auto res_itr = userres.find( receiver.value ); + if( res_itr == userres.end() ) { + res_itr = userres.emplace( receiver, [&]( auto& res ) { + res.owner = receiver; + res.net_weight = asset( 0, core_symbol() ); + res.cpu_weight = asset( 0, core_symbol() ); + res.ram_bytes = bytes_out; + }); + } else { + userres.modify( res_itr, receiver, [&]( auto& res ) { + res.ram_bytes += bytes_out; + }); + } + + auto voter_itr = _voters.find( res_itr->owner.value ); + if( voter_itr == _voters.end() || !has_field( voter_itr->flags1, voter_info::flags1_fields::ram_managed ) ) { + int64_t ram_bytes, net, cpu; + get_resource_limits( res_itr->owner, ram_bytes, net, cpu ); + set_resource_limits( res_itr->owner, res_itr->ram_bytes + ram_gift_bytes, net, cpu ); + } + } + + /** + * The system contract now buys and sells RAM allocations at prevailing market prices. + * This may result in traders buying RAM today in anticipation of potential shortages + * tomorrow. Overall this will result in the market balancing the supply and demand + * for RAM over time. + */ + void system_contract::sellram( const name& account, int64_t bytes ) { + require_auth( account ); + update_ram_supply(); + + check( bytes > 0, "cannot sell negative byte" ); + + user_resources_table userres( get_self(), account.value ); + auto res_itr = userres.find( account.value ); + check( res_itr != userres.end(), "no resource row" ); + check( res_itr->ram_bytes >= bytes, "insufficient quota" ); + + asset tokens_out; + auto itr = _rammarket.find(ramcore_symbol.raw()); + _rammarket.modify( itr, same_payer, [&]( auto& es ) { + /// the cast to int64_t of bytes is safe because we certify bytes is <= quota which is limited by prior purchases + tokens_out = es.direct_convert( asset(bytes, ram_symbol), core_symbol()); + }); + + check( tokens_out.amount > 1, "token amount received from selling ram is too low" ); + + _gstate.total_ram_bytes_reserved -= static_cast(bytes); // bytes > 0 is asserted above + _gstate.total_ram_stake -= tokens_out.amount; + + //// this shouldn't happen, but just in case it does we should prevent it + check( _gstate.total_ram_stake >= 0, "error, attempt to unstake more tokens than previously staked" ); + + userres.modify( res_itr, account, [&]( auto& res ) { + res.ram_bytes -= bytes; + }); + + auto voter_itr = _voters.find( res_itr->owner.value ); + if( voter_itr == _voters.end() || !has_field( voter_itr->flags1, voter_info::flags1_fields::ram_managed ) ) { + int64_t ram_bytes, net, cpu; + get_resource_limits( res_itr->owner, ram_bytes, net, cpu ); + set_resource_limits( res_itr->owner, res_itr->ram_bytes + ram_gift_bytes, net, cpu ); + } + + { + token::transfer_action transfer_act{ token_account, { {ram_account, active_permission}, {account, active_permission} } }; + transfer_act.send( ram_account, account, asset(tokens_out), "sell ram" ); + } + auto fee = ( tokens_out.amount + 199 ) / 200; /// .5% fee (round up) + // since tokens_out.amount was asserted to be at least 2 earlier, fee.amount < tokens_out.amount + if ( fee > 0 ) { + token::transfer_action transfer_act{ token_account, { {account, active_permission} } }; + transfer_act.send( account, ramfee_account, asset(fee, core_symbol()), "sell ram fee" ); + channel_to_rex( ramfee_account, asset(fee, core_symbol() )); + } + } + + void validate_b1_vesting( int64_t stake ) { + const int64_t base_time = 1527811200; /// 2018-06-01 + const int64_t max_claimable = 100'000'000'0000ll; + const int64_t claimable = int64_t(max_claimable * double(current_time_point().sec_since_epoch() - base_time) / (10*seconds_per_year) ); + + check( max_claimable - claimable <= stake, "b1 can only claim their tokens over 10 years" ); + } + + void system_contract::changebw( name from, const name& receiver, + const asset& stake_net_delta, const asset& stake_cpu_delta, bool transfer ) + { + require_auth( from ); + check( stake_net_delta.amount != 0 || stake_cpu_delta.amount != 0, "should stake non-zero amount" ); + check( std::abs( (stake_net_delta + stake_cpu_delta).amount ) + >= std::max( std::abs( stake_net_delta.amount ), std::abs( stake_cpu_delta.amount ) ), + "net and cpu deltas cannot be opposite signs" ); + + name source_stake_from = from; + if ( transfer ) { + from = receiver; + } + + // update stake delegated from "from" to "receiver" + { + del_bandwidth_table del_tbl( get_self(), from.value ); + auto itr = del_tbl.find( receiver.value ); + if( itr == del_tbl.end() ) { + itr = del_tbl.emplace( from, [&]( auto& dbo ){ + dbo.from = from; + dbo.to = receiver; + dbo.net_weight = stake_net_delta; + dbo.cpu_weight = stake_cpu_delta; + }); + } + else { + del_tbl.modify( itr, same_payer, [&]( auto& dbo ){ + dbo.net_weight += stake_net_delta; + dbo.cpu_weight += stake_cpu_delta; + }); + } + check( 0 <= itr->net_weight.amount, "insufficient staked net bandwidth" ); + check( 0 <= itr->cpu_weight.amount, "insufficient staked cpu bandwidth" ); + if ( itr->is_empty() ) { + del_tbl.erase( itr ); + } + } // itr can be invalid, should go out of scope + + // update totals of "receiver" + { + user_resources_table totals_tbl( get_self(), receiver.value ); + auto tot_itr = totals_tbl.find( receiver.value ); + if( tot_itr == totals_tbl.end() ) { + tot_itr = totals_tbl.emplace( from, [&]( auto& tot ) { + tot.owner = receiver; + tot.net_weight = stake_net_delta; + tot.cpu_weight = stake_cpu_delta; + }); + } else { + totals_tbl.modify( tot_itr, from == receiver ? from : same_payer, [&]( auto& tot ) { + tot.net_weight += stake_net_delta; + tot.cpu_weight += stake_cpu_delta; + }); + } + check( 0 <= tot_itr->net_weight.amount, "insufficient staked total net bandwidth" ); + check( 0 <= tot_itr->cpu_weight.amount, "insufficient staked total cpu bandwidth" ); + + { + bool ram_managed = false; + bool net_managed = false; + bool cpu_managed = false; + + auto voter_itr = _voters.find( receiver.value ); + if( voter_itr != _voters.end() ) { + ram_managed = has_field( voter_itr->flags1, voter_info::flags1_fields::ram_managed ); + net_managed = has_field( voter_itr->flags1, voter_info::flags1_fields::net_managed ); + cpu_managed = has_field( voter_itr->flags1, voter_info::flags1_fields::cpu_managed ); + } + + if( !(net_managed && cpu_managed) ) { + int64_t ram_bytes, net, cpu; + get_resource_limits( receiver, ram_bytes, net, cpu ); + + set_resource_limits( receiver, + ram_managed ? ram_bytes : std::max( tot_itr->ram_bytes + ram_gift_bytes, ram_bytes ), + net_managed ? net : tot_itr->net_weight.amount, + cpu_managed ? cpu : tot_itr->cpu_weight.amount ); + } + } + + if ( tot_itr->is_empty() ) { + totals_tbl.erase( tot_itr ); + } + } // tot_itr can be invalid, should go out of scope + + // create refund or update from existing refund + if ( stake_account != source_stake_from ) { //for eosio both transfer and refund make no sense + refunds_table refunds_tbl( get_self(), from.value ); + auto req = refunds_tbl.find( from.value ); + + //create/update/delete refund + auto net_balance = stake_net_delta; + auto cpu_balance = stake_cpu_delta; + bool need_deferred_trx = false; + + + // net and cpu are same sign by assertions in delegatebw and undelegatebw + // redundant assertion also at start of changebw to protect against misuse of changebw + bool is_undelegating = (net_balance.amount + cpu_balance.amount ) < 0; + bool is_delegating_to_self = (!transfer && from == receiver); + + if( is_delegating_to_self || is_undelegating ) { + if ( req != refunds_tbl.end() ) { //need to update refund + refunds_tbl.modify( req, same_payer, [&]( refund_request& r ) { + if ( net_balance.amount < 0 || cpu_balance.amount < 0 ) { + r.request_time = current_time_point(); + } + r.net_amount -= net_balance; + if ( r.net_amount.amount < 0 ) { + net_balance = -r.net_amount; + r.net_amount.amount = 0; + } else { + net_balance.amount = 0; + } + r.cpu_amount -= cpu_balance; + if ( r.cpu_amount.amount < 0 ){ + cpu_balance = -r.cpu_amount; + r.cpu_amount.amount = 0; + } else { + cpu_balance.amount = 0; + } + }); + + check( 0 <= req->net_amount.amount, "negative net refund amount" ); //should never happen + check( 0 <= req->cpu_amount.amount, "negative cpu refund amount" ); //should never happen + + if ( req->is_empty() ) { + refunds_tbl.erase( req ); + need_deferred_trx = false; + } else { + need_deferred_trx = true; + } + } else if ( net_balance.amount < 0 || cpu_balance.amount < 0 ) { //need to create refund + refunds_tbl.emplace( from, [&]( refund_request& r ) { + r.owner = from; + if ( net_balance.amount < 0 ) { + r.net_amount = -net_balance; + net_balance.amount = 0; + } else { + r.net_amount = asset( 0, core_symbol() ); + } + if ( cpu_balance.amount < 0 ) { + r.cpu_amount = -cpu_balance; + cpu_balance.amount = 0; + } else { + r.cpu_amount = asset( 0, core_symbol() ); + } + r.request_time = current_time_point(); + }); + need_deferred_trx = true; + } // else stake increase requested with no existing row in refunds_tbl -> nothing to do with refunds_tbl + } /// end if is_delegating_to_self || is_undelegating + + if ( need_deferred_trx ) { + eosio::transaction out; + out.actions.emplace_back( permission_level{from, active_permission}, + get_self(), "refund"_n, + from + ); + out.delay_sec = refund_delay_sec; + eosio::cancel_deferred( from.value ); // TODO: Remove this line when replacing deferred trxs is fixed + out.send( from.value, from, true ); + } else { + eosio::cancel_deferred( from.value ); + } + + auto transfer_amount = net_balance + cpu_balance; + if ( 0 < transfer_amount.amount ) { + token::transfer_action transfer_act{ token_account, { {source_stake_from, active_permission} } }; + transfer_act.send( source_stake_from, stake_account, asset(transfer_amount), "stake bandwidth" ); + } + } + + vote_stake_updater( from ); + update_voting_power( from, stake_net_delta + stake_cpu_delta ); + } + + void system_contract::update_voting_power( const name& voter, const asset& total_update ) + { + auto voter_itr = _voters.find( voter.value ); + if( voter_itr == _voters.end() ) { + voter_itr = _voters.emplace( voter, [&]( auto& v ) { + v.owner = voter; + v.staked = total_update.amount; + }); + } else { + _voters.modify( voter_itr, same_payer, [&]( auto& v ) { + v.staked += total_update.amount; + }); + } + + check( 0 <= voter_itr->staked, "stake for voting cannot be negative" ); + + if( voter == "b1"_n ) { + validate_b1_vesting( voter_itr->staked ); + } + + if( voter_itr->producers.size() || voter_itr->proxy ) { + update_votes( voter, voter_itr->proxy, voter_itr->producers, false ); + } + } + + void system_contract::delegatebw( const name& from, const name& receiver, + const asset& stake_net_quantity, + const asset& stake_cpu_quantity, bool transfer ) + { + asset zero_asset( 0, core_symbol() ); + check( stake_cpu_quantity >= zero_asset, "must stake a positive amount" ); + check( stake_net_quantity >= zero_asset, "must stake a positive amount" ); + check( stake_net_quantity.amount + stake_cpu_quantity.amount > 0, "must stake a positive amount" ); + check( !transfer || from != receiver, "cannot use transfer flag if delegating to self" ); + + changebw( from, receiver, stake_net_quantity, stake_cpu_quantity, transfer); + } // delegatebw + + void system_contract::undelegatebw( const name& from, const name& receiver, + const asset& unstake_net_quantity, const asset& unstake_cpu_quantity ) + { + asset zero_asset( 0, core_symbol() ); + check( unstake_cpu_quantity >= zero_asset, "must unstake a positive amount" ); + check( unstake_net_quantity >= zero_asset, "must unstake a positive amount" ); + check( unstake_cpu_quantity.amount + unstake_net_quantity.amount > 0, "must unstake a positive amount" ); + check( _gstate.thresh_activated_stake_time != time_point(), + "cannot undelegate bandwidth until the chain is activated (at least 15% of all tokens participate in voting)" ); + + changebw( from, receiver, -unstake_net_quantity, -unstake_cpu_quantity, false); + } // undelegatebw + + + void system_contract::refund( const name& owner ) { + require_auth( owner ); + + refunds_table refunds_tbl( get_self(), owner.value ); + auto req = refunds_tbl.find( owner.value ); + check( req != refunds_tbl.end(), "refund request not found" ); + check( req->request_time + seconds(refund_delay_sec) <= current_time_point(), + "refund is not available yet" ); + token::transfer_action transfer_act{ token_account, { {stake_account, active_permission}, {req->owner, active_permission} } }; + transfer_act.send( stake_account, req->owner, req->net_amount + req->cpu_amount, "unstake" ); + refunds_tbl.erase( req ); + } + + +} //namespace eosiosystem diff --git a/contracts/eosio.system/src/eosio.system.cpp b/contracts/eosio.system/src/eosio.system.cpp new file mode 100644 index 000000000..202210c7d --- /dev/null +++ b/contracts/eosio.system/src/eosio.system.cpp @@ -0,0 +1,400 @@ +#include +#include + +#include +#include + +#include + +namespace eosiosystem { + + using eosio::current_time_point; + using eosio::token; + + double get_continuous_rate(int64_t annual_rate) { + return std::log1p(double(annual_rate)/double(100*inflation_precision)); + } + + system_contract::system_contract( name s, name code, datastream ds ) + :native(s,code,ds), + _voters(get_self(), get_self().value), + _producers(get_self(), get_self().value), + _producers2(get_self(), get_self().value), + _global(get_self(), get_self().value), + _global2(get_self(), get_self().value), + _global3(get_self(), get_self().value), + _global4(get_self(), get_self().value), + _rammarket(get_self(), get_self().value), + _rexpool(get_self(), get_self().value), + _rexretpool(get_self(), get_self().value), + _rexretbuckets(get_self(), get_self().value), + _rexfunds(get_self(), get_self().value), + _rexbalance(get_self(), get_self().value), + _rexorders(get_self(), get_self().value) + { + _gstate = _global.exists() ? _global.get() : get_default_parameters(); + _gstate2 = _global2.exists() ? _global2.get() : eosio_global_state2{}; + _gstate3 = _global3.exists() ? _global3.get() : eosio_global_state3{}; + _gstate4 = _global4.exists() ? _global4.get() : get_default_inflation_parameters(); + } + + eosio_global_state system_contract::get_default_parameters() { + eosio_global_state dp; + get_blockchain_parameters(dp); + return dp; + } + + eosio_global_state4 system_contract::get_default_inflation_parameters() { + eosio_global_state4 gs4; + gs4.continuous_rate = get_continuous_rate(default_annual_rate); + gs4.inflation_pay_factor = default_inflation_pay_factor; + gs4.votepay_factor = default_votepay_factor; + return gs4; + } + + symbol system_contract::core_symbol()const { + const static auto sym = get_core_symbol( _rammarket ); + return sym; + } + + system_contract::~system_contract() { + _global.set( _gstate, get_self() ); + _global2.set( _gstate2, get_self() ); + _global3.set( _gstate3, get_self() ); + _global4.set( _gstate4, get_self() ); + } + + void system_contract::setram( uint64_t max_ram_size ) { + require_auth( get_self() ); + + check( _gstate.max_ram_size < max_ram_size, "ram may only be increased" ); /// decreasing ram might result market maker issues + check( max_ram_size < 1024ll*1024*1024*1024*1024, "ram size is unrealistic" ); + check( max_ram_size > _gstate.total_ram_bytes_reserved, "attempt to set max below reserved" ); + + auto delta = int64_t(max_ram_size) - int64_t(_gstate.max_ram_size); + auto itr = _rammarket.find(ramcore_symbol.raw()); + + /** + * Increase the amount of ram for sale based upon the change in max ram size. + */ + _rammarket.modify( itr, same_payer, [&]( auto& m ) { + m.base.balance.amount += delta; + }); + + _gstate.max_ram_size = max_ram_size; + } + + void system_contract::update_ram_supply() { + auto cbt = eosio::current_block_time(); + + if( cbt <= _gstate2.last_ram_increase ) return; + + auto itr = _rammarket.find(ramcore_symbol.raw()); + auto new_ram = (cbt.slot - _gstate2.last_ram_increase.slot)*_gstate2.new_ram_per_block; + _gstate.max_ram_size += new_ram; + + /** + * Increase the amount of ram for sale based upon the change in max ram size. + */ + _rammarket.modify( itr, same_payer, [&]( auto& m ) { + m.base.balance.amount += new_ram; + }); + _gstate2.last_ram_increase = cbt; + } + + void system_contract::setramrate( uint16_t bytes_per_block ) { + require_auth( get_self() ); + + update_ram_supply(); + _gstate2.new_ram_per_block = bytes_per_block; + } + + void system_contract::setparams( const eosio::blockchain_parameters& params ) { + require_auth( get_self() ); + (eosio::blockchain_parameters&)(_gstate) = params; + check( 3 <= _gstate.max_authority_depth, "max_authority_depth should be at least 3" ); + set_blockchain_parameters( params ); + } + + void system_contract::setpriv( const name& account, uint8_t ispriv ) { + require_auth( get_self() ); + set_privileged( account, ispriv ); + } + + void system_contract::setalimits( const name& account, int64_t ram, int64_t net, int64_t cpu ) { + require_auth( get_self() ); + + user_resources_table userres( get_self(), account.value ); + auto ritr = userres.find( account.value ); + check( ritr == userres.end(), "only supports unlimited accounts" ); + + auto vitr = _voters.find( account.value ); + if( vitr != _voters.end() ) { + bool ram_managed = has_field( vitr->flags1, voter_info::flags1_fields::ram_managed ); + bool net_managed = has_field( vitr->flags1, voter_info::flags1_fields::net_managed ); + bool cpu_managed = has_field( vitr->flags1, voter_info::flags1_fields::cpu_managed ); + check( !(ram_managed || net_managed || cpu_managed), "cannot use setalimits on an account with managed resources" ); + } + + set_resource_limits( account, ram, net, cpu ); + } + + void system_contract::setacctram( const name& account, const std::optional& ram_bytes ) { + require_auth( get_self() ); + + int64_t current_ram, current_net, current_cpu; + get_resource_limits( account, current_ram, current_net, current_cpu ); + + int64_t ram = 0; + + if( !ram_bytes ) { + auto vitr = _voters.find( account.value ); + check( vitr != _voters.end() && has_field( vitr->flags1, voter_info::flags1_fields::ram_managed ), + "RAM of account is already unmanaged" ); + + user_resources_table userres( get_self(), account.value ); + auto ritr = userres.find( account.value ); + + ram = ram_gift_bytes; + if( ritr != userres.end() ) { + ram += ritr->ram_bytes; + } + + _voters.modify( vitr, same_payer, [&]( auto& v ) { + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::ram_managed, false ); + }); + } else { + check( *ram_bytes >= 0, "not allowed to set RAM limit to unlimited" ); + + auto vitr = _voters.find( account.value ); + if ( vitr != _voters.end() ) { + _voters.modify( vitr, same_payer, [&]( auto& v ) { + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::ram_managed, true ); + }); + } else { + _voters.emplace( account, [&]( auto& v ) { + v.owner = account; + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::ram_managed, true ); + }); + } + + ram = *ram_bytes; + } + + set_resource_limits( account, ram, current_net, current_cpu ); + } + + void system_contract::setacctnet( const name& account, const std::optional& net_weight ) { + require_auth( get_self() ); + + int64_t current_ram, current_net, current_cpu; + get_resource_limits( account, current_ram, current_net, current_cpu ); + + int64_t net = 0; + + if( !net_weight ) { + auto vitr = _voters.find( account.value ); + check( vitr != _voters.end() && has_field( vitr->flags1, voter_info::flags1_fields::net_managed ), + "Network bandwidth of account is already unmanaged" ); + + user_resources_table userres( get_self(), account.value ); + auto ritr = userres.find( account.value ); + + if( ritr != userres.end() ) { + net = ritr->net_weight.amount; + } + + _voters.modify( vitr, same_payer, [&]( auto& v ) { + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::net_managed, false ); + }); + } else { + check( *net_weight >= -1, "invalid value for net_weight" ); + + auto vitr = _voters.find( account.value ); + if ( vitr != _voters.end() ) { + _voters.modify( vitr, same_payer, [&]( auto& v ) { + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::net_managed, true ); + }); + } else { + _voters.emplace( account, [&]( auto& v ) { + v.owner = account; + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::net_managed, true ); + }); + } + + net = *net_weight; + } + + set_resource_limits( account, current_ram, net, current_cpu ); + } + + void system_contract::setacctcpu( const name& account, const std::optional& cpu_weight ) { + require_auth( get_self() ); + + int64_t current_ram, current_net, current_cpu; + get_resource_limits( account, current_ram, current_net, current_cpu ); + + int64_t cpu = 0; + + if( !cpu_weight ) { + auto vitr = _voters.find( account.value ); + check( vitr != _voters.end() && has_field( vitr->flags1, voter_info::flags1_fields::cpu_managed ), + "CPU bandwidth of account is already unmanaged" ); + + user_resources_table userres( get_self(), account.value ); + auto ritr = userres.find( account.value ); + + if( ritr != userres.end() ) { + cpu = ritr->cpu_weight.amount; + } + + _voters.modify( vitr, same_payer, [&]( auto& v ) { + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::cpu_managed, false ); + }); + } else { + check( *cpu_weight >= -1, "invalid value for cpu_weight" ); + + auto vitr = _voters.find( account.value ); + if ( vitr != _voters.end() ) { + _voters.modify( vitr, same_payer, [&]( auto& v ) { + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::cpu_managed, true ); + }); + } else { + _voters.emplace( account, [&]( auto& v ) { + v.owner = account; + v.flags1 = set_field( v.flags1, voter_info::flags1_fields::cpu_managed, true ); + }); + } + + cpu = *cpu_weight; + } + + set_resource_limits( account, current_ram, current_net, cpu ); + } + + void system_contract::activate( const eosio::checksum256& feature_digest ) { + require_auth( get_self() ); + preactivate_feature( feature_digest ); + } + + void system_contract::rmvproducer( const name& producer ) { + require_auth( get_self() ); + auto prod = _producers.find( producer.value ); + check( prod != _producers.end(), "producer not found" ); + _producers.modify( prod, same_payer, [&](auto& p) { + p.deactivate(); + }); + } + + void system_contract::updtrevision( uint8_t revision ) { + require_auth( get_self() ); + check( _gstate2.revision < 255, "can not increment revision" ); // prevent wrap around + check( revision == _gstate2.revision + 1, "can only increment revision by one" ); + check( revision <= 1, // set upper bound to greatest revision supported in the code + "specified revision is not yet supported by the code" ); + _gstate2.revision = revision; + } + + void system_contract::setinflation( int64_t annual_rate, int64_t inflation_pay_factor, int64_t votepay_factor ) { + require_auth(get_self()); + check(annual_rate >= 0, "annual_rate can't be negative"); + if ( inflation_pay_factor < pay_factor_precision ) { + check( false, "inflation_pay_factor must not be less than " + std::to_string(pay_factor_precision) ); + } + if ( votepay_factor < pay_factor_precision ) { + check( false, "votepay_factor must not be less than " + std::to_string(pay_factor_precision) ); + } + _gstate4.continuous_rate = get_continuous_rate(annual_rate); + _gstate4.inflation_pay_factor = inflation_pay_factor; + _gstate4.votepay_factor = votepay_factor; + _global4.set( _gstate4, get_self() ); + } + + /** + * Called after a new account is created. This code enforces resource-limits rules + * for new accounts as well as new account naming conventions. + * + * Account names containing '.' symbols must have a suffix equal to the name of the creator. + * This allows users who buy a premium name (shorter than 12 characters with no dots) to be the only ones + * who can create accounts with the creator's name as a suffix. + * + */ + void native::newaccount( const name& creator, + const name& newact, + ignore owner, + ignore active ) { + + if( creator != get_self() ) { + uint64_t tmp = newact.value >> 4; + bool has_dot = false; + + for( uint32_t i = 0; i < 12; ++i ) { + has_dot |= !(tmp & 0x1f); + tmp >>= 5; + } + if( has_dot ) { // or is less than 12 characters + auto suffix = newact.suffix(); + if( suffix == newact ) { + name_bid_table bids(get_self(), get_self().value); + auto current = bids.find( newact.value ); + check( current != bids.end(), "no active bid for name" ); + check( current->high_bidder == creator, "only highest bidder can claim" ); + check( current->high_bid < 0, "auction for name is not closed yet" ); + bids.erase( current ); + } else { + check( creator == suffix, "only suffix may create this account" ); + } + } + } + + user_resources_table userres( get_self(), newact.value ); + + userres.emplace( newact, [&]( auto& res ) { + res.owner = newact; + res.net_weight = asset( 0, system_contract::get_core_symbol() ); + res.cpu_weight = asset( 0, system_contract::get_core_symbol() ); + }); + + set_resource_limits( newact, 0, 0, 0 ); + } + + void native::setabi( const name& acnt, const std::vector& abi ) { + eosio::multi_index< "abihash"_n, abi_hash > table(get_self(), get_self().value); + auto itr = table.find( acnt.value ); + if( itr == table.end() ) { + table.emplace( acnt, [&]( auto& row ) { + row.owner = acnt; + row.hash = eosio::sha256(const_cast(abi.data()), abi.size()); + }); + } else { + table.modify( itr, same_payer, [&]( auto& row ) { + row.hash = eosio::sha256(const_cast(abi.data()), abi.size()); + }); + } + } + + void system_contract::init( unsigned_int version, const symbol& core ) { + require_auth( get_self() ); + check( version.value == 0, "unsupported version for init action" ); + + auto itr = _rammarket.find(ramcore_symbol.raw()); + check( itr == _rammarket.end(), "system contract has already been initialized" ); + + auto system_token_supply = eosio::token::get_supply(token_account, core.code() ); + check( system_token_supply.symbol == core, "specified core symbol does not exist (precision mismatch)" ); + + check( system_token_supply.amount > 0, "system token supply must be greater than 0" ); + _rammarket.emplace( get_self(), [&]( auto& m ) { + m.supply.amount = 100000000000000ll; + m.supply.symbol = ramcore_symbol; + m.base.balance.amount = int64_t(_gstate.free_ram()); + m.base.balance.symbol = ram_symbol; + m.quote.balance.amount = system_token_supply.amount / 1000; + m.quote.balance.symbol = core; + }); + + token::open_action open_act{ token_account, { {get_self(), active_permission} } }; + open_act.send( rex_account, core, get_self() ); + } + +} /// eosio.system diff --git a/contracts/eosio.system/src/exchange_state.cpp b/contracts/eosio.system/src/exchange_state.cpp new file mode 100644 index 000000000..8f9734bcb --- /dev/null +++ b/contracts/eosio.system/src/exchange_state.cpp @@ -0,0 +1,110 @@ +#include + +#include + +#include + +namespace eosiosystem { + + using eosio::check; + + asset exchange_state::convert_to_exchange( connector& reserve, const asset& payment ) + { + const double S0 = supply.amount; + const double R0 = reserve.balance.amount; + const double dR = payment.amount; + const double F = reserve.weight; + + double dS = S0 * ( std::pow(1. + dR / R0, F) - 1. ); + if ( dS < 0 ) dS = 0; // rounding errors + reserve.balance += payment; + supply.amount += int64_t(dS); + return asset( int64_t(dS), supply.symbol ); + } + + asset exchange_state::convert_from_exchange( connector& reserve, const asset& tokens ) + { + const double R0 = reserve.balance.amount; + const double S0 = supply.amount; + const double dS = -tokens.amount; // dS < 0, tokens are subtracted from supply + const double Fi = double(1) / reserve.weight; + + double dR = R0 * ( std::pow(1. + dS / S0, Fi) - 1. ); // dR < 0 since dS < 0 + if ( dR > 0 ) dR = 0; // rounding errors + reserve.balance.amount -= int64_t(-dR); + supply -= tokens; + return asset( int64_t(-dR), reserve.balance.symbol ); + } + + asset exchange_state::convert( const asset& from, const symbol& to ) + { + const auto& sell_symbol = from.symbol; + const auto& base_symbol = base.balance.symbol; + const auto& quote_symbol = quote.balance.symbol; + check( sell_symbol != to, "cannot convert to the same symbol" ); + + asset out( 0, to ); + if ( sell_symbol == base_symbol && to == quote_symbol ) { + const asset tmp = convert_to_exchange( base, from ); + out = convert_from_exchange( quote, tmp ); + } else if ( sell_symbol == quote_symbol && to == base_symbol ) { + const asset tmp = convert_to_exchange( quote, from ); + out = convert_from_exchange( base, tmp ); + } else { + check( false, "invalid conversion" ); + } + return out; + } + + asset exchange_state::direct_convert( const asset& from, const symbol& to ) + { + const auto& sell_symbol = from.symbol; + const auto& base_symbol = base.balance.symbol; + const auto& quote_symbol = quote.balance.symbol; + check( sell_symbol != to, "cannot convert to the same symbol" ); + + asset out( 0, to ); + if ( sell_symbol == base_symbol && to == quote_symbol ) { + out.amount = get_bancor_output( base.balance.amount, quote.balance.amount, from.amount ); + base.balance += from; + quote.balance -= out; + } else if ( sell_symbol == quote_symbol && to == base_symbol ) { + out.amount = get_bancor_output( quote.balance.amount, base.balance.amount, from.amount ); + quote.balance += from; + base.balance -= out; + } else { + check( false, "invalid conversion" ); + } + return out; + } + + int64_t exchange_state::get_bancor_output( int64_t inp_reserve, + int64_t out_reserve, + int64_t inp ) + { + const double ib = inp_reserve; + const double ob = out_reserve; + const double in = inp; + + int64_t out = int64_t( (in * ob) / (ib + in) ); + + if ( out < 0 ) out = 0; + + return out; + } + + int64_t exchange_state::get_bancor_input( int64_t out_reserve, + int64_t inp_reserve, + int64_t out ) + { + const double ob = out_reserve; + const double ib = inp_reserve; + + int64_t inp = (ib * out) / (ob - out); + + if ( inp < 0 ) inp = 0; + + return inp; + } + +} /// namespace eosiosystem diff --git a/contracts/eosio.system/src/name_bidding.cpp b/contracts/eosio.system/src/name_bidding.cpp new file mode 100644 index 000000000..4c01f353a --- /dev/null +++ b/contracts/eosio.system/src/name_bidding.cpp @@ -0,0 +1,80 @@ +#include +#include + +#include + +namespace eosiosystem { + + using eosio::current_time_point; + using eosio::token; + + void system_contract::bidname( const name& bidder, const name& newname, const asset& bid ) { + require_auth( bidder ); + check( newname.suffix() == newname, "you can only bid on top-level suffix" ); + + check( (bool)newname, "the empty name is not a valid account name to bid on" ); + check( (newname.value & 0xFull) == 0, "13 character names are not valid account names to bid on" ); + check( (newname.value & 0x1F0ull) == 0, "accounts with 12 character names and no dots can be created without bidding required" ); + check( !is_account( newname ), "account already exists" ); + check( bid.symbol == core_symbol(), "asset must be system token" ); + check( bid.amount > 0, "insufficient bid" ); + token::transfer_action transfer_act{ token_account, { {bidder, active_permission} } }; + transfer_act.send( bidder, names_account, bid, std::string("bid name ")+ newname.to_string() ); + name_bid_table bids(get_self(), get_self().value); + print( name{bidder}, " bid ", bid, " on ", name{newname}, "\n" ); + auto current = bids.find( newname.value ); + if( current == bids.end() ) { + bids.emplace( bidder, [&]( auto& b ) { + b.newname = newname; + b.high_bidder = bidder; + b.high_bid = bid.amount; + b.last_bid_time = current_time_point(); + }); + } else { + check( current->high_bid > 0, "this auction has already closed" ); + check( bid.amount - current->high_bid > (current->high_bid / 10), "must increase bid by 10%" ); + check( current->high_bidder != bidder, "account is already highest bidder" ); + + bid_refund_table refunds_table(get_self(), newname.value); + + auto it = refunds_table.find( current->high_bidder.value ); + if ( it != refunds_table.end() ) { + refunds_table.modify( it, same_payer, [&](auto& r) { + r.amount += asset( current->high_bid, core_symbol() ); + }); + } else { + refunds_table.emplace( bidder, [&](auto& r) { + r.bidder = current->high_bidder; + r.amount = asset( current->high_bid, core_symbol() ); + }); + } + + eosio::transaction t; + t.actions.emplace_back( permission_level{current->high_bidder, active_permission}, + get_self(), "bidrefund"_n, + std::make_tuple( current->high_bidder, newname ) + ); + t.delay_sec = 0; + uint128_t deferred_id = (uint128_t(newname.value) << 64) | current->high_bidder.value; + eosio::cancel_deferred( deferred_id ); + t.send( deferred_id, bidder ); + + bids.modify( current, bidder, [&]( auto& b ) { + b.high_bidder = bidder; + b.high_bid = bid.amount; + b.last_bid_time = current_time_point(); + }); + } + } + + void system_contract::bidrefund( const name& bidder, const name& newname ) { + bid_refund_table refunds_table(get_self(), newname.value); + auto it = refunds_table.find( bidder.value ); + check( it != refunds_table.end(), "refund not found" ); + + token::transfer_action transfer_act{ token_account, { {names_account, active_permission}, {bidder, active_permission} } }; + transfer_act.send( names_account, bidder, asset(it->amount), std::string("refund bid on name ")+(name{newname}).to_string() ); + refunds_table.erase( it ); + } + +} diff --git a/contracts/eosio.system/src/native.cpp b/contracts/eosio.system/src/native.cpp new file mode 100644 index 000000000..df98daabf --- /dev/null +++ b/contracts/eosio.system/src/native.cpp @@ -0,0 +1,11 @@ +#include + +#include + +namespace eosiosystem { + + void native::onerror( ignore, ignore> ) { + eosio::check( false, "the onerror action cannot be called directly" ); + } + +} diff --git a/contracts/eosio.system/src/powerup.cpp b/contracts/eosio.system/src/powerup.cpp new file mode 100644 index 000000000..335d9bb23 --- /dev/null +++ b/contracts/eosio.system/src/powerup.cpp @@ -0,0 +1,398 @@ +#include +#include +#include +#include +#include + +namespace eosiosystem { + +void update_weight(time_point_sec now, powerup_state_resource& res, int64_t& delta_available); + +/** + * @pre now >= res.utilization_timestamp + * @post res.utilization <= new res.adjusted_utilization + * @post if res.utilization < old res.adjusted_utilization, then new res.adjusted_utilization <= old res.adjusted_utilization + * @post if res.utilization >= old res.adjusted_utilization, then new res.adjusted_utilization == res.utilization + */ +void update_utilization(time_point_sec now, powerup_state_resource& res); + +void system_contract::adjust_resources(name payer, name account, symbol core_symbol, int64_t net_delta, + int64_t cpu_delta, bool must_not_be_managed) { + if (!net_delta && !cpu_delta) + return; + + user_resources_table totals_tbl(get_self(), account.value); + auto tot_itr = totals_tbl.find(account.value); + if (tot_itr == totals_tbl.end()) { + tot_itr = totals_tbl.emplace(payer, [&](auto& tot) { + tot.owner = account; + tot.net_weight = asset{ net_delta, core_symbol }; + tot.cpu_weight = asset{ cpu_delta, core_symbol }; + }); + } else { + totals_tbl.modify(tot_itr, same_payer, [&](auto& tot) { + tot.net_weight.amount += net_delta; + tot.cpu_weight.amount += cpu_delta; + }); + } + check(0 <= tot_itr->net_weight.amount, "insufficient staked total net bandwidth"); + check(0 <= tot_itr->cpu_weight.amount, "insufficient staked total cpu bandwidth"); + + { + bool ram_managed = false; + bool net_managed = false; + bool cpu_managed = false; + + auto voter_itr = _voters.find(account.value); + if (voter_itr != _voters.end()) { + ram_managed = has_field(voter_itr->flags1, voter_info::flags1_fields::ram_managed); + net_managed = has_field(voter_itr->flags1, voter_info::flags1_fields::net_managed); + cpu_managed = has_field(voter_itr->flags1, voter_info::flags1_fields::cpu_managed); + } + + if (must_not_be_managed) + eosio::check(!net_managed && !cpu_managed, "something is managed which shouldn't be"); + + if (!(net_managed && cpu_managed)) { + int64_t ram_bytes, net, cpu; + get_resource_limits(account, ram_bytes, net, cpu); + set_resource_limits( + account, ram_managed ? ram_bytes : std::max(tot_itr->ram_bytes + ram_gift_bytes, ram_bytes), + net_managed ? net : tot_itr->net_weight.amount, cpu_managed ? cpu : tot_itr->cpu_weight.amount); + } + } + + if (tot_itr->is_empty()) { + totals_tbl.erase(tot_itr); + } +} // system_contract::adjust_resources + +void system_contract::process_powerup_queue(time_point_sec now, symbol core_symbol, powerup_state& state, + powerup_order_table& orders, uint32_t max_items, int64_t& net_delta_available, + int64_t& cpu_delta_available) { + update_utilization(now, state.net); + update_utilization(now, state.cpu); + auto idx = orders.get_index<"byexpires"_n>(); + while (max_items--) { + auto it = idx.begin(); + if (it == idx.end() || it->expires > now) + break; + net_delta_available += it->net_weight; + cpu_delta_available += it->cpu_weight; + adjust_resources(get_self(), it->owner, core_symbol, -it->net_weight, -it->cpu_weight); + idx.erase(it); + } + state.net.utilization -= net_delta_available; + state.cpu.utilization -= cpu_delta_available; + update_weight(now, state.net, net_delta_available); + update_weight(now, state.cpu, cpu_delta_available); +} + +void update_weight(time_point_sec now, powerup_state_resource& res, int64_t& delta_available) { + if (now >= res.target_timestamp) { + res.weight_ratio = res.target_weight_ratio; + } else { + res.weight_ratio = res.initial_weight_ratio + // + int128_t(res.target_weight_ratio - res.initial_weight_ratio) * + (now.utc_seconds - res.initial_timestamp.utc_seconds) / + (res.target_timestamp.utc_seconds - res.initial_timestamp.utc_seconds); + } + int64_t new_weight = res.assumed_stake_weight * int128_t(powerup_frac) / res.weight_ratio - res.assumed_stake_weight; + delta_available += new_weight - res.weight; + res.weight = new_weight; +} + +void update_utilization(time_point_sec now, powerup_state_resource& res) { + if (now <= res.utilization_timestamp) return; + + if (res.utilization >= res.adjusted_utilization) { + res.adjusted_utilization = res.utilization; + } else { + int64_t diff = res.adjusted_utilization - res.utilization; + int64_t delta = diff * std::exp(-double(now.utc_seconds - res.utilization_timestamp.utc_seconds) / double(res.decay_secs)); + delta = std::clamp( delta, 0ll, diff); + res.adjusted_utilization = res.utilization + delta; + } + res.utilization_timestamp = now; +} + +void system_contract::cfgpowerup(powerup_config& args) { + require_auth(get_self()); + time_point_sec now = eosio::current_time_point(); + auto core_symbol = get_core_symbol(); + powerup_state_singleton state_sing{ get_self(), 0 }; + auto state = state_sing.get_or_default(); + + eosio::check(eosio::is_account(reserv_account), "eosio.reserv account must first be created"); + + int64_t net_delta_available = 0; + int64_t cpu_delta_available = 0; + if (state_sing.exists()) { + update_utilization(now, state.net); + update_utilization(now, state.cpu); + update_weight(now, state.net, net_delta_available); + update_weight(now, state.cpu, cpu_delta_available); + } else { + state.net.utilization_timestamp = now; + state.cpu.utilization_timestamp = now; + } + + auto is_default_asset = []( const eosio::asset& a ) -> bool { + return a.amount == 0 && a.symbol == symbol{}; + }; + + auto update = [&](auto& state, auto& args) { + if (!args.current_weight_ratio) { + if (state.weight_ratio) { + *args.current_weight_ratio = state.weight_ratio; + } else { + *args.current_weight_ratio = state.initial_weight_ratio; + } + } + + if (!args.target_weight_ratio) { + *args.target_weight_ratio = state.target_weight_ratio; + } + + if (!args.assumed_stake_weight) { + eosio::check(state.assumed_stake_weight != 0, "assumed_stake_weight does not have a default value"); + *args.assumed_stake_weight = state.assumed_stake_weight; + } + + if (*args.current_weight_ratio == *args.target_weight_ratio) { + *args.target_timestamp = now; + } else { + if (!args.target_timestamp) { + eosio::check(state.target_timestamp.utc_seconds != 0, "target_timestamp does not have a default value"); + *args.target_timestamp = state.target_timestamp; + } + eosio::check(*args.target_timestamp > now, "target_timestamp must be in the future"); + } + + if (!args.exponent) { + *args.exponent = state.exponent; + } + + if (!args.decay_secs) { + *args.decay_secs = state.decay_secs; + } + + if (!args.max_price) { + eosio::check(!is_default_asset(state.max_price), "max_price does not have a default value"); + *args.max_price = state.max_price; + } + + if (!args.min_price) { + if (is_default_asset(state.min_price)) { + *args.min_price = *args.max_price; // just to copy symbol of max_price + args.min_price->amount = 0; // min_price has a default of zero. + } else { + *args.min_price = state.min_price; + } + } + + eosio::check(*args.current_weight_ratio > 0, "current_weight_ratio is too small"); + eosio::check(*args.current_weight_ratio <= powerup_frac, "current_weight_ratio is too large"); + eosio::check(*args.target_weight_ratio > 0, "target_weight_ratio is too small"); + eosio::check(*args.target_weight_ratio <= *args.current_weight_ratio, "weight can't grow over time"); + eosio::check(*args.assumed_stake_weight >= 1, + "assumed_stake_weight must be at least 1; a much larger value is recommended"); + eosio::check(*args.assumed_stake_weight * int128_t(powerup_frac) / *args.target_weight_ratio <= + std::numeric_limits::max(), + "assumed_stake_weight/target_weight_ratio is too large"); + eosio::check(*args.exponent >= 1.0, "exponent must be >= 1"); + eosio::check(*args.decay_secs >= 1, "decay_secs must be >= 1"); + eosio::check(args.max_price->symbol == core_symbol, "max_price doesn't match core symbol"); + eosio::check(args.max_price->amount > 0, "max_price must be positive"); + eosio::check(args.min_price->symbol == core_symbol, "min_price doesn't match core symbol"); + eosio::check(args.min_price->amount >= 0, "min_price must be non-negative"); + eosio::check(args.min_price->amount <= args.max_price->amount, "min_price cannot exceed max_price"); + if (*args.exponent == 1.0) { + eosio::check(args.min_price->amount == args.max_price->amount, "min_price and max_price must be the same if the exponent is 1"); + } + + state.assumed_stake_weight = *args.assumed_stake_weight; + state.initial_weight_ratio = *args.current_weight_ratio; + state.target_weight_ratio = *args.target_weight_ratio; + state.initial_timestamp = now; + state.target_timestamp = *args.target_timestamp; + state.exponent = *args.exponent; + state.decay_secs = *args.decay_secs; + state.min_price = *args.min_price; + state.max_price = *args.max_price; + }; + + if (!args.powerup_days) { + *args.powerup_days = state.powerup_days; + } + + if (!args.min_powerup_fee) { + eosio::check(!is_default_asset(state.min_powerup_fee), "min_powerup_fee does not have a default value"); + *args.min_powerup_fee = state.min_powerup_fee; + } + + eosio::check(*args.powerup_days > 0, "powerup_days must be > 0"); + eosio::check(args.min_powerup_fee->symbol == core_symbol, "min_powerup_fee doesn't match core symbol"); + eosio::check(args.min_powerup_fee->amount > 0, "min_powerup_fee must be positive"); + + state.powerup_days = *args.powerup_days; + state.min_powerup_fee = *args.min_powerup_fee; + + update(state.net, args.net); + update(state.cpu, args.cpu); + + update_weight(now, state.net, net_delta_available); + update_weight(now, state.cpu, cpu_delta_available); + eosio::check(state.net.weight >= state.net.utilization, "weight can't shrink below utilization"); + eosio::check(state.cpu.weight >= state.cpu.utilization, "weight can't shrink below utilization"); + state.net.adjusted_utilization = std::min(state.net.adjusted_utilization, state.net.weight); + state.cpu.adjusted_utilization = std::min(state.cpu.adjusted_utilization, state.cpu.weight); + + adjust_resources(get_self(), reserv_account, core_symbol, net_delta_available, cpu_delta_available, true); + state_sing.set(state, get_self()); +} // system_contract::configpower + +/** + * @pre 0 <= state.min_price.amount <= state.max_price.amount + * @pre 0 < state.max_price.amount + * @pre 1.0 <= state.exponent + * @pre 0 <= state.utilization <= state.adjusted_utilization <= state.weight + * @pre 0 <= utilization_increase <= (state.weight - state.utilization) + */ +int64_t calc_powerup_fee(const powerup_state_resource& state, int64_t utilization_increase) { + if( utilization_increase <= 0 ) return 0; + + // Let p(u) = price as a function of the utilization fraction u which is defined for u in [0.0, 1.0]. + // Let f(u) = integral of the price function p(x) from x = 0.0 to x = u, again defined for u in [0.0, 1.0]. + + // In particular we choose f(u) = min_price * u + ((max_price - min_price) / exponent) * (u ^ exponent). + // And so p(u) = min_price + (max_price - min_price) * (u ^ (exponent - 1.0)). + + // Returns f(double(end_utilization)/state.weight) - f(double(start_utilization)/state.weight) which is equivalent to + // the integral of p(x) from x = double(start_utilization)/state.weight to x = double(end_utilization)/state.weight. + // @pre 0 <= start_utilization <= end_utilization <= state.weight + auto price_integral_delta = [&state](int64_t start_utilization, int64_t end_utilization) -> double { + double coefficient = (state.max_price.amount - state.min_price.amount) / state.exponent; + double start_u = double(start_utilization) / state.weight; + double end_u = double(end_utilization) / state.weight; + return state.min_price.amount * end_u - state.min_price.amount * start_u + + coefficient * std::pow(end_u, state.exponent) - coefficient * std::pow(start_u, state.exponent); + }; + + // Returns p(double(utilization)/state.weight). + // @pre 0 <= utilization <= state.weight + auto price_function = [&state](int64_t utilization) -> double { + double price = state.min_price.amount; + // state.exponent >= 1.0, therefore the exponent passed into std::pow is >= 0.0. + // Since the exponent passed into std::pow could be 0.0 and simultaneously so could double(utilization)/state.weight, + // the safest thing to do is handle that as a special case explicitly rather than relying on std::pow to return 1.0 + // instead of triggering a domain error. + double new_exponent = state.exponent - 1.0; + if (new_exponent <= 0.0) { + return state.max_price.amount; + } else { + price += (state.max_price.amount - state.min_price.amount) * std::pow(double(utilization) / state.weight, new_exponent); + } + + return price; + }; + + double fee = 0.0; + int64_t start_utilization = state.utilization; + int64_t end_utilization = start_utilization + utilization_increase; + + if (start_utilization < state.adjusted_utilization) { + fee += price_function(state.adjusted_utilization) * + std::min(utilization_increase, state.adjusted_utilization - start_utilization) / state.weight; + start_utilization = state.adjusted_utilization; + } + + if (start_utilization < end_utilization) { + fee += price_integral_delta(start_utilization, end_utilization); + } + + return std::ceil(fee); +} + +void system_contract::powerupexec(const name& user, uint16_t max) { + require_auth(user); + powerup_state_singleton state_sing{ get_self(), 0 }; + powerup_order_table orders{ get_self(), 0 }; + eosio::check(state_sing.exists(), "powerup hasn't been initialized"); + auto state = state_sing.get(); + time_point_sec now = eosio::current_time_point(); + auto core_symbol = get_core_symbol(); + + int64_t net_delta_available = 0; + int64_t cpu_delta_available = 0; + process_powerup_queue(now, core_symbol, state, orders, max, net_delta_available, cpu_delta_available); + + adjust_resources(get_self(), reserv_account, core_symbol, net_delta_available, cpu_delta_available, true); + state_sing.set(state, get_self()); +} + +void system_contract::powerup(const name& payer, const name& receiver, uint32_t days, int64_t net_frac, int64_t cpu_frac, + const asset& max_payment) { + require_auth(payer); + powerup_state_singleton state_sing{ get_self(), 0 }; + powerup_order_table orders{ get_self(), 0 }; + eosio::check(state_sing.exists(), "powerup hasn't been initialized"); + auto state = state_sing.get(); + time_point_sec now = eosio::current_time_point(); + auto core_symbol = get_core_symbol(); + eosio::check(max_payment.symbol == core_symbol, "max_payment doesn't match core symbol"); + eosio::check(days == state.powerup_days, "days doesn't match configuration"); + eosio::check(net_frac >= 0, "net_frac can't be negative"); + eosio::check(cpu_frac >= 0, "cpu_frac can't be negative"); + eosio::check(net_frac <= powerup_frac, "net can't be more than 100%"); + eosio::check(cpu_frac <= powerup_frac, "cpu can't be more than 100%"); + + int64_t net_delta_available = 0; + int64_t cpu_delta_available = 0; + process_powerup_queue(now, core_symbol, state, orders, 2, net_delta_available, cpu_delta_available); + + eosio::asset fee{ 0, core_symbol }; + auto process = [&](int64_t frac, int64_t& amount, powerup_state_resource& state) { + if (!frac) + return; + amount = int128_t(frac) * state.weight / powerup_frac; + eosio::check(state.weight, "market doesn't have resources available"); + eosio::check(state.utilization + amount <= state.weight, "market doesn't have enough resources available"); + int64_t f = calc_powerup_fee(state, amount); + eosio::check(f > 0, "calculated fee is below minimum; try powering up with more resources"); + fee.amount += f; + state.utilization += amount; + }; + + int64_t net_amount = 0; + int64_t cpu_amount = 0; + process(net_frac, net_amount, state.net); + process(cpu_frac, cpu_amount, state.cpu); + if (fee > max_payment) { + std::string error_msg = "max_payment is less than calculated fee: "; + error_msg += fee.to_string(); + eosio::check(false, error_msg); + } + eosio::check(fee >= state.min_powerup_fee, "calculated fee is below minimum; try powering up with more resources"); + + orders.emplace(payer, [&](auto& order) { + order.id = orders.available_primary_key(); + order.owner = receiver; + order.net_weight = net_amount; + order.cpu_weight = cpu_amount; + order.expires = now + eosio::days(days); + }); + net_delta_available -= net_amount; + cpu_delta_available -= cpu_amount; + + adjust_resources(payer, receiver, core_symbol, net_amount, cpu_amount, true); + adjust_resources(get_self(), reserv_account, core_symbol, net_delta_available, cpu_delta_available, true); + channel_to_rex(payer, fee, true); + state_sing.set(state, get_self()); + + // inline noop action + powup_results::powupresult_action powupresult_act{ reserv_account, std::vector{ } }; + powupresult_act.send( fee, net_amount, cpu_amount ); +} + +} // namespace eosiosystem diff --git a/contracts/eosio.system/src/powerup.results.cpp b/contracts/eosio.system/src/powerup.results.cpp new file mode 100644 index 000000000..2be2e981a --- /dev/null +++ b/contracts/eosio.system/src/powerup.results.cpp @@ -0,0 +1,5 @@ +#include + +void powup_results::powupresult( const asset& fee, const int64_t powup_net_weight, const int64_t powup_cpu_weight ) { } + +extern "C" void apply( uint64_t, uint64_t, uint64_t ) { } diff --git a/eosio.system/src/producer_pay.cpp b/contracts/eosio.system/src/producer_pay.cpp similarity index 64% rename from eosio.system/src/producer_pay.cpp rename to contracts/eosio.system/src/producer_pay.cpp index 287ab8b69..4db2f7740 100644 --- a/eosio.system/src/producer_pay.cpp +++ b/contracts/eosio.system/src/producer_pay.cpp @@ -1,25 +1,16 @@ #include - #include namespace eosiosystem { - const int64_t min_pervote_daily_pay = 100'0000; - const int64_t min_activated_stake = 150'000'000'0000; - const double continuous_rate = 0.04879; // 5% annual rate - const double perblock_rate = 0.0025; // 0.25% - const double standby_rate = 0.0075; // 0.75% - const uint32_t blocks_per_year = 52*7*24*2*3600; // half seconds per year - const uint32_t seconds_per_year = 52*7*24*3600; - const uint32_t blocks_per_day = 2 * 24 * 3600; - const uint32_t blocks_per_hour = 2 * 3600; - const int64_t useconds_per_day = 24 * 3600 * int64_t(1000000); - const int64_t useconds_per_year = seconds_per_year*1000000ll; + using eosio::current_time_point; + using eosio::microseconds; + using eosio::token; void system_contract::onblock( ignore ) { using namespace eosio; - require_auth(_self); + require_auth(get_self()); block_timestamp timestamp; name producer; @@ -30,8 +21,8 @@ namespace eosiosystem { // is eventually completely removed, at which point this line can be removed. _gstate2.last_block_num = timestamp; - /** until activated stake crosses this threshold no new rewards are paid */ - if( _gstate.total_activated_stake < min_activated_stake ) + /** until activation, no new rewards are paid */ + if( _gstate.thresh_activated_stake_time == time_point() ) return; if( _gstate.last_pervote_bucket_fill == time_point() ) /// start the presses @@ -55,7 +46,7 @@ namespace eosiosystem { update_elected_producers( timestamp ); if( (timestamp.slot - _gstate.last_name_close.slot) > blocks_per_day ) { - name_bid_table bids(_self, _self.value); + name_bid_table bids(get_self(), get_self().value); auto idx = bids.get_index<"highbid"_n>(); auto highest = idx.lower_bound( std::numeric_limits::max()/2 ); if( highest != idx.end() && @@ -65,6 +56,7 @@ namespace eosiosystem { (current_time_point() - _gstate.thresh_activated_stake_time) > microseconds(14 * useconds_per_day) ) { _gstate.last_name_close = timestamp; + channel_namebid_to_rex( highest->high_bid ); idx.modify( highest, same_payer, [&]( auto& b ){ b.high_bid = -b.high_bid; }); @@ -73,50 +65,51 @@ namespace eosiosystem { } } - using namespace eosio; - void system_contract::claimrewards( const name owner ) { + void system_contract::claimrewards( const name& owner ) { require_auth( owner ); const auto& prod = _producers.get( owner.value ); - eosio_assert( prod.active(), "producer does not have an active key" ); + check( prod.active(), "producer does not have an active key" ); - eosio_assert( _gstate.total_activated_stake >= min_activated_stake, + check( _gstate.thresh_activated_stake_time != time_point(), "cannot claim rewards until the chain is activated (at least 15% of all tokens participate in voting)" ); const auto ct = current_time_point(); - eosio_assert( ct - prod.last_claim_time > microseconds(useconds_per_day), "already claimed rewards within past day" ); + check( ct - prod.last_claim_time > microseconds(useconds_per_day), "already claimed rewards within past day" ); - const asset token_supply = eosio::token::get_supply(token_account, core_symbol().code() ); + const asset token_supply = token::get_supply(token_account, core_symbol().code() ); const auto usecs_since_last_fill = (ct - _gstate.last_pervote_bucket_fill).count(); if( usecs_since_last_fill > 0 && _gstate.last_pervote_bucket_fill > time_point() ) { - auto new_tokens = static_cast( (continuous_rate * double(token_supply.amount) * double(usecs_since_last_fill)) / double(useconds_per_year) ); - - auto to_producers = new_tokens / 5; - auto to_savings = new_tokens - to_producers; - auto to_per_block_pay = to_producers / 4; - auto to_per_vote_pay = to_producers - to_per_block_pay; - - INLINE_ACTION_SENDER(eosio::token, issue)( - token_account, { {_self, active_permission} }, - { _self, asset(new_tokens, core_symbol()), std::string("issue tokens for producer pay and savings") } - ); - - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {_self, active_permission} }, - { _self, saving_account, asset(to_savings, core_symbol()), "unallocated inflation" } - ); - - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {_self, active_permission} }, - { _self, bpay_account, asset(to_per_block_pay, core_symbol()), "fund per-block bucket" } - ); - - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {_self, active_permission} }, - { _self, vpay_account, asset(to_per_vote_pay, core_symbol()), "fund per-vote bucket" } - ); + double additional_inflation = (_gstate4.continuous_rate * double(token_supply.amount) * double(usecs_since_last_fill)) / double(useconds_per_year); + check( additional_inflation <= double(std::numeric_limits::max() - ((1ll << 10) - 1)), + "overflow in calculating new tokens to be issued; inflation rate is too high" ); + int64_t new_tokens = (additional_inflation < 0.0) ? 0 : static_cast(additional_inflation); + + int64_t to_producers = (new_tokens * uint128_t(pay_factor_precision)) / _gstate4.inflation_pay_factor; + int64_t to_savings = new_tokens - to_producers; + int64_t to_per_block_pay = (to_producers * uint128_t(pay_factor_precision)) / _gstate4.votepay_factor; + int64_t to_per_vote_pay = to_producers - to_per_block_pay; + + if( new_tokens > 0 ) { + { + token::issue_action issue_act{ token_account, { {get_self(), active_permission} } }; + issue_act.send( get_self(), asset(new_tokens, core_symbol()), "issue tokens for producer pay and savings" ); + } + { + token::transfer_action transfer_act{ token_account, { {get_self(), active_permission} } }; + if( to_savings > 0 ) { + transfer_act.send( get_self(), saving_account, asset(to_savings, core_symbol()), "unallocated inflation" ); + } + if( to_per_block_pay > 0 ) { + transfer_act.send( get_self(), bpay_account, asset(to_per_block_pay, core_symbol()), "fund per-block bucket" ); + } + if( to_per_vote_pay > 0 ) { + transfer_act.send( get_self(), vpay_account, asset(to_per_vote_pay, core_symbol()), "fund per-vote bucket" ); + } + } + } _gstate.pervote_bucket += to_per_vote_pay; _gstate.perblock_bucket += to_per_block_pay; @@ -185,17 +178,13 @@ namespace eosiosystem { p.unpaid_blocks = 0; }); - if( producer_per_block_pay > 0 ) { - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {bpay_account, active_permission}, {owner, active_permission} }, - { bpay_account, owner, asset(producer_per_block_pay, core_symbol()), std::string("producer block pay") } - ); + if ( producer_per_block_pay > 0 ) { + token::transfer_action transfer_act{ token_account, { {bpay_account, active_permission}, {owner, active_permission} } }; + transfer_act.send( bpay_account, owner, asset(producer_per_block_pay, core_symbol()), "producer block pay" ); } - if( producer_per_vote_pay > 0 ) { - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {vpay_account, active_permission}, {owner, active_permission} }, - { vpay_account, owner, asset(producer_per_vote_pay, core_symbol()), std::string("producer vote pay") } - ); + if ( producer_per_vote_pay > 0 ) { + token::transfer_action transfer_act{ token_account, { {vpay_account, active_permission}, {owner, active_permission} } }; + transfer_act.send( vpay_account, owner, asset(producer_per_vote_pay, core_symbol()), "producer vote pay" ); } } diff --git a/contracts/eosio.system/src/rex.cpp b/contracts/eosio.system/src/rex.cpp new file mode 100644 index 000000000..dee9c0ab8 --- /dev/null +++ b/contracts/eosio.system/src/rex.cpp @@ -0,0 +1,1221 @@ +#include +#include +#include + +namespace eosiosystem { + + using eosio::current_time_point; + using eosio::token; + using eosio::seconds; + + void system_contract::deposit( const name& owner, const asset& amount ) + { + require_auth( owner ); + + check( amount.symbol == core_symbol(), "must deposit core token" ); + check( 0 < amount.amount, "must deposit a positive amount" ); + // inline transfer from owner's token balance + { + token::transfer_action transfer_act{ token_account, { owner, active_permission } }; + transfer_act.send( owner, rex_account, amount, "deposit to REX fund" ); + } + transfer_to_fund( owner, amount ); + } + + void system_contract::withdraw( const name& owner, const asset& amount ) + { + require_auth( owner ); + + check( amount.symbol == core_symbol(), "must withdraw core token" ); + check( 0 < amount.amount, "must withdraw a positive amount" ); + update_rex_account( owner, asset( 0, core_symbol() ), asset( 0, core_symbol() ) ); + transfer_from_fund( owner, amount ); + // inline transfer to owner's token balance + { + token::transfer_action transfer_act{ token_account, { rex_account, active_permission } }; + transfer_act.send( rex_account, owner, amount, "withdraw from REX fund" ); + } + } + + void system_contract::buyrex( const name& from, const asset& amount ) + { + require_auth( from ); + + check( amount.symbol == core_symbol(), "asset must be core token" ); + check( 0 < amount.amount, "must use positive amount" ); + check_voting_requirement( from ); + transfer_from_fund( from, amount ); + const asset rex_received = add_to_rex_pool( amount ); + const asset delta_rex_stake = add_to_rex_balance( from, amount, rex_received ); + runrex(2); + update_rex_account( from, asset( 0, core_symbol() ), delta_rex_stake ); + // dummy action added so that amount of REX tokens purchased shows up in action trace + rex_results::buyresult_action buyrex_act( rex_account, std::vector{ } ); + buyrex_act.send( rex_received ); + } + + void system_contract::unstaketorex( const name& owner, const name& receiver, const asset& from_net, const asset& from_cpu ) + { + require_auth( owner ); + + check( from_net.symbol == core_symbol() && from_cpu.symbol == core_symbol(), "asset must be core token" ); + check( (0 <= from_net.amount) && (0 <= from_cpu.amount) && (0 < from_net.amount || 0 < from_cpu.amount), + "must unstake a positive amount to buy rex" ); + check_voting_requirement( owner ); + + { + del_bandwidth_table dbw_table( get_self(), owner.value ); + auto del_itr = dbw_table.require_find( receiver.value, "delegated bandwidth record does not exist" ); + check( from_net.amount <= del_itr->net_weight.amount, "amount exceeds tokens staked for net"); + check( from_cpu.amount <= del_itr->cpu_weight.amount, "amount exceeds tokens staked for cpu"); + dbw_table.modify( del_itr, same_payer, [&]( delegated_bandwidth& dbw ) { + dbw.net_weight.amount -= from_net.amount; + dbw.cpu_weight.amount -= from_cpu.amount; + }); + if ( del_itr->is_empty() ) { + dbw_table.erase( del_itr ); + } + } + + update_resource_limits( name(0), receiver, -from_net.amount, -from_cpu.amount ); + + const asset payment = from_net + from_cpu; + // inline transfer from stake_account to rex_account + { + token::transfer_action transfer_act{ token_account, { stake_account, active_permission } }; + transfer_act.send( stake_account, rex_account, payment, "buy REX with staked tokens" ); + } + const asset rex_received = add_to_rex_pool( payment ); + add_to_rex_balance( owner, payment, rex_received ); + runrex(2); + update_rex_account( owner, asset( 0, core_symbol() ), asset( 0, core_symbol() ), true ); + // dummy action added so that amount of REX tokens purchased shows up in action trace + rex_results::buyresult_action buyrex_act( rex_account, std::vector{ } ); + buyrex_act.send( rex_received ); + } + + void system_contract::sellrex( const name& from, const asset& rex ) + { + require_auth( from ); + + runrex(2); + + auto bitr = _rexbalance.require_find( from.value, "user must first buyrex" ); + check( rex.amount > 0 && rex.symbol == bitr->rex_balance.symbol, + "asset must be a positive amount of (REX, 4)" ); + process_rex_maturities( bitr ); + check( rex.amount <= bitr->matured_rex, "insufficient available rex" ); + + const auto current_order = fill_rex_order( bitr, rex ); + if ( current_order.success && current_order.proceeds.amount == 0 ) { + check( false, "proceeds are negligible" ); + } + asset pending_sell_order = update_rex_account( from, current_order.proceeds, current_order.stake_change ); + if ( !current_order.success ) { + if ( from == "b1"_n ) { + check( false, "b1 sellrex orders should not be queued" ); + } + /** + * REX order couldn't be filled and is added to queue. + * If account already has an open order, requested rex is added to existing order. + */ + auto oitr = _rexorders.find( from.value ); + if ( oitr == _rexorders.end() ) { + oitr = _rexorders.emplace( from, [&]( auto& order ) { + order.owner = from; + order.rex_requested = rex; + order.is_open = true; + order.proceeds = asset( 0, core_symbol() ); + order.stake_change = asset( 0, core_symbol() ); + order.order_time = current_time_point(); + }); + } else { + _rexorders.modify( oitr, same_payer, [&]( auto& order ) { + order.rex_requested.amount += rex.amount; + }); + } + pending_sell_order.amount = oitr->rex_requested.amount; + } + check( pending_sell_order.amount <= bitr->matured_rex, "insufficient funds for current and scheduled orders" ); + // dummy action added so that sell order proceeds show up in action trace + if ( current_order.success ) { + rex_results::sellresult_action sellrex_act( rex_account, std::vector{ } ); + sellrex_act.send( current_order.proceeds ); + } + } + + void system_contract::cnclrexorder( const name& owner ) + { + require_auth( owner ); + + auto itr = _rexorders.require_find( owner.value, "no sellrex order is scheduled" ); + check( itr->is_open, "sellrex order has been filled and cannot be canceled" ); + _rexorders.erase( itr ); + } + + void system_contract::rentcpu( const name& from, const name& receiver, const asset& loan_payment, const asset& loan_fund ) + { + require_auth( from ); + + rex_cpu_loan_table cpu_loans( get_self(), get_self().value ); + int64_t rented_tokens = rent_rex( cpu_loans, from, receiver, loan_payment, loan_fund ); + update_resource_limits( from, receiver, 0, rented_tokens ); + } + + void system_contract::rentnet( const name& from, const name& receiver, const asset& loan_payment, const asset& loan_fund ) + { + require_auth( from ); + + rex_net_loan_table net_loans( get_self(), get_self().value ); + int64_t rented_tokens = rent_rex( net_loans, from, receiver, loan_payment, loan_fund ); + update_resource_limits( from, receiver, rented_tokens, 0 ); + } + + void system_contract::fundcpuloan( const name& from, uint64_t loan_num, const asset& payment ) + { + require_auth( from ); + + rex_cpu_loan_table cpu_loans( get_self(), get_self().value ); + fund_rex_loan( cpu_loans, from, loan_num, payment ); + } + + void system_contract::fundnetloan( const name& from, uint64_t loan_num, const asset& payment ) + { + require_auth( from ); + + rex_net_loan_table net_loans( get_self(), get_self().value ); + fund_rex_loan( net_loans, from, loan_num, payment ); + } + + void system_contract::defcpuloan( const name& from, uint64_t loan_num, const asset& amount ) + { + require_auth( from ); + + rex_cpu_loan_table cpu_loans( get_self(), get_self().value ); + defund_rex_loan( cpu_loans, from, loan_num, amount ); + } + + void system_contract::defnetloan( const name& from, uint64_t loan_num, const asset& amount ) + { + require_auth( from ); + + rex_net_loan_table net_loans( get_self(), get_self().value ); + defund_rex_loan( net_loans, from, loan_num, amount ); + } + + void system_contract::updaterex( const name& owner ) + { + require_auth( owner ); + + runrex(2); + + auto itr = _rexbalance.require_find( owner.value, "account has no REX balance" ); + const asset init_stake = itr->vote_stake; + + auto rexp_itr = _rexpool.begin(); + const int64_t total_rex = rexp_itr->total_rex.amount; + const int64_t total_lendable = rexp_itr->total_lendable.amount; + const int64_t rex_balance = itr->rex_balance.amount; + + asset current_stake( 0, core_symbol() ); + if ( total_rex > 0 ) { + current_stake.amount = ( uint128_t(rex_balance) * total_lendable ) / total_rex; + } + _rexbalance.modify( itr, same_payer, [&]( auto& rb ) { + rb.vote_stake = current_stake; + }); + + update_rex_account( owner, asset( 0, core_symbol() ), current_stake - init_stake, true ); + process_rex_maturities( itr ); + } + + void system_contract::setrex( const asset& balance ) + { + require_auth( "eosio"_n ); + + check( balance.amount > 0, "balance must be set to have a positive amount" ); + check( balance.symbol == core_symbol(), "balance symbol must be core symbol" ); + check( rex_system_initialized(), "rex system is not initialized" ); + _rexpool.modify( _rexpool.begin(), same_payer, [&]( auto& pool ) { + pool.total_rent = balance; + }); + } + + void system_contract::rexexec( const name& user, uint16_t max ) + { + require_auth( user ); + + runrex( max ); + } + + void system_contract::consolidate( const name& owner ) + { + require_auth( owner ); + + runrex(2); + + auto bitr = _rexbalance.require_find( owner.value, "account has no REX balance" ); + asset rex_in_sell_order = update_rex_account( owner, asset( 0, core_symbol() ), asset( 0, core_symbol() ) ); + consolidate_rex_balance( bitr, rex_in_sell_order ); + } + + void system_contract::mvtosavings( const name& owner, const asset& rex ) + { + require_auth( owner ); + + runrex(2); + + auto bitr = _rexbalance.require_find( owner.value, "account has no REX balance" ); + check( rex.amount > 0 && rex.symbol == bitr->rex_balance.symbol, "asset must be a positive amount of (REX, 4)" ); + const asset rex_in_sell_order = update_rex_account( owner, asset( 0, core_symbol() ), asset( 0, core_symbol() ) ); + const int64_t rex_in_savings = read_rex_savings( bitr ); + check( rex.amount + rex_in_sell_order.amount + rex_in_savings <= bitr->rex_balance.amount, + "insufficient REX balance" ); + process_rex_maturities( bitr ); + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + int64_t moved_rex = 0; + while ( !rb.rex_maturities.empty() && moved_rex < rex.amount) { + const int64_t drex = std::min( rex.amount - moved_rex, rb.rex_maturities.back().second ); + rb.rex_maturities.back().second -= drex; + moved_rex += drex; + if ( rb.rex_maturities.back().second == 0 ) { + rb.rex_maturities.pop_back(); + } + } + if ( moved_rex < rex.amount ) { + const int64_t drex = rex.amount - moved_rex; + rb.matured_rex -= drex; + moved_rex += drex; + check( rex_in_sell_order.amount <= rb.matured_rex, "logic error in mvtosavings" ); + } + check( moved_rex == rex.amount, "programmer error in mvtosavings" ); + }); + put_rex_savings( bitr, rex_in_savings + rex.amount ); + } + + void system_contract::mvfrsavings( const name& owner, const asset& rex ) + { + require_auth( owner ); + + runrex(2); + + auto bitr = _rexbalance.require_find( owner.value, "account has no REX balance" ); + check( rex.amount > 0 && rex.symbol == bitr->rex_balance.symbol, "asset must be a positive amount of (REX, 4)" ); + const int64_t rex_in_savings = read_rex_savings( bitr ); + check( rex.amount <= rex_in_savings, "insufficient REX in savings" ); + process_rex_maturities( bitr ); + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + const time_point_sec maturity = get_rex_maturity(); + if ( !rb.rex_maturities.empty() && rb.rex_maturities.back().first == maturity ) { + rb.rex_maturities.back().second += rex.amount; + } else { + rb.rex_maturities.emplace_back( maturity, rex.amount ); + } + }); + put_rex_savings( bitr, rex_in_savings - rex.amount ); + update_rex_account( owner, asset( 0, core_symbol() ), asset( 0, core_symbol() ) ); + } + + void system_contract::closerex( const name& owner ) + { + require_auth( owner ); + + if ( rex_system_initialized() ) + runrex(2); + + update_rex_account( owner, asset( 0, core_symbol() ), asset( 0, core_symbol() ) ); + + /// check for any outstanding loans or rex fund + { + rex_cpu_loan_table cpu_loans( get_self(), get_self().value ); + auto cpu_idx = cpu_loans.get_index<"byowner"_n>(); + bool no_outstanding_cpu_loans = ( cpu_idx.find( owner.value ) == cpu_idx.end() ); + + rex_net_loan_table net_loans( get_self(), get_self().value ); + auto net_idx = net_loans.get_index<"byowner"_n>(); + bool no_outstanding_net_loans = ( net_idx.find( owner.value ) == net_idx.end() ); + + auto fund_itr = _rexfunds.find( owner.value ); + bool no_outstanding_rex_fund = ( fund_itr != _rexfunds.end() ) && ( fund_itr->balance.amount == 0 ); + + if ( no_outstanding_cpu_loans && no_outstanding_net_loans && no_outstanding_rex_fund ) { + _rexfunds.erase( fund_itr ); + } + } + + /// check for remaining rex balance + { + auto rex_itr = _rexbalance.find( owner.value ); + if ( rex_itr != _rexbalance.end() ) { + check( rex_itr->rex_balance.amount == 0, "account has remaining REX balance, must sell first"); + _rexbalance.erase( rex_itr ); + } + } + } + + /** + * @brief Updates account NET and CPU resource limits + * + * @param from - account charged for RAM if there is a need + * @param receiver - account whose resource limits are updated + * @param delta_net - change in NET bandwidth limit + * @param delta_cpu - change in CPU bandwidth limit + */ + void system_contract::update_resource_limits( const name& from, const name& receiver, int64_t delta_net, int64_t delta_cpu ) + { + if ( delta_cpu == 0 && delta_net == 0 ) { // nothing to update + return; + } + + user_resources_table totals_tbl( get_self(), receiver.value ); + auto tot_itr = totals_tbl.find( receiver.value ); + if ( tot_itr == totals_tbl.end() ) { + check( 0 <= delta_net && 0 <= delta_cpu, "logic error, should not occur"); + tot_itr = totals_tbl.emplace( from, [&]( auto& tot ) { + tot.owner = receiver; + tot.net_weight = asset( delta_net, core_symbol() ); + tot.cpu_weight = asset( delta_cpu, core_symbol() ); + }); + } else { + totals_tbl.modify( tot_itr, same_payer, [&]( auto& tot ) { + tot.net_weight.amount += delta_net; + tot.cpu_weight.amount += delta_cpu; + }); + } + check( 0 <= tot_itr->net_weight.amount, "insufficient staked total net bandwidth" ); + check( 0 <= tot_itr->cpu_weight.amount, "insufficient staked total cpu bandwidth" ); + + { + bool net_managed = false; + bool cpu_managed = false; + + auto voter_itr = _voters.find( receiver.value ); + if( voter_itr != _voters.end() ) { + net_managed = has_field( voter_itr->flags1, voter_info::flags1_fields::net_managed ); + cpu_managed = has_field( voter_itr->flags1, voter_info::flags1_fields::cpu_managed ); + } + + if( !(net_managed && cpu_managed) ) { + int64_t ram_bytes = 0, net = 0, cpu = 0; + get_resource_limits( receiver, ram_bytes, net, cpu ); + + set_resource_limits( receiver, + ram_bytes, + net_managed ? net : tot_itr->net_weight.amount, + cpu_managed ? cpu : tot_itr->cpu_weight.amount ); + } + } + + if ( tot_itr->is_empty() ) { + totals_tbl.erase( tot_itr ); + } + } + + /** + * @brief Checks if account satisfies voting requirement (voting for a proxy or 21 producers) + * for buying REX + * + * @param owner - account buying or already holding REX tokens + * @err_msg - error message + */ + void system_contract::check_voting_requirement( const name& owner, const char* error_msg )const + { + auto vitr = _voters.find( owner.value ); + check( vitr != _voters.end() && ( vitr->proxy || 21 <= vitr->producers.size() ), error_msg ); + } + + /** + * @brief Checks if CPU and Network loans are available + * + * Loans are available if 1) REX pool lendable balance is nonempty, and 2) there are no + * unfilled sellrex orders. + */ + bool system_contract::rex_loans_available()const + { + if ( !rex_available() ) { + return false; + } else { + if ( _rexorders.begin() == _rexorders.end() ) { + return true; // no outstanding sellrex orders + } else { + auto idx = _rexorders.get_index<"bytime"_n>(); + return !idx.begin()->is_open; // no outstanding unfilled sellrex orders + } + } + } + + /** + * @brief Updates rex_pool balances upon creating a new loan or renewing an existing one + * + * @param payment - loan fee paid + * @param rented_tokens - amount of tokens to be staked to loan receiver + * @param new_loan - flag indicating whether the loan is new or being renewed + */ + void system_contract::add_loan_to_rex_pool( const asset& payment, int64_t rented_tokens, bool new_loan ) + { + add_to_rex_return_pool( payment ); + _rexpool.modify( _rexpool.begin(), same_payer, [&]( auto& rt ) { + // add payment to total_rent + rt.total_rent.amount += payment.amount; + // move rented_tokens from total_unlent to total_lent + rt.total_unlent.amount -= rented_tokens; + rt.total_lent.amount += rented_tokens; + // increment loan_num if a new loan is being created + if ( new_loan ) { + rt.loan_num++; + } + }); + } + + /** + * @brief Updates rex_pool balances upon closing an expired loan + * + * @param loan - loan to be closed + */ + void system_contract::remove_loan_from_rex_pool( const rex_loan& loan ) + { + const auto& pool = _rexpool.begin(); + const int64_t delta_total_rent = exchange_state::get_bancor_output( pool->total_unlent.amount, + pool->total_rent.amount, + loan.total_staked.amount ); + _rexpool.modify( pool, same_payer, [&]( auto& rt ) { + // deduct calculated delta_total_rent from total_rent + rt.total_rent.amount -= delta_total_rent; + // move rented tokens from total_lent to total_unlent + rt.total_unlent.amount += loan.total_staked.amount; + rt.total_lent.amount -= loan.total_staked.amount; + rt.total_lendable.amount = rt.total_unlent.amount + rt.total_lent.amount; + }); + } + + /** + * @brief Updates the fields of an existing loan that is being renewed + */ + template + int64_t system_contract::update_renewed_loan( Index& idx, const Iterator& itr, int64_t rented_tokens ) + { + int64_t delta_stake = rented_tokens - itr->total_staked.amount; + idx.modify ( itr, same_payer, [&]( auto& loan ) { + loan.total_staked.amount = rented_tokens; + loan.expiration += eosio::days(30); + loan.balance.amount -= loan.payment.amount; + }); + return delta_stake; + } + + /** + * @brief Performs maintenance operations on expired NET and CPU loans and sellrex orders + * + * @param max - maximum number of each of the three categories to be processed + */ + void system_contract::runrex( uint16_t max ) + { + check( rex_system_initialized(), "rex system not initialized yet" ); + + update_rex_pool(); + + const auto& pool = _rexpool.begin(); + + auto process_expired_loan = [&]( auto& idx, const auto& itr ) -> std::pair { + /// update rex_pool in order to delete existing loan + remove_loan_from_rex_pool( *itr ); + bool delete_loan = false; + int64_t delta_stake = 0; + /// calculate rented tokens at current price + int64_t rented_tokens = exchange_state::get_bancor_output( pool->total_rent.amount, + pool->total_unlent.amount, + itr->payment.amount ); + /// conditions for loan renewal + bool renew_loan = itr->payment <= itr->balance /// loan has sufficient balance + && itr->payment.amount < rented_tokens /// loan has favorable return + && rex_loans_available(); /// no pending sell orders + if ( renew_loan ) { + /// update rex_pool in order to account for renewed loan + add_loan_to_rex_pool( itr->payment, rented_tokens, false ); + /// update renewed loan fields + delta_stake = update_renewed_loan( idx, itr, rented_tokens ); + } else { + delete_loan = true; + delta_stake = -( itr->total_staked.amount ); + /// refund "from" account if the closed loan balance is positive + if ( itr->balance.amount > 0 ) { + transfer_to_fund( itr->from, itr->balance ); + } + } + + return { delete_loan, delta_stake }; + }; + + /// transfer from eosio.names to eosio.rex + if ( pool->namebid_proceeds.amount > 0 ) { + channel_to_rex( names_account, pool->namebid_proceeds ); + _rexpool.modify( pool, same_payer, [&]( auto& rt ) { + rt.namebid_proceeds.amount = 0; + }); + } + + /// process cpu loans + { + rex_cpu_loan_table cpu_loans( get_self(), get_self().value ); + auto cpu_idx = cpu_loans.get_index<"byexpr"_n>(); + for ( uint16_t i = 0; i < max; ++i ) { + auto itr = cpu_idx.begin(); + if ( itr == cpu_idx.end() || itr->expiration > current_time_point() ) break; + + auto result = process_expired_loan( cpu_idx, itr ); + if ( result.second != 0 ) + update_resource_limits( itr->from, itr->receiver, 0, result.second ); + + if ( result.first ) + cpu_idx.erase( itr ); + } + } + + /// process net loans + { + rex_net_loan_table net_loans( get_self(), get_self().value ); + auto net_idx = net_loans.get_index<"byexpr"_n>(); + for ( uint16_t i = 0; i < max; ++i ) { + auto itr = net_idx.begin(); + if ( itr == net_idx.end() || itr->expiration > current_time_point() ) break; + + auto result = process_expired_loan( net_idx, itr ); + if ( result.second != 0 ) + update_resource_limits( itr->from, itr->receiver, result.second, 0 ); + + if ( result.first ) + net_idx.erase( itr ); + } + } + + /// process sellrex orders + if ( _rexorders.begin() != _rexorders.end() ) { + auto idx = _rexorders.get_index<"bytime"_n>(); + auto oitr = idx.begin(); + for ( uint16_t i = 0; i < max; ++i ) { + if ( oitr == idx.end() || !oitr->is_open ) break; + auto next = oitr; + ++next; + auto bitr = _rexbalance.find( oitr->owner.value ); + if ( bitr != _rexbalance.end() ) { // should always be true + auto result = fill_rex_order( bitr, oitr->rex_requested ); + if ( result.success ) { + const name order_owner = oitr->owner; + idx.modify( oitr, same_payer, [&]( auto& order ) { + order.proceeds.amount = result.proceeds.amount; + order.stake_change.amount = result.stake_change.amount; + order.close(); + }); + /// send dummy action to show owner and proceeds of filled sellrex order + rex_results::orderresult_action order_act( rex_account, std::vector{ } ); + order_act.send( order_owner, result.proceeds ); + } + } + oitr = next; + } + } + + } + + /** + * @brief Adds returns from the REX return pool to the REX pool + */ + void system_contract::update_rex_pool() + { + auto get_elapsed_intervals = [&]( const time_point_sec& t1, const time_point_sec& t0 ) -> uint32_t { + return ( t1.sec_since_epoch() - t0.sec_since_epoch() ) / rex_return_pool::dist_interval; + }; + + const time_point_sec ct = current_time_point(); + const uint32_t cts = ct.sec_since_epoch(); + const time_point_sec effective_time{cts - cts % rex_return_pool::dist_interval}; + + const auto ret_pool_elem = _rexretpool.begin(); + const auto ret_buckets_elem = _rexretbuckets.begin(); + + if ( ret_pool_elem == _rexretpool.end() || effective_time <= ret_pool_elem->last_dist_time ) { + return; + } + + const int64_t current_rate = ret_pool_elem->current_rate_of_increase; + const uint32_t elapsed_intervals = get_elapsed_intervals( effective_time, ret_pool_elem->last_dist_time ); + int64_t change_estimate = current_rate * elapsed_intervals; + + { + const bool new_return_bucket = ret_pool_elem->pending_bucket_time <= effective_time; + int64_t new_bucket_rate = 0; + time_point_sec new_bucket_time = time_point_sec::min(); + _rexretpool.modify( ret_pool_elem, same_payer, [&]( auto& rp ) { + if ( new_return_bucket ) { + int64_t remainder = rp.pending_bucket_proceeds % rex_return_pool::total_intervals; + new_bucket_rate = ( rp.pending_bucket_proceeds - remainder ) / rex_return_pool::total_intervals; + new_bucket_time = rp.pending_bucket_time; + rp.current_rate_of_increase += new_bucket_rate; + change_estimate += remainder + new_bucket_rate * get_elapsed_intervals( effective_time, rp.pending_bucket_time ); + rp.pending_bucket_proceeds = 0; + rp.pending_bucket_time = time_point_sec::maximum(); + if ( new_bucket_time < rp.oldest_bucket_time ) { + rp.oldest_bucket_time = new_bucket_time; + } + } + rp.proceeds -= change_estimate; + rp.last_dist_time = effective_time; + }); + + if ( new_return_bucket ) { + _rexretbuckets.modify( ret_buckets_elem, same_payer, [&]( auto& rb ) { + rb.return_buckets[new_bucket_time] = new_bucket_rate; + }); + } + } + + const time_point_sec time_threshold = effective_time - seconds(rex_return_pool::total_intervals * rex_return_pool::dist_interval); + if ( ret_pool_elem->oldest_bucket_time <= time_threshold ) { + int64_t expired_rate = 0; + int64_t surplus = 0; + _rexretbuckets.modify( ret_buckets_elem, same_payer, [&]( auto& rb ) { + auto& return_buckets = rb.return_buckets; + auto iter = return_buckets.begin(); + while ( iter != return_buckets.end() && iter->first <= time_threshold ) { + auto next = iter; + ++next; + const uint32_t overtime = get_elapsed_intervals( effective_time, + iter->first + seconds(rex_return_pool::total_intervals * rex_return_pool::dist_interval) ); + surplus += iter->second * overtime; + expired_rate += iter->second; + return_buckets.erase(iter); + iter = next; + } + }); + + _rexretpool.modify( ret_pool_elem, same_payer, [&]( auto& rp ) { + if ( !ret_buckets_elem->return_buckets.empty() ) { + rp.oldest_bucket_time = ret_buckets_elem->return_buckets.begin()->first; + } else { + rp.oldest_bucket_time = time_point_sec::min(); + } + if ( expired_rate > 0) { + rp.current_rate_of_increase -= expired_rate; + } + if ( surplus > 0 ) { + change_estimate -= surplus; + rp.proceeds += surplus; + } + }); + } + + if ( change_estimate > 0 && ret_pool_elem->proceeds < 0 ) { + _rexretpool.modify( ret_pool_elem, same_payer, [&]( auto& rp ) { + change_estimate += rp.proceeds; + rp.proceeds = 0; + }); + } + + if ( change_estimate > 0 ) { + _rexpool.modify( _rexpool.begin(), same_payer, [&]( auto& pool ) { + pool.total_unlent.amount += change_estimate; + pool.total_lendable = pool.total_unlent + pool.total_lent; + }); + } + } + + template + int64_t system_contract::rent_rex( T& table, const name& from, const name& receiver, const asset& payment, const asset& fund ) + { + runrex(2); + + check( rex_loans_available(), "rex loans are currently not available" ); + check( payment.symbol == core_symbol() && fund.symbol == core_symbol(), "must use core token" ); + check( 0 < payment.amount && 0 <= fund.amount, "must use positive asset amount" ); + + transfer_from_fund( from, payment + fund ); + + const auto& pool = _rexpool.begin(); /// already checked that _rexpool.begin() != _rexpool.end() in rex_loans_available() + + int64_t rented_tokens = exchange_state::get_bancor_output( pool->total_rent.amount, + pool->total_unlent.amount, + payment.amount ); + check( payment.amount < rented_tokens, "loan price does not favor renting" ); + add_loan_to_rex_pool( payment, rented_tokens, true ); + + table.emplace( from, [&]( auto& c ) { + c.from = from; + c.receiver = receiver; + c.payment = payment; + c.balance = fund; + c.total_staked = asset( rented_tokens, core_symbol() ); + c.expiration = current_time_point() + eosio::days(30); + c.loan_num = pool->loan_num; + }); + + rex_results::rentresult_action rentresult_act{ rex_account, std::vector{ } }; + rentresult_act.send( asset{ rented_tokens, core_symbol() } ); + return rented_tokens; + } + + /** + * @brief Processes a sellrex order and returns object containing the results + * + * Processes an incoming or already scheduled sellrex order. If REX pool has enough core + * tokens not frozen in loans, order is filled. In this case, REX pool totals, user rex_balance + * and user vote_stake are updated. However, this function does not update user voting power. The + * function returns success flag, order proceeds, and vote stake delta. These are used later in a + * different function to complete order processing, i.e. transfer proceeds to user REX fund and + * update user vote weight. + * + * @param bitr - iterator pointing to rex_balance database record + * @param rex - amount of rex to be sold + * + * @return rex_order_outcome - a struct containing success flag, order proceeds, and resultant + * vote stake change + */ + rex_order_outcome system_contract::fill_rex_order( const rex_balance_table::const_iterator& bitr, const asset& rex ) + { + auto rexitr = _rexpool.begin(); + const int64_t S0 = rexitr->total_lendable.amount; + const int64_t R0 = rexitr->total_rex.amount; + const int64_t p = (uint128_t(rex.amount) * S0) / R0; + const int64_t R1 = R0 - rex.amount; + const int64_t S1 = S0 - p; + asset proceeds( p, core_symbol() ); + asset stake_change( 0, core_symbol() ); + bool success = false; + + const int64_t unlent_lower_bound = rexitr->total_lent.amount / 10; + const int64_t available_unlent = rexitr->total_unlent.amount - unlent_lower_bound; // available_unlent <= 0 is possible + if ( proceeds.amount <= available_unlent ) { + const int64_t init_vote_stake_amount = bitr->vote_stake.amount; + const int64_t current_stake_value = ( uint128_t(bitr->rex_balance.amount) * S0 ) / R0; + _rexpool.modify( rexitr, same_payer, [&]( auto& rt ) { + rt.total_rex.amount = R1; + rt.total_lendable.amount = S1; + rt.total_unlent.amount = rt.total_lendable.amount - rt.total_lent.amount; + }); + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + rb.vote_stake.amount = current_stake_value - proceeds.amount; + rb.rex_balance.amount -= rex.amount; + rb.matured_rex -= rex.amount; + }); + stake_change.amount = bitr->vote_stake.amount - init_vote_stake_amount; + success = true; + } else { + proceeds.amount = 0; + } + + return { success, proceeds, stake_change }; + } + + template + void system_contract::fund_rex_loan( T& table, const name& from, uint64_t loan_num, const asset& payment ) + { + check( payment.symbol == core_symbol(), "must use core token" ); + transfer_from_fund( from, payment ); + auto itr = table.require_find( loan_num, "loan not found" ); + check( itr->from == from, "user must be loan creator" ); + check( itr->expiration > current_time_point(), "loan has already expired" ); + table.modify( itr, same_payer, [&]( auto& loan ) { + loan.balance.amount += payment.amount; + }); + } + + template + void system_contract::defund_rex_loan( T& table, const name& from, uint64_t loan_num, const asset& amount ) + { + check( amount.symbol == core_symbol(), "must use core token" ); + auto itr = table.require_find( loan_num, "loan not found" ); + check( itr->from == from, "user must be loan creator" ); + check( itr->expiration > current_time_point(), "loan has already expired" ); + check( itr->balance >= amount, "insufficent loan balance" ); + table.modify( itr, same_payer, [&]( auto& loan ) { + loan.balance.amount -= amount.amount; + }); + transfer_to_fund( from, amount ); + } + + /** + * @brief Transfers tokens from owner REX fund + * + * @pre - owner REX fund has sufficient balance + * + * @param owner - owner account name + * @param amount - tokens to be transfered out of REX fund + */ + void system_contract::transfer_from_fund( const name& owner, const asset& amount ) + { + check( 0 < amount.amount && amount.symbol == core_symbol(), "must transfer positive amount from REX fund" ); + auto itr = _rexfunds.require_find( owner.value, "must deposit to REX fund first" ); + check( amount <= itr->balance, "insufficient funds" ); + _rexfunds.modify( itr, same_payer, [&]( auto& fund ) { + fund.balance.amount -= amount.amount; + }); + } + + /** + * @brief Transfers tokens to owner REX fund + * + * @param owner - owner account name + * @param amount - tokens to be transfered to REX fund + */ + void system_contract::transfer_to_fund( const name& owner, const asset& amount ) + { + check( 0 < amount.amount && amount.symbol == core_symbol(), "must transfer positive amount to REX fund" ); + auto itr = _rexfunds.find( owner.value ); + if ( itr == _rexfunds.end() ) { + _rexfunds.emplace( owner, [&]( auto& fund ) { + fund.owner = owner; + fund.balance = amount; + }); + } else { + _rexfunds.modify( itr, same_payer, [&]( auto& fund ) { + fund.balance.amount += amount.amount; + }); + } + } + + /** + * @brief Processes owner filled sellrex order and updates vote weight + * + * Checks if user has a scheduled sellrex order that has been filled, completes its processing, + * and deletes it. Processing entails transfering proceeds to user REX fund and updating user + * vote weight. Additional proceeds and stake change can be passed as arguments. This function + * is called only by actions pushed by owner. + * + * @param owner - owner account name + * @param proceeds - additional proceeds to be transfered to owner REX fund + * @param delta_stake - additional stake to be added to owner vote weight + * @param force_vote_update - if true, vote weight is updated even if vote stake didn't change + * + * @return asset - REX amount of owner unfilled sell order if one exists + */ + asset system_contract::update_rex_account( const name& owner, const asset& proceeds, const asset& delta_stake, bool force_vote_update ) + { + asset to_fund( proceeds ); + asset to_stake( delta_stake ); + asset rex_in_sell_order( 0, rex_symbol ); + auto itr = _rexorders.find( owner.value ); + if ( itr != _rexorders.end() ) { + if ( itr->is_open ) { + rex_in_sell_order.amount = itr->rex_requested.amount; + } else { + to_fund.amount += itr->proceeds.amount; + to_stake.amount += itr->stake_change.amount; + _rexorders.erase( itr ); + } + } + + if ( to_fund.amount > 0 ) + transfer_to_fund( owner, to_fund ); + if ( force_vote_update || to_stake.amount != 0 ) + update_voting_power( owner, to_stake ); + + return rex_in_sell_order; + } + + /** + * @brief Channels system fees to REX pool + * + * @param from - account from which asset is transfered to REX pool + * @param amount - amount of tokens to be transfered + * @param required - if true, asserts when the system is not configured to channel fees into REX + */ + void system_contract::channel_to_rex( const name& from, const asset& amount, bool required ) + { +#if CHANNEL_RAM_AND_NAMEBID_FEES_TO_REX + if ( rex_available() ) { + add_to_rex_return_pool( amount ); + // inline transfer to rex_account + token::transfer_action transfer_act{ token_account, { from, active_permission } }; + transfer_act.send( from, rex_account, amount, + std::string("transfer from ") + from.to_string() + " to eosio.rex" ); + return; + } +#endif + eosio::check( !required, "can't channel fees to rex" ); + } + + /** + * @brief Updates namebid proceeds to be transfered to REX pool + * + * @param highest_bid - highest bidding amount of closed namebid + */ + void system_contract::channel_namebid_to_rex( const int64_t highest_bid ) + { +#if CHANNEL_RAM_AND_NAMEBID_FEES_TO_REX + if ( rex_available() ) { + _rexpool.modify( _rexpool.begin(), same_payer, [&]( auto& rp ) { + rp.namebid_proceeds.amount += highest_bid; + }); + } +#endif + } + + /** + * @brief Calculates maturity time of purchased REX tokens which is 4 days from end + * of the day UTC + * + * @return time_point_sec + */ + time_point_sec system_contract::get_rex_maturity() + { + const uint32_t num_of_maturity_buckets = 5; + static const uint32_t now = current_time_point().sec_since_epoch(); + static const uint32_t r = now % seconds_per_day; + static const time_point_sec rms{ now - r + num_of_maturity_buckets * seconds_per_day }; + return rms; + } + + /** + * @brief Updates REX owner maturity buckets + * + * @param bitr - iterator pointing to rex_balance object + */ + void system_contract::process_rex_maturities( const rex_balance_table::const_iterator& bitr ) + { + const time_point_sec now = current_time_point(); + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + while ( !rb.rex_maturities.empty() && rb.rex_maturities.front().first <= now ) { + rb.matured_rex += rb.rex_maturities.front().second; + rb.rex_maturities.pop_front(); + } + }); + } + + /** + * @brief Consolidates REX maturity buckets into one + * + * @param bitr - iterator pointing to rex_balance object + * @param rex_in_sell_order - REX tokens in owner unfilled sell order, if one exists + */ + void system_contract::consolidate_rex_balance( const rex_balance_table::const_iterator& bitr, + const asset& rex_in_sell_order ) + { + const int64_t rex_in_savings = read_rex_savings( bitr ); + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + int64_t total = rb.matured_rex - rex_in_sell_order.amount; + rb.matured_rex = rex_in_sell_order.amount; + while ( !rb.rex_maturities.empty() ) { + total += rb.rex_maturities.front().second; + rb.rex_maturities.pop_front(); + } + if ( total > 0 ) { + rb.rex_maturities.emplace_back( get_rex_maturity(), total ); + } + }); + put_rex_savings( bitr, rex_in_savings ); + } + + /** + * @brief Updates REX pool balances upon REX purchase + * + * @param payment - amount of core tokens paid + * + * @return asset - calculated amount of REX tokens purchased + */ + asset system_contract::add_to_rex_pool( const asset& payment ) + { + /** + * If CORE_SYMBOL is (EOS,4), maximum supply is 10^10 tokens (10 billion tokens), i.e., maximum amount + * of indivisible units is 10^14. rex_ratio = 10^4 sets the upper bound on (REX,4) indivisible units to + * 10^18 and that is within the maximum allowable amount field of asset type which is set to 2^62 + * (approximately 4.6 * 10^18). For a different CORE_SYMBOL, and in order for maximum (REX,4) amount not + * to exceed that limit, maximum amount of indivisible units cannot be set to a value larger than 4 * 10^14. + * If precision of CORE_SYMBOL is 4, that corresponds to a maximum supply of 40 billion tokens. + */ + const int64_t rex_ratio = 10000; + const asset init_total_rent( 20'000'0000, core_symbol() ); /// base balance prevents renting profitably until at least a minimum number of core_symbol() is made available + asset rex_received( 0, rex_symbol ); + auto itr = _rexpool.begin(); + if ( !rex_system_initialized() ) { + /// initialize REX pool + _rexpool.emplace( get_self(), [&]( auto& rp ) { + rex_received.amount = payment.amount * rex_ratio; + rp.total_lendable = payment; + rp.total_lent = asset( 0, core_symbol() ); + rp.total_unlent = rp.total_lendable - rp.total_lent; + rp.total_rent = init_total_rent; + rp.total_rex = rex_received; + rp.namebid_proceeds = asset( 0, core_symbol() ); + }); + } else if ( !rex_available() ) { /// should be a rare corner case, REX pool is initialized but empty + _rexpool.modify( itr, same_payer, [&]( auto& rp ) { + rex_received.amount = payment.amount * rex_ratio; + rp.total_lendable.amount = payment.amount; + rp.total_lent.amount = 0; + rp.total_unlent.amount = rp.total_lendable.amount - rp.total_lent.amount; + rp.total_rent.amount = init_total_rent.amount; + rp.total_rex.amount = rex_received.amount; + }); + } else { + /// total_lendable > 0 if total_rex > 0 except in a rare case and due to rounding errors + check( itr->total_lendable.amount > 0, "lendable REX pool is empty" ); + const int64_t S0 = itr->total_lendable.amount; + const int64_t S1 = S0 + payment.amount; + const int64_t R0 = itr->total_rex.amount; + const int64_t R1 = (uint128_t(S1) * R0) / S0; + rex_received.amount = R1 - R0; + _rexpool.modify( itr, same_payer, [&]( auto& rp ) { + rp.total_lendable.amount = S1; + rp.total_rex.amount = R1; + rp.total_unlent.amount = rp.total_lendable.amount - rp.total_lent.amount; + check( rp.total_unlent.amount >= 0, "programmer error, this should never go negative" ); + }); + } + + return rex_received; + } + + /** + * @brief Adds an amount of core tokens to the REX return pool + * + * @param fee - amount to be added + */ + void system_contract::add_to_rex_return_pool( const asset& fee ) + { + update_rex_pool(); + if ( fee.amount <= 0 ) { + return; + } + + const time_point_sec ct = current_time_point(); + const uint32_t cts = ct.sec_since_epoch(); + const uint32_t bucket_interval = rex_return_pool::hours_per_bucket * seconds_per_hour; + const time_point_sec effective_time{cts - cts % bucket_interval + bucket_interval}; + const auto return_pool_elem = _rexretpool.begin(); + if ( return_pool_elem == _rexretpool.end() ) { + _rexretpool.emplace( get_self(), [&]( auto& rp ) { + rp.last_dist_time = effective_time; + rp.pending_bucket_proceeds = fee.amount; + rp.pending_bucket_time = effective_time; + rp.proceeds = fee.amount; + }); + _rexretbuckets.emplace( get_self(), [&]( auto& rb ) { } ); + } else { + _rexretpool.modify( return_pool_elem, same_payer, [&]( auto& rp ) { + rp.pending_bucket_proceeds += fee.amount; + rp.proceeds += fee.amount; + if ( rp.pending_bucket_time == time_point_sec::maximum() ) { + rp.pending_bucket_time = effective_time; + } + }); + } + } + + /** + * @brief Updates owner REX balance upon buying REX tokens + * + * @param owner - account name of REX owner + * @param payment - amount core tokens paid to buy REX + * @param rex_received - amount of purchased REX tokens + * + * @return asset - change in owner REX vote stake + */ + asset system_contract::add_to_rex_balance( const name& owner, const asset& payment, const asset& rex_received ) + { + asset init_rex_stake( 0, core_symbol() ); + asset current_rex_stake( 0, core_symbol() ); + auto bitr = _rexbalance.find( owner.value ); + if ( bitr == _rexbalance.end() ) { + bitr = _rexbalance.emplace( owner, [&]( auto& rb ) { + rb.owner = owner; + rb.vote_stake = payment; + rb.rex_balance = rex_received; + }); + current_rex_stake.amount = payment.amount; + } else { + init_rex_stake.amount = bitr->vote_stake.amount; + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + rb.rex_balance.amount += rex_received.amount; + rb.vote_stake.amount = ( uint128_t(rb.rex_balance.amount) * _rexpool.begin()->total_lendable.amount ) + / _rexpool.begin()->total_rex.amount; + }); + current_rex_stake.amount = bitr->vote_stake.amount; + } + + const int64_t rex_in_savings = read_rex_savings( bitr ); + process_rex_maturities( bitr ); + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + const time_point_sec maturity = get_rex_maturity(); + if ( !rb.rex_maturities.empty() && rb.rex_maturities.back().first == maturity ) { + rb.rex_maturities.back().second += rex_received.amount; + } else { + rb.rex_maturities.emplace_back( maturity, rex_received.amount ); + } + }); + put_rex_savings( bitr, rex_in_savings ); + return current_rex_stake - init_rex_stake; + } + + /** + * @brief Reads amount of REX in savings bucket and removes the bucket from maturities + * + * Reads and (temporarily) removes REX savings bucket from REX maturities in order to + * allow uniform processing of remaining buckets as savings is a special case. This + * function is used in conjunction with put_rex_savings. + * + * @param bitr - iterator pointing to rex_balance object + * + * @return int64_t - amount of REX in savings bucket + */ + int64_t system_contract::read_rex_savings( const rex_balance_table::const_iterator& bitr ) + { + int64_t rex_in_savings = 0; + static const time_point_sec end_of_days = time_point_sec::maximum(); + if ( !bitr->rex_maturities.empty() && bitr->rex_maturities.back().first == end_of_days ) { + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + rex_in_savings = rb.rex_maturities.back().second; + rb.rex_maturities.pop_back(); + }); + } + return rex_in_savings; + } + + /** + * @brief Adds a specified REX amount to savings bucket + * + * @param bitr - iterator pointing to rex_balance object + * @param rex - amount of REX to be added + */ + void system_contract::put_rex_savings( const rex_balance_table::const_iterator& bitr, int64_t rex ) + { + if ( rex == 0 ) return; + static const time_point_sec end_of_days = time_point_sec::maximum(); + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + if ( !rb.rex_maturities.empty() && rb.rex_maturities.back().first == end_of_days ) { + rb.rex_maturities.back().second += rex; + } else { + rb.rex_maturities.emplace_back( end_of_days, rex ); + } + }); + } + + /** + * @brief Updates voter REX vote stake to the current value of REX tokens held + * + * @param voter - account name of voter + */ + void system_contract::update_rex_stake( const name& voter ) + { + int64_t delta_stake = 0; + auto bitr = _rexbalance.find( voter.value ); + if ( bitr != _rexbalance.end() && rex_available() ) { + asset init_vote_stake = bitr->vote_stake; + asset current_vote_stake( 0, core_symbol() ); + current_vote_stake.amount = ( uint128_t(bitr->rex_balance.amount) * _rexpool.begin()->total_lendable.amount ) + / _rexpool.begin()->total_rex.amount; + _rexbalance.modify( bitr, same_payer, [&]( auto& rb ) { + rb.vote_stake.amount = current_vote_stake.amount; + }); + delta_stake = current_vote_stake.amount - init_vote_stake.amount; + } + + if ( delta_stake != 0 ) { + auto vitr = _voters.find( voter.value ); + if ( vitr != _voters.end() ) { + _voters.modify( vitr, same_payer, [&]( auto& vinfo ) { + vinfo.staked += delta_stake; + }); + } + } + } + +}; /// namespace eosiosystem diff --git a/contracts/eosio.system/src/rex.results.cpp b/contracts/eosio.system/src/rex.results.cpp new file mode 100644 index 000000000..1aabca02c --- /dev/null +++ b/contracts/eosio.system/src/rex.results.cpp @@ -0,0 +1,11 @@ +#include + +void rex_results::buyresult( const asset& rex_received ) { } + +void rex_results::sellresult( const asset& proceeds ) { } + +void rex_results::orderresult( const name& owner, const asset& proceeds ) { } + +void rex_results::rentresult( const asset& rented_tokens ) { } + +extern "C" void apply( uint64_t, uint64_t, uint64_t ) { } diff --git a/eosio.system/src/voting.cpp b/contracts/eosio.system/src/voting.cpp similarity index 64% rename from eosio.system/src/voting.cpp rename to contracts/eosio.system/src/voting.cpp index 2ad099812..53bb29875 100644 --- a/eosio.system/src/voting.cpp +++ b/contracts/eosio.system/src/voting.cpp @@ -1,52 +1,49 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include +#include +#include #include #include namespace eosiosystem { - using eosio::indexed_by; + using eosio::const_mem_fun; - using eosio::print; + using eosio::current_time_point; + using eosio::indexed_by; + using eosio::microseconds; using eosio::singleton; - using eosio::transaction; - - /** - * This method will create a producer_config and producer_info object for 'producer' - * - * @pre producer is not already registered - * @pre producer to register is an account - * @pre authority of producer to register - * - */ - void system_contract::regproducer( const name producer, const eosio::public_key& producer_key, const std::string& url, uint16_t location ) { - eosio_assert( url.size() < 512, "url too long" ); - eosio_assert( producer_key != eosio::public_key(), "public key should not be the default value" ); - require_auth( producer ); + void system_contract::register_producer( const name& producer, const eosio::block_signing_authority& producer_authority, const std::string& url, uint16_t location ) { auto prod = _producers.find( producer.value ); const auto ct = current_time_point(); + eosio::public_key producer_key{}; + + std::visit( [&](auto&& auth ) { + if( auth.keys.size() == 1 ) { + // if the producer_authority consists of a single key, use that key in the legacy producer_key field + producer_key = auth.keys[0].key; + } + }, producer_authority ); + if ( prod != _producers.end() ) { _producers.modify( prod, producer, [&]( producer_info& info ){ - info.producer_key = producer_key; - info.is_active = true; - info.url = url; - info.location = location; + info.producer_key = producer_key; + info.is_active = true; + info.url = url; + info.location = location; + info.producer_authority.emplace( producer_authority ); if ( info.last_claim_time == time_point() ) info.last_claim_time = ct; }); @@ -62,13 +59,14 @@ namespace eosiosystem { } } else { _producers.emplace( producer, [&]( producer_info& info ){ - info.owner = producer; - info.total_votes = 0; - info.producer_key = producer_key; - info.is_active = true; - info.url = url; - info.location = location; - info.last_claim_time = ct; + info.owner = producer; + info.total_votes = 0; + info.producer_key = producer_key; + info.is_active = true; + info.url = url; + info.location = location; + info.last_claim_time = ct; + info.producer_authority.emplace( producer_authority ); }); _producers2.emplace( producer, [&]( producer_info2& info ){ info.owner = producer; @@ -78,7 +76,25 @@ namespace eosiosystem { } - void system_contract::unregprod( const name producer ) { + void system_contract::regproducer( const name& producer, const eosio::public_key& producer_key, const std::string& url, uint16_t location ) { + require_auth( producer ); + check( url.size() < 512, "url too long" ); + + register_producer( producer, convert_to_block_signing_authority( producer_key ), url, location ); + } + + void system_contract::regproducer2( const name& producer, const eosio::block_signing_authority& producer_authority, const std::string& url, uint16_t location ) { + require_auth( producer ); + check( url.size() < 512, "url too long" ); + + std::visit( [&](auto&& auth ) { + check( auth.is_valid(), "invalid producer authority" ); + }, producer_authority ); + + register_producer( producer, producer_authority, url, location ); + } + + void system_contract::unregprod( const name& producer ) { require_auth( producer ); const auto& prod = _producers.get( producer.value, "producer not found" ); @@ -87,45 +103,52 @@ namespace eosiosystem { }); } - void system_contract::update_elected_producers( block_timestamp block_time ) { + void system_contract::update_elected_producers( const block_timestamp& block_time ) { _gstate.last_producer_schedule_update = block_time; auto idx = _producers.get_index<"prototalvote"_n>(); - std::vector< std::pair > top_producers; + using value_type = std::pair; + std::vector< value_type > top_producers; top_producers.reserve(21); - for ( auto it = idx.cbegin(); it != idx.cend() && top_producers.size() < 21 && 0 < it->total_votes && it->active(); ++it ) { - top_producers.emplace_back( std::pair({{it->owner, it->producer_key}, it->location}) ); + for( auto it = idx.cbegin(); it != idx.cend() && top_producers.size() < 21 && 0 < it->total_votes && it->active(); ++it ) { + top_producers.emplace_back( + eosio::producer_authority{ + .producer_name = it->owner, + .authority = it->get_producer_authority() + }, + it->location + ); } - if ( top_producers.size() < _gstate.last_producer_schedule_size ) { + if( top_producers.size() == 0 || top_producers.size() < _gstate.last_producer_schedule_size ) { return; } - /// sort by producer name - std::sort( top_producers.begin(), top_producers.end() ); + std::sort( top_producers.begin(), top_producers.end(), []( const value_type& lhs, const value_type& rhs ) { + return lhs.first.producer_name < rhs.first.producer_name; // sort by producer name + // return lhs.second < rhs.second; // sort by location + } ); - std::vector producers; + std::vector producers; producers.reserve(top_producers.size()); - for( const auto& item : top_producers ) - producers.push_back(item.first); - - auto packed_schedule = pack(producers); + for( auto& item : top_producers ) + producers.push_back( std::move(item.first) ); - if( set_proposed_producers( packed_schedule.data(), packed_schedule.size() ) >= 0 ) { + if( set_proposed_producers( producers ) >= 0 ) { _gstate.last_producer_schedule_size = static_cast( top_producers.size() ); } } double stake2vote( int64_t staked ) { /// TODO subtract 2080 brings the large numbers closer to this decade - double weight = int64_t( (now() - (block_timestamp::block_timestamp_epoch / 1000)) / (seconds_per_day * 7) ) / double( 52 ); + double weight = int64_t( (current_time_point().sec_since_epoch() - (block_timestamp::block_timestamp_epoch / 1000)) / (seconds_per_day * 7) ) / double( 52 ); return double(staked) * std::pow( 2, weight ); } - double system_contract::update_total_votepay_share( time_point ct, + double system_contract::update_total_votepay_share( const time_point& ct, double additional_shares_delta, double shares_rate_delta ) { @@ -154,7 +177,7 @@ namespace eosiosystem { } double system_contract::update_producer_votepay_share( const producers_table2::const_iterator& prod_itr, - time_point ct, + const time_point& ct, double shares_rate, bool reset_to_zero ) { @@ -176,52 +199,40 @@ namespace eosiosystem { return new_votepay_share; } - /** - * @pre producers must be sorted from lowest to highest and must be registered and active - * @pre if proxy is set then no producers can be voted for - * @pre if proxy is set then proxy account must exist and be registered as a proxy - * @pre every listed producer or proxy must have been previously registered - * @pre voter must authorize this action - * @pre voter must have previously staked some EOS for voting - * @pre voter->staked must be up to date - * - * @post every producer previously voted for will have vote reduced by previous vote weight - * @post every producer newly voted for will have vote increased by new vote amount - * @post prior proxy will proxied_vote_weight decremented by previous vote weight - * @post new proxy will proxied_vote_weight incremented by new vote weight - * - * If voting for a proxy, the producer votes will not change until the proxy updates their own vote. - */ - void system_contract::voteproducer( const name voter_name, const name proxy, const std::vector& producers ) { + void system_contract::voteproducer( const name& voter_name, const name& proxy, const std::vector& producers ) { require_auth( voter_name ); + vote_stake_updater( voter_name ); update_votes( voter_name, proxy, producers, true ); + auto rex_itr = _rexbalance.find( voter_name.value ); + if( rex_itr != _rexbalance.end() && rex_itr->rex_balance.amount > 0 ) { + check_voting_requirement( voter_name, "voter holding REX tokens must vote for at least 21 producers or for a proxy" ); + } } - void system_contract::update_votes( const name voter_name, const name proxy, const std::vector& producers, bool voting ) { + void system_contract::update_votes( const name& voter_name, const name& proxy, const std::vector& producers, bool voting ) { //validate input if ( proxy ) { - eosio_assert( producers.size() == 0, "cannot vote for producers and proxy at same time" ); - eosio_assert( voter_name != proxy, "cannot proxy to self" ); - require_recipient( proxy ); + check( producers.size() == 0, "cannot vote for producers and proxy at same time" ); + check( voter_name != proxy, "cannot proxy to self" ); } else { - eosio_assert( producers.size() <= 30, "attempt to vote for too many producers" ); + check( producers.size() <= 30, "attempt to vote for too many producers" ); for( size_t i = 1; i < producers.size(); ++i ) { - eosio_assert( producers[i-1] < producers[i], "producer votes must be unique and sorted" ); + check( producers[i-1] < producers[i], "producer votes must be unique and sorted" ); } } auto voter = _voters.find( voter_name.value ); - eosio_assert( voter != _voters.end(), "user must stake before they can vote" ); /// staking creates voter object - eosio_assert( !proxy || !voter->is_proxy, "account registered as a proxy is not allowed to use a proxy" ); + check( voter != _voters.end(), "user must stake before they can vote" ); /// staking creates voter object + check( !proxy || !voter->is_proxy, "account registered as a proxy is not allowed to use a proxy" ); /** - * The first time someone votes we calculate and set last_vote_weight, since they cannot unstake until - * after total_activated_stake hits threshold, we can use last_vote_weight to determine that this is + * The first time someone votes we calculate and set last_vote_weight. Since they cannot unstake until + * after the chain has been activated, we can use last_vote_weight to determine that this is * their first vote and should consider their stake activated. */ - if( voter->last_vote_weight <= 0.0 ) { + if( _gstate.thresh_activated_stake_time == time_point() && voter->last_vote_weight <= 0.0 ) { _gstate.total_activated_stake += voter->staked; - if( _gstate.total_activated_stake >= min_activated_stake && _gstate.thresh_activated_stake_time == time_point() ) { + if( _gstate.total_activated_stake >= min_activated_stake ) { _gstate.thresh_activated_stake_time = current_time_point(); } } @@ -231,11 +242,11 @@ namespace eosiosystem { new_vote_weight += voter->proxied_vote_weight; } - boost::container::flat_map > producer_deltas; + std::map > producer_deltas; if ( voter->last_vote_weight > 0 ) { if( voter->proxy ) { auto old_proxy = _voters.find( voter->proxy.value ); - eosio_assert( old_proxy != _voters.end(), "old proxy not found" ); //data corruption + check( old_proxy != _voters.end(), "old proxy not found" ); //data corruption _voters.modify( old_proxy, same_payer, [&]( auto& vp ) { vp.proxied_vote_weight -= voter->last_vote_weight; }); @@ -251,8 +262,8 @@ namespace eosiosystem { if( proxy ) { auto new_proxy = _voters.find( proxy.value ); - eosio_assert( new_proxy != _voters.end(), "invalid proxy specified" ); //if ( !voting ) { data corruption } else { wrong vote } - eosio_assert( !voting || new_proxy->is_proxy, "proxy not found" ); + check( new_proxy != _voters.end(), "invalid proxy specified" ); //if ( !voting ) { data corruption } else { wrong vote } + check( !voting || new_proxy->is_proxy, "proxy not found" ); if ( new_vote_weight >= 0 ) { _voters.modify( new_proxy, same_payer, [&]( auto& vp ) { vp.proxied_vote_weight += new_vote_weight; @@ -275,7 +286,9 @@ namespace eosiosystem { for( const auto& pd : producer_deltas ) { auto pitr = _producers.find( pd.first.value ); if( pitr != _producers.end() ) { - eosio_assert( !voting || pitr->active() || !pd.second.second /* not from new set */, "producer is not currently registered" ); + if( voting && !pitr->active() && pd.second.second /* from new set */ ) { + check( false, ( "producer " + pitr->owner.to_string() + " is not currently registered" ).data() ); + } double init_total_votes = pitr->total_votes; _producers.modify( pitr, same_payer, [&]( auto& p ) { p.total_votes += pd.second.first; @@ -283,7 +296,7 @@ namespace eosiosystem { p.total_votes = 0; } _gstate.total_producer_vote_weight += pd.second.first; - //eosio_assert( p.total_votes >= 0, "something bad happened" ); + //check( p.total_votes >= 0, "something bad happened" ); }); auto prod2 = _producers2.find( pd.first.value ); if( prod2 != _producers2.end() ) { @@ -306,7 +319,9 @@ namespace eosiosystem { } } } else { - eosio_assert( !pd.second.second /* not from new set */, "producer is not registered" ); //data corruption + if( pd.second.second ) { + check( false, ( "producer " + pd.first.to_string() + " is not registered" ).data() ); + } } } @@ -319,22 +334,13 @@ namespace eosiosystem { }); } - /** - * An account marked as a proxy can vote with the weight of other accounts which - * have selected it as a proxy. Other accounts must refresh their voteproducer to - * update the proxy's weight. - * - * @param isproxy - true if proxy wishes to vote on behalf of others, false otherwise - * @pre proxy must have something staked (existing row in voters table) - * @pre new state must be different than current state - */ - void system_contract::regproxy( const name proxy, bool isproxy ) { + void system_contract::regproxy( const name& proxy, bool isproxy ) { require_auth( proxy ); auto pitr = _voters.find( proxy.value ); if ( pitr != _voters.end() ) { - eosio_assert( isproxy != pitr->is_proxy, "action has no effect" ); - eosio_assert( !isproxy || !pitr->proxy, "account that uses a proxy is not allowed to become a proxy" ); + check( isproxy != pitr->is_proxy, "action has no effect" ); + check( !isproxy || !pitr->proxy, "account that uses a proxy is not allowed to become a proxy" ); _voters.modify( pitr, same_payer, [&]( auto& p ) { p.is_proxy = isproxy; }); @@ -348,7 +354,7 @@ namespace eosiosystem { } void system_contract::propagate_weight_change( const voter_info& voter ) { - eosio_assert( !voter.proxy || !voter.is_proxy, "account registered as a proxy is not allowed to use a proxy" ); + check( !voter.proxy || !voter.is_proxy, "account registered as a proxy is not allowed to use a proxy" ); double new_weight = stake2vote( voter.staked ); if ( voter.is_proxy ) { new_weight += voter.proxied_vote_weight; diff --git a/contracts/eosio.token/CMakeLists.txt b/contracts/eosio.token/CMakeLists.txt new file mode 100644 index 000000000..cf53f62cd --- /dev/null +++ b/contracts/eosio.token/CMakeLists.txt @@ -0,0 +1,13 @@ +add_contract(eosio.token eosio.token ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.token.cpp) + +target_include_directories(eosio.token + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include) + +set_target_properties(eosio.token + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ricardian/eosio.token.contracts.md.in ${CMAKE_CURRENT_BINARY_DIR}/ricardian/eosio.token.contracts.md @ONLY ) + +target_compile_options( eosio.token PUBLIC -R${CMAKE_CURRENT_SOURCE_DIR}/ricardian -R${CMAKE_CURRENT_BINARY_DIR}/ricardian ) diff --git a/contracts/eosio.token/include/eosio.token/eosio.token.hpp b/contracts/eosio.token/include/eosio.token/eosio.token.hpp new file mode 100644 index 000000000..050a685b5 --- /dev/null +++ b/contracts/eosio.token/include/eosio.token/eosio.token.hpp @@ -0,0 +1,146 @@ +#pragma once + +#include +#include + +#include + +namespace eosiosystem { + class system_contract; +} + +namespace eosio { + + using std::string; + + /** + * The `eosio.token` sample system contract defines the structures and actions that allow users to create, issue, and manage tokens for EOSIO based blockchains. It demonstrates one way to implement a smart contract which allows for creation and management of tokens. It is possible for one to create a similar contract which suits different needs. However, it is recommended that if one only needs a token with the below listed actions, that one uses the `eosio.token` contract instead of developing their own. + * + * The `eosio.token` contract class also implements two useful public static methods: `get_supply` and `get_balance`. The first allows one to check the total supply of a specified token, created by an account and the second allows one to check the balance of a token for a specified account (the token creator account has to be specified as well). + * + * The `eosio.token` contract manages the set of tokens, accounts and their corresponding balances, by using two internal multi-index structures: the `accounts` and `stats`. The `accounts` multi-index table holds, for each row, instances of `account` object and the `account` object holds information about the balance of one token. The `accounts` table is scoped to an eosio account, and it keeps the rows indexed based on the token's symbol. This means that when one queries the `accounts` multi-index table for an account name the result is all the tokens that account holds at the moment. + * + * Similarly, the `stats` multi-index table, holds instances of `currency_stats` objects for each row, which contains information about current supply, maximum supply, and the creator account for a symbol token. The `stats` table is scoped to the token symbol. Therefore, when one queries the `stats` table for a token symbol the result is one single entry/row corresponding to the queried symbol token if it was previously created, or nothing, otherwise. + */ + class [[eosio::contract("eosio.token")]] token : public contract { + public: + using contract::contract; + + /** + * Allows `issuer` account to create a token in supply of `maximum_supply`. If validation is successful a new entry in statstable for token symbol scope gets created. + * + * @param issuer - the account that creates the token, + * @param maximum_supply - the maximum supply set for the token created. + * + * @pre Token symbol has to be valid, + * @pre Token symbol must not be already created, + * @pre maximum_supply has to be smaller than the maximum supply allowed by the system: 1^62 - 1. + * @pre Maximum supply must be positive; + */ + [[eosio::action]] + void create( const name& issuer, + const asset& maximum_supply); + /** + * This action issues to `to` account a `quantity` of tokens. + * + * @param to - the account to issue tokens to, it must be the same as the issuer, + * @param quntity - the amount of tokens to be issued, + * @memo - the memo string that accompanies the token issue transaction. + */ + [[eosio::action]] + void issue( const name& to, const asset& quantity, const string& memo ); + + /** + * The opposite for create action, if all validations succeed, + * it debits the statstable.supply amount. + * + * @param quantity - the quantity of tokens to retire, + * @param memo - the memo string to accompany the transaction. + */ + [[eosio::action]] + void retire( const asset& quantity, const string& memo ); + + /** + * Allows `from` account to transfer to `to` account the `quantity` tokens. + * One account is debited and the other is credited with quantity tokens. + * + * @param from - the account to transfer from, + * @param to - the account to be transferred to, + * @param quantity - the quantity of tokens to be transferred, + * @param memo - the memo string to accompany the transaction. + */ + [[eosio::action]] + void transfer( const name& from, + const name& to, + const asset& quantity, + const string& memo ); + /** + * Allows `ram_payer` to create an account `owner` with zero balance for + * token `symbol` at the expense of `ram_payer`. + * + * @param owner - the account to be created, + * @param symbol - the token to be payed with by `ram_payer`, + * @param ram_payer - the account that supports the cost of this action. + * + * More information can be read [here](https://github.com/EOSIO/eosio.contracts/issues/62) + * and [here](https://github.com/EOSIO/eosio.contracts/issues/61). + */ + [[eosio::action]] + void open( const name& owner, const symbol& symbol, const name& ram_payer ); + + /** + * This action is the opposite for open, it closes the account `owner` + * for token `symbol`. + * + * @param owner - the owner account to execute the close action for, + * @param symbol - the symbol of the token to execute the close action for. + * + * @pre The pair of owner plus symbol has to exist otherwise no action is executed, + * @pre If the pair of owner plus symbol exists, the balance has to be zero. + */ + [[eosio::action]] + void close( const name& owner, const symbol& symbol ); + + static asset get_supply( const name& token_contract_account, const 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( const name& token_contract_account, const name& owner, const symbol_code& sym_code ) + { + accounts accountstable( token_contract_account, owner.value ); + const auto& ac = accountstable.get( sym_code.raw() ); + return ac.balance; + } + + using create_action = eosio::action_wrapper<"create"_n, &token::create>; + using issue_action = eosio::action_wrapper<"issue"_n, &token::issue>; + using retire_action = eosio::action_wrapper<"retire"_n, &token::retire>; + using transfer_action = eosio::action_wrapper<"transfer"_n, &token::transfer>; + using open_action = eosio::action_wrapper<"open"_n, &token::open>; + using close_action = eosio::action_wrapper<"close"_n, &token::close>; + private: + struct [[eosio::table]] account { + asset balance; + + uint64_t primary_key()const { return balance.symbol.code().raw(); } + }; + + struct [[eosio::table]] currency_stats { + asset supply; + asset max_supply; + name issuer; + + uint64_t primary_key()const { return supply.symbol.code().raw(); } + }; + + typedef eosio::multi_index< "accounts"_n, account > accounts; + typedef eosio::multi_index< "stat"_n, currency_stats > stats; + + void sub_balance( const name& owner, const asset& value ); + void add_balance( const name& owner, const asset& value, const name& ram_payer ); + }; + +} diff --git a/contracts/eosio.token/ricardian/eosio.token.contracts.md.in b/contracts/eosio.token/ricardian/eosio.token.contracts.md.in new file mode 100644 index 000000000..f050eec77 --- /dev/null +++ b/contracts/eosio.token/ricardian/eosio.token.contracts.md.in @@ -0,0 +1,95 @@ +

close

+ +--- +spec_version: "0.2.0" +title: Close Token Balance +summary: 'Close {{nowrap owner}}’s zero quantity balance' +icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@ +--- + +{{owner}} agrees to close their zero quantity balance for the {{symbol_to_symbol_code symbol}} token. + +RAM will be refunded to the RAM payer of the {{symbol_to_symbol_code symbol}} token balance for {{owner}}. + +

create

+ +--- +spec_version: "0.2.0" +title: Create New Token +summary: 'Create a new token' +icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@ +--- + +{{$action.account}} agrees to create a new token with symbol {{asset_to_symbol_code maximum_supply}} to be managed by {{issuer}}. + +This action will not result any any tokens being issued into circulation. + +{{issuer}} will be allowed to issue tokens into circulation, up to a maximum supply of {{maximum_supply}}. + +RAM will deducted from {{$action.account}}’s resources to create the necessary records. + +

issue

+ +--- +spec_version: "0.2.0" +title: Issue Tokens into Circulation +summary: 'Issue {{nowrap quantity}} into circulation and transfer into {{nowrap to}}’s account' +icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@ +--- + +The token manager agrees to issue {{quantity}} into circulation, and transfer it into {{to}}’s account. + +{{#if memo}}There is a memo attached to the transfer stating: +{{memo}} +{{/if}} + +If {{to}} does not have a balance for {{asset_to_symbol_code quantity}}, or the token manager does not have a balance for {{asset_to_symbol_code quantity}}, the token manager will be designated as the RAM payer of the {{asset_to_symbol_code quantity}} token balance for {{to}}. As a result, RAM will be deducted from the token manager’s resources to create the necessary records. + +This action does not allow the total quantity to exceed the max allowed supply of the token. + +

open

+ +--- +spec_version: "0.2.0" +title: Open Token Balance +summary: 'Open a zero quantity balance for {{nowrap owner}}' +icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@ +--- + +{{ram_payer}} agrees to establish a zero quantity balance for {{owner}} for the {{symbol_to_symbol_code symbol}} token. + +If {{owner}} does not have a balance for {{symbol_to_symbol_code symbol}}, {{ram_payer}} will be designated as the RAM payer of the {{symbol_to_symbol_code symbol}} token balance for {{owner}}. As a result, RAM will be deducted from {{ram_payer}}’s resources to create the necessary records. + +

retire

+ +--- +spec_version: "0.2.0" +title: Remove Tokens from Circulation +summary: 'Remove {{nowrap quantity}} from circulation' +icon: @ICON_BASE_URL@/@TOKEN_ICON_URI@ +--- + +The token manager agrees to remove {{quantity}} from circulation, taken from their own account. + +{{#if memo}} There is a memo attached to the action stating: +{{memo}} +{{/if}} + +

transfer

+ +--- +spec_version: "0.2.0" +title: Transfer Tokens +summary: 'Send {{nowrap quantity}} from {{nowrap from}} to {{nowrap to}}' +icon: @ICON_BASE_URL@/@TRANSFER_ICON_URI@ +--- + +{{from}} agrees to send {{quantity}} to {{to}}. + +{{#if memo}}There is a memo attached to the transfer stating: +{{memo}} +{{/if}} + +If {{from}} is not already the RAM payer of their {{asset_to_symbol_code quantity}} token balance, {{from}} will be designated as such. As a result, RAM will be deducted from {{from}}’s resources to refund the original RAM payer. + +If {{to}} does not have a balance for {{asset_to_symbol_code quantity}}, {{from}} will be designated as the RAM payer of the {{asset_to_symbol_code quantity}} token balance for {{to}}. As a result, RAM will be deducted from {{from}}’s resources to create the necessary records. diff --git a/contracts/eosio.token/src/eosio.token.cpp b/contracts/eosio.token/src/eosio.token.cpp new file mode 100644 index 000000000..8dda907e3 --- /dev/null +++ b/contracts/eosio.token/src/eosio.token.cpp @@ -0,0 +1,159 @@ +#include + +namespace eosio { + +void token::create( const name& issuer, + const asset& maximum_supply ) +{ + require_auth( get_self() ); + + auto sym = maximum_supply.symbol; + check( sym.is_valid(), "invalid symbol name" ); + check( maximum_supply.is_valid(), "invalid supply"); + check( maximum_supply.amount > 0, "max-supply must be positive"); + + stats statstable( get_self(), sym.code().raw() ); + auto existing = statstable.find( sym.code().raw() ); + check( existing == statstable.end(), "token with symbol already exists" ); + + statstable.emplace( get_self(), [&]( auto& s ) { + s.supply.symbol = maximum_supply.symbol; + s.max_supply = maximum_supply; + s.issuer = issuer; + }); +} + + +void token::issue( const name& to, const asset& quantity, const string& memo ) +{ + auto sym = quantity.symbol; + check( sym.is_valid(), "invalid symbol name" ); + check( memo.size() <= 256, "memo has more than 256 bytes" ); + + stats statstable( get_self(), sym.code().raw() ); + auto existing = statstable.find( sym.code().raw() ); + check( existing != statstable.end(), "token with symbol does not exist, create token before issue" ); + const auto& st = *existing; + check( to == st.issuer, "tokens can only be issued to issuer account" ); + + require_auth( st.issuer ); + check( quantity.is_valid(), "invalid quantity" ); + check( quantity.amount > 0, "must issue positive quantity" ); + + check( quantity.symbol == st.supply.symbol, "symbol precision mismatch" ); + check( 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 ); +} + +void token::retire( const asset& quantity, const string& memo ) +{ + auto sym = quantity.symbol; + check( sym.is_valid(), "invalid symbol name" ); + check( memo.size() <= 256, "memo has more than 256 bytes" ); + + stats statstable( get_self(), sym.code().raw() ); + auto existing = statstable.find( sym.code().raw() ); + check( existing != statstable.end(), "token with symbol does not exist" ); + const auto& st = *existing; + + require_auth( st.issuer ); + check( quantity.is_valid(), "invalid quantity" ); + check( quantity.amount > 0, "must retire positive quantity" ); + + check( quantity.symbol == st.supply.symbol, "symbol precision mismatch" ); + + statstable.modify( st, same_payer, [&]( auto& s ) { + s.supply -= quantity; + }); + + sub_balance( st.issuer, quantity ); +} + +void token::transfer( const name& from, + const name& to, + const asset& quantity, + const string& memo ) +{ + check( from != to, "cannot transfer to self" ); + require_auth( from ); + check( is_account( to ), "to account does not exist"); + auto sym = quantity.symbol.code(); + stats statstable( get_self(), sym.raw() ); + const auto& st = statstable.get( sym.raw() ); + + require_recipient( from ); + require_recipient( to ); + + check( quantity.is_valid(), "invalid quantity" ); + check( quantity.amount > 0, "must transfer positive quantity" ); + check( quantity.symbol == st.supply.symbol, "symbol precision mismatch" ); + check( 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 ); +} + +void token::sub_balance( const name& owner, const asset& value ) { + accounts from_acnts( get_self(), owner.value ); + + const auto& from = from_acnts.get( value.symbol.code().raw(), "no balance object found" ); + check( from.balance.amount >= value.amount, "overdrawn balance" ); + + from_acnts.modify( from, owner, [&]( auto& a ) { + a.balance -= value; + }); +} + +void token::add_balance( const name& owner, const asset& value, const name& ram_payer ) +{ + accounts to_acnts( get_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; + }); + } +} + +void token::open( const name& owner, const symbol& symbol, const name& ram_payer ) +{ + require_auth( ram_payer ); + + check( is_account( owner ), "owner account does not exist" ); + + auto sym_code_raw = symbol.code().raw(); + stats statstable( get_self(), sym_code_raw ); + const auto& st = statstable.get( sym_code_raw, "symbol does not exist" ); + check( st.supply.symbol == symbol, "symbol precision mismatch" ); + + accounts acnts( get_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}; + }); + } +} + +void token::close( const name& owner, const symbol& symbol ) +{ + require_auth( owner ); + accounts acnts( get_self(), owner.value ); + auto it = acnts.find( symbol.code().raw() ); + check( it != acnts.end(), "Balance row already deleted or never existed. Action won't have any effect." ); + check( it->balance.amount == 0, "Cannot close because the balance is not zero." ); + acnts.erase( it ); +} + +} /// namespace eosio diff --git a/contracts/eosio.wrap/CMakeLists.txt b/contracts/eosio.wrap/CMakeLists.txt new file mode 100644 index 000000000..27d429194 --- /dev/null +++ b/contracts/eosio.wrap/CMakeLists.txt @@ -0,0 +1,13 @@ +add_contract(eosio.wrap eosio.wrap ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.wrap.cpp) + +target_include_directories(eosio.wrap + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include) + +set_target_properties(eosio.wrap + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ricardian/eosio.wrap.contracts.md.in ${CMAKE_CURRENT_BINARY_DIR}/ricardian/eosio.wrap.contracts.md @ONLY ) + +target_compile_options( eosio.wrap PUBLIC -R${CMAKE_CURRENT_SOURCE_DIR}/ricardian -R${CMAKE_CURRENT_BINARY_DIR}/ricardian ) diff --git a/contracts/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp b/contracts/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp new file mode 100644 index 000000000..c272c8e2c --- /dev/null +++ b/contracts/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp @@ -0,0 +1,38 @@ +#pragma once + +#include +#include +#include + +namespace eosio { + /** + * The `eosio.wrap` system contract allows block producers to bypass authorization checks or run privileged actions with 15/21 producer approval and thus simplifies block producers superuser actions. It also makes these actions easier to audit. + * + * It does not give block producers any additional powers or privileges that do not already exist within the EOSIO based blockchains. As it is implemented, in an EOSIO based blockchain, 15/21 block producers can change an account's permissions or modify an account's contract code if they decided it is beneficial for the blockchain and community. However, the current method is opaque and leaves undesirable side effects on specific system accounts, and thus the `eosio.wrap `contract solves this matter by providing an easier method of executing important governance actions. + * + * The only action implemented by the `eosio.wrap` system contract is the `exec` action. This action allows for execution of a transaction, which is passed to the `exec` method in the form of a packed transaction in json format via the 'trx' parameter and the `executer` account that executes the transaction. The same `executer` account will also be used to pay the RAM and CPU fees needed to execute the transaction. + */ + class [[eosio::contract("eosio.wrap")]] wrap : public contract { + public: + using contract::contract; + + /** + * Execute action. + * + * Execute a transaction while bypassing regular authorization checks. + * + * Preconditions: + * - Requires authorization of eosio.wrap which needs to be a privileged account. + * + * Postconditions: + * - Deferred transaction RAM usage is billed to 'executer' * + * + * @param executer - account executing the transaction, + * @param trx - the transaction to be executed. + */ + [[eosio::action]] + void exec( ignore executer, ignore trx ); + + using exec_action = eosio::action_wrapper<"exec"_n, &wrap::exec>; + }; +} /// namespace eosio diff --git a/contracts/eosio.wrap/ricardian/eosio.wrap.contracts.md.in b/contracts/eosio.wrap/ricardian/eosio.wrap.contracts.md.in new file mode 100644 index 000000000..8077a3472 --- /dev/null +++ b/contracts/eosio.wrap/ricardian/eosio.wrap.contracts.md.in @@ -0,0 +1,13 @@ +

exec

+ +--- +spec_version: "0.2.0" +title: Privileged Execute +summary: '{{nowrap executer}} executes a transaction while bypassing authority checks' +icon: @ICON_BASE_URL@/@ADMIN_ICON_URI@ +--- + +{{executer}} executes the following transaction while bypassing authority checks: +{{to_json trx}} + +{{$action.account}} must also authorize this action. diff --git a/eosio.wrap/src/eosio.wrap.cpp b/contracts/eosio.wrap/src/eosio.wrap.cpp similarity index 52% rename from eosio.wrap/src/eosio.wrap.cpp rename to contracts/eosio.wrap/src/eosio.wrap.cpp index d8a034466..12056bf1e 100644 --- a/eosio.wrap/src/eosio.wrap.cpp +++ b/contracts/eosio.wrap/src/eosio.wrap.cpp @@ -3,16 +3,14 @@ namespace eosio { void wrap::exec( ignore, ignore ) { - require_auth( _self ); + require_auth( get_self() ); name executer; _ds >> executer; require_auth( executer ); - send_deferred( (uint128_t(executer.value) << 64) | current_time(), executer.value, _ds.pos(), _ds.remaining() ); + send_deferred( (uint128_t(executer.value) << 64) | (uint64_t)current_time_point().time_since_epoch().count(), executer, _ds.pos(), _ds.remaining() ); } } /// namespace eosio - -EOSIO_DISPATCH( eosio::wrap, (exec) ) diff --git a/contracts/icons/account.png b/contracts/icons/account.png new file mode 100644 index 000000000..768658782 Binary files /dev/null and b/contracts/icons/account.png differ diff --git a/contracts/icons/account.svg b/contracts/icons/account.svg new file mode 100644 index 000000000..511f06499 --- /dev/null +++ b/contracts/icons/account.svg @@ -0,0 +1 @@ +Account \ No newline at end of file diff --git a/contracts/icons/admin.png b/contracts/icons/admin.png new file mode 100644 index 000000000..ae9536472 Binary files /dev/null and b/contracts/icons/admin.png differ diff --git a/contracts/icons/admin.svg b/contracts/icons/admin.svg new file mode 100644 index 000000000..fbc057179 --- /dev/null +++ b/contracts/icons/admin.svg @@ -0,0 +1 @@ +Admin \ No newline at end of file diff --git a/contracts/icons/multisig.png b/contracts/icons/multisig.png new file mode 100644 index 000000000..00fa7564c Binary files /dev/null and b/contracts/icons/multisig.png differ diff --git a/contracts/icons/multisig.svg b/contracts/icons/multisig.svg new file mode 100644 index 000000000..d9167fb2c --- /dev/null +++ b/contracts/icons/multisig.svg @@ -0,0 +1 @@ +Multi Sig \ No newline at end of file diff --git a/contracts/icons/resource.png b/contracts/icons/resource.png new file mode 100644 index 000000000..8e1bd127d Binary files /dev/null and b/contracts/icons/resource.png differ diff --git a/contracts/icons/resource.svg b/contracts/icons/resource.svg new file mode 100644 index 000000000..4a4755928 --- /dev/null +++ b/contracts/icons/resource.svg @@ -0,0 +1 @@ +Resource \ No newline at end of file diff --git a/contracts/icons/rex.png b/contracts/icons/rex.png new file mode 100644 index 000000000..b43ee27fc Binary files /dev/null and b/contracts/icons/rex.png differ diff --git a/contracts/icons/rex.svg b/contracts/icons/rex.svg new file mode 100644 index 000000000..99f77f373 --- /dev/null +++ b/contracts/icons/rex.svg @@ -0,0 +1 @@ +Rex \ No newline at end of file diff --git a/contracts/icons/token.png b/contracts/icons/token.png new file mode 100644 index 000000000..445188a02 Binary files /dev/null and b/contracts/icons/token.png differ diff --git a/contracts/icons/token.svg b/contracts/icons/token.svg new file mode 100644 index 000000000..67ff415ba --- /dev/null +++ b/contracts/icons/token.svg @@ -0,0 +1 @@ +Token_1 \ No newline at end of file diff --git a/contracts/icons/transfer.png b/contracts/icons/transfer.png new file mode 100644 index 000000000..d9c021957 Binary files /dev/null and b/contracts/icons/transfer.png differ diff --git a/contracts/icons/transfer.svg b/contracts/icons/transfer.svg new file mode 100644 index 000000000..06da6325c --- /dev/null +++ b/contracts/icons/transfer.svg @@ -0,0 +1 @@ +Transfer_1 \ No newline at end of file diff --git a/contracts/icons/voting.png b/contracts/icons/voting.png new file mode 100644 index 000000000..0356bddaf Binary files /dev/null and b/contracts/icons/voting.png differ diff --git a/contracts/icons/voting.svg b/contracts/icons/voting.svg new file mode 100644 index 000000000..fac870898 --- /dev/null +++ b/contracts/icons/voting.svg @@ -0,0 +1 @@ +Voting_1 \ No newline at end of file diff --git a/docker/buildContracts.sh b/docker/buildContracts.sh new file mode 100755 index 000000000..d04dab964 --- /dev/null +++ b/docker/buildContracts.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e # exit on failure of any "simple" command (excludes &&, ||, or | chains) +cd /eosio.contracts +./build.sh -c /usr/opt/eosio.cdt -e /opt/eosio -t -y +cd build +tar -pczf /artifacts/contracts.tar.gz * diff --git a/docker/environment.dockerpart b/docker/environment.dockerpart new file mode 100644 index 000000000..cde89d508 --- /dev/null +++ b/docker/environment.dockerpart @@ -0,0 +1,3 @@ +# set environment variables (EOSIO_ROOT and CMAKE_FRAMEWORK_PATH are autogenerated) +RUN PATH=/usr/local/eosio/bin:$(echo "/usr/opt/eosio.cdt/$(ls /usr/opt/eosio.cdt)/bin"):$PATH +ENV LD_LIBRARY_PATH=/usr/local/lib \ No newline at end of file diff --git a/docker/external-dependencies.dockerpart b/docker/external-dependencies.dockerpart new file mode 100644 index 000000000..f2e272752 --- /dev/null +++ b/docker/external-dependencies.dockerpart @@ -0,0 +1,4 @@ +# install external dependencies +RUN apt-get update && \ +apt-get -y upgrade && \ +DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates build-essential libbz2-dev zlib1g-dev libssl-dev libgmp3-dev libicu-dev cmake bc jq curl wget net-tools unzip gnupg git graphviz \ No newline at end of file diff --git a/docker/unit-test.sh b/docker/unit-test.sh new file mode 100755 index 000000000..9348960bf --- /dev/null +++ b/docker/unit-test.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e # exit on failure of any "simple" command (excludes &&, ||, or | chains) +CPU_CORES=$(getconf _NPROCESSORS_ONLN) +echo "$CPU_CORES cpu cores detected." +cd /eosio.contracts/build/tests +TEST_COUNT=$(ctest -N | grep -i 'Total Tests: ' | cut -d ':' -f 2 | awk '{print $1}') +[[ $TEST_COUNT > 0 ]] && echo "$TEST_COUNT tests found." || (echo "ERROR: No tests registered with ctest! Exiting..." && exit 1) +echo "$ ctest -j $CPU_CORES --output-on-failure -T Test" +set +e # defer ctest error handling to end +ctest -j $CPU_CORES --output-on-failure -T Test +EXIT_STATUS=$? +[[ "$EXIT_STATUS" == 0 ]] && set -e +mv /eosio.contracts/build/tests/Testing/$(ls /eosio.contracts/build/tests/Testing/ | grep '20' | tail -n 1)/Test.xml /artifacts/Test.xml +# ctest error handling +if [[ "$EXIT_STATUS" != 0 ]]; then + echo "Failing due to non-zero exit status from ctest: $EXIT_STATUS" + echo ' ^^^ scroll up for more information ^^^' + exit $EXIT_STATUS +fi \ No newline at end of file diff --git a/docker/verifyInstallation.sh b/docker/verifyInstallation.sh new file mode 100755 index 000000000..c5e198d18 --- /dev/null +++ b/docker/verifyInstallation.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e # exit on failure of any "simple" command (excludes &&, ||, or | chains) +# expected places to find EOSIO CMAKE in the docker container, in ascending order of preference +[[ -e /usr/lib/eosio/lib/cmake/eosio/eosio-config.cmake ]] && export CMAKE_FRAMEWORK_PATH="/usr/lib/eosio" +[[ -e /opt/eosio/lib/cmake/eosio/eosio-config.cmake ]] && export CMAKE_FRAMEWORK_PATH="/opt/eosio" +[[ ! -z "$EOSIO_ROOT" && -e $EOSIO_ROOT/lib/cmake/eosio/eosio-config.cmake ]] && export CMAKE_FRAMEWORK_PATH="$EOSIO_ROOT" +# fail if we didn't find it +[[ -z "$CMAKE_FRAMEWORK_PATH" ]] && exit 1 +# export variables +echo "" >> /eosio.contracts/docker/environment.Dockerfile # necessary if there is no '\n' at end of file +echo "ENV CMAKE_FRAMEWORK_PATH=$CMAKE_FRAMEWORK_PATH" >> /eosio.contracts/docker/environment.Dockerfile +echo "ENV EOSIO_ROOT=$CMAKE_FRAMEWORK_PATH" >> /eosio.contracts/docker/environment.Dockerfile \ No newline at end of file diff --git a/docs.json b/docs.json new file mode 100644 index 000000000..2d4e43af7 --- /dev/null +++ b/docs.json @@ -0,0 +1,40 @@ +{ + "name": "eosio.contracts", + "generators": [ + { + "name": "collate_markdown", + "options": { + "docs_dir": "docs" + } + }, + { + "name": "mdjavadoc", + "options": { + "source_dirs": [ + "contracts/eosio.token/include/eosio.token/", + "contracts/eosio.wrap/include/eosio.wrap/", + "contracts/eosio.bios/include/eosio.bios/", + "contracts/eosio.system/include/eosio.system/", + "contracts/eosio.msig/include/eosio.msig/" + ], + "output_dir": "action-reference" + } + } + ], + "skip_default_filters": true, + "filters": [ + { + "name": "sanitize", + "options": { + "exclude": ["action-reference"] + } + }, + { + "name": "capitalize", + "options": { + "mode": "all", + "exclude": ["action-reference"] + } + } + ] +} diff --git a/docs/01_key-concepts/01_system.md b/docs/01_key-concepts/01_system.md new file mode 100644 index 000000000..eb14bb6da --- /dev/null +++ b/docs/01_key-concepts/01_system.md @@ -0,0 +1,24 @@ +--- +content_title: System contracts, system accounts, privileged accounts +link_text: System contracts, system accounts, privileged accounts +--- + +At the genesis of an EOSIO-based blockchain, there is only one account present, `eosio` account, which is the main `system account`. There are other `system account`s, created by `eosio` account, which control specific actions of the `system contract`s [mentioned in previous section](../#system-contracts-defined-in-eosio.contracts). __Note__ the terms `system contract` and `system account`. `Privileged accounts` are accounts which can execute a transaction while skipping the standard authorization check. To ensure that this is not a security hole, the permission authority over these accounts is granted to `eosio.prods` system account. + +As you just learned the relation between a `system account` and a `system contract`, it is also important to remember that not all system accounts contain a system contract, but each system account has important roles in the blockchain functionality, as follows: + +|Account|Privileged|Has contract|Description| +|---|---|---|---| +|eosio|Yes|It contains the `eosio.system` contract|The main system account on an EOSIO-based blockchain.| +|eosio.msig|Yes|It contains the `eosio.msig` contract|Allows the signing of a multi-sig transaction proposal for later execution if all required parties sign the proposal before the expiration time.| +|eosio.wrap|Yes|It contains the `eosio.wrap` contract.|Simplifies block producer superuser actions by making them more readable and easier to audit.| +|eosio.token|No|It contains the `eosio.token` contract.|Defines the structures and actions allowing users to create, issue, and manage tokens on EOSIO-based blockchains.| +|eosio.names|No|No|The account which is holding funds from namespace auctions.| +|eosio.bpay|No|No|The account that pays the block producers for producing blocks. It assigns 0.25% of the inflation based on the amount of blocks a block producer created in the last 24 hours.| +|eosio.prods|No|No|The account representing the union of all current active block producers permissions.| +|eosio.ram|No|No|The account that keeps track of the SYS balances based on users actions of buying or selling RAM.| +|eosio.ramfee|No|No|The account that keeps track of the fees collected from users RAM trading actions: 0.5% from the value of each trade goes into this account.| +|eosio.saving|No|No|The account which holds the 4% of network inflation.| +|eosio.stake|No|No|The account that keeps track of all SYS tokens which have been staked for NET or CPU bandwidth.| +|eosio.vpay|No|No|The account that pays the block producers accordingly with the votes won. It assigns 0.75% of inflation based on the amount of votes a block producer won in the last 24 hours.| +|eosio.rex|No|No|The account that keeps track of fees and balances resulted from REX related actions execution.| diff --git a/docs/01_key-concepts/02_ram.md b/docs/01_key-concepts/02_ram.md new file mode 100644 index 000000000..a9d96fcd1 --- /dev/null +++ b/docs/01_key-concepts/02_ram.md @@ -0,0 +1,39 @@ +--- +content_title: RAM as system resource +link_text: RAM as system resource +--- + +## What is RAM + +RAM is the memory, the storage space, where the blockchain stores data. If your contract needs to store data on the blockchain, like in a database, then it can store it in the blockchain's RAM using either a `multi-index table` or a `singleton`. + +### Related documentation articles + +- Multi-index table [explainer documentation page](https://developers.eos.io/manuals/eosio.cdt/latest/group__multiindex) + +- Multi-index table [how to documentation page](https://developers.eos.io/manuals/eosio.cdt/latest/how-to-guides/multi-index) + +- Singleton [reference documentation page](https://developers.eos.io/manuals/eosio.cdt/latest/group__singleton/#singleton-table) + +- Singleton [how to documentation page](https://developers.eos.io/manuals/eosio.cdt/latest/how-to-guides/multi-index/how-to-define-a-singleton) + +## RAM High Performance + +The EOSIO-based blockchains are known for their high performance, which is achieved also because the data stored on the blockchain is using RAM as the storage medium, and thus access to blockchain data is very fast, helping the performance benchmarks to reach levels no other blockchain has been able to. + +## RAM Importance + +RAM is a very important system resource because of the following reasons: + +- It is a limited resource, each EOSIO-based blockchain can have different policies and rules around RAM; for example the public EOS blockchain started with 64GB of RAM and after that the block producers decided to increase the memory with 1KB per block, thus increasing constantly the supply of RAM for its price to not grow too high due to the increased demand from blockchain applications. + +- RAM is used in executing many actions sent to the blockchain; creating a new account action, for example, it needs to store in the blockchain memory the new account's information; also when an account accepts a new type of token a new record has to be created, somewhere in the blockchain memory, that holds the balance of the new token accepted, and that memory, the storage space on the blockchain, has to be purchased either by the account that transfers the token or by the account that accepts the new token type. + +- The smart contract can not store any additional information if it consumes all its allocated RAM. To continue to save data in the blockchain database, one, or both of the following conditions must be met: + + - A portion of the occupied RAM is freed by the smart contract. + - More RAM is allocated to the smart contract account through the RAM buying process. + +RAM is a scarce resource priced according to the unique Bancor liquidity algorithm which is implemented in the system contract [here](https://github.com/EOSIO/eos/blob/905e7c85714aee4286fa180ce946f15ceb4ce73c/contracts/eosio.system/exchange_state.hpp). + +The RAM system resource must be purchased using the system token. Refer to the [cleos manual](https://developers.eos.io/manuals/eos/v2.0/cleos/how-to-guides/how-to-buy-ram) to learn how to buy RAM via the command line interface. diff --git a/docs/01_key-concepts/03_cpu.md b/docs/01_key-concepts/03_cpu.md new file mode 100644 index 000000000..6f60577fe --- /dev/null +++ b/docs/01_key-concepts/03_cpu.md @@ -0,0 +1,10 @@ +--- +content_title: CPU as system resource +link_text: CPU as system resource +--- + +The system resource CPU provides processing power to blockchain accounts. The amount of CPU an account has is measured in microseconds and it is referred to as `cpu bandwidth` on the `cleos get account` command output. The `cpu bandwidth` represents the amount of processing time an account has at its disposal when actions sent to its contract are executed by the blockchain. When a transaction is executed by the blockchain it consumes CPU and NET, therefore sufficient CPU must be staked in order for transactions to complete. + +For more details about EOSIO staking refer to the following: +* [Staking Mechanism](https://developers.eos.io/welcome/latest/overview/technical_features#staking-mechanism). +* [Staking on EOSIO-based blockchains](05_stake.md) \ No newline at end of file diff --git a/docs/01_key-concepts/04_net.md b/docs/01_key-concepts/04_net.md new file mode 100644 index 000000000..f4f5b1460 --- /dev/null +++ b/docs/01_key-concepts/04_net.md @@ -0,0 +1,10 @@ +--- +content_title: NET as system resource +link_text: NET as system resource +--- + +NET, as CPU and RAM, is a very important system resource in EOSIO-based blockchains. NET is measured by the byte size of the transactions saved in the blockchain database and it is referred to as `net bandwidth` on the cleos get account command result. When a transaction is executed by the blockchain it consumes CPU and NET, therefore sufficient NET must be staked in order for transactions to complete. + +For more details about EOSIO staking refer to the following: +* [Staking Mechanism](https://developers.eos.io/welcome/latest/overview/technical_features#staking-mechanism). +* [Staking on EOSIO-based blockchains](05_stake.md) diff --git a/docs/01_key-concepts/05_stake.md b/docs/01_key-concepts/05_stake.md new file mode 100644 index 000000000..d8904d9d3 --- /dev/null +++ b/docs/01_key-concepts/05_stake.md @@ -0,0 +1,50 @@ +--- +content_title: Staking on EOSIO-based blockchains +link_text: Staking on EOSIO-based blockchains +--- + +## System Resources + +EOSIO-based blockchains work with three system resources: + +* [RAM](02_ram.md) +* [CPU](03_cpu.md) +* [NET](04_net.md) + +## How To Allocate System Resources + +EOSIO-based blockchain accounts need sufficient system resources, RAM, CPU and NET, to interact with the smart contracts deployed on the blockchain. + +### Stake NET and CPU + +The CPU and NET system resources are allocated by the account owner via the staking mechanism. Refer to the [cleos manual](https://developers.eos.io/manuals/eos/v2.0/cleos/how-to-guides/how-to-stake-resource) on how to do it via the command line interface. + +You will also find that staking/unstaking is at times referred to as delegating/undelegating. The economics of staking is also to provably commit to a promise that you will hold the staked tokens, either for NET or CPU, for a pre-established period of time, in spite of inflation caused by minting new tokens in order to reward BPs for their services every 24 hours. + +When you stake tokens for CPU and NET, you gain access to system resources proportional to the total amount of tokens staked by all other users for the same system resource at the same time. This means you can execute transactions at no cost but in the limits of the staked tokens. The staked tokens guarantee the proportional amount of resources regardless of any variations in the free market. + +If an account consumes all its allocated CPU and NET resources, it has two options: + +* It can wait for the blockchain to replenish the consumed resources. You can read more details below about the [system resources replenish algorithm].(05_stake.md#System-Resources-Replenish-Algorithm). +* It can allocate more resources through the staking mechanism. + +When an account uses the allocated resources, the amount that can be used in one transaction is limited by predefine [maximum CPU](https://developers.eos.io/manuals/eosio.cdt/latest/structeosio_1_1blockchain__parameters#variable-max_transaction_cpu_usage), [minimum CPU](https://developers.eos.io/manuals/eosio.cdt/latest/structeosio_1_1blockchain__parameters#variable-min_transaction_cpu_usage), and [maximum NET](https://developers.eos.io/manuals/eosio.cdt/latest/structeosio_1_1blockchain__parameters#variable-max_transaction_net_usage) limits. Transactions executed by the blockchain contain one or more actions, and each transaction must consume an amount of CPU and NET which is in the limits defined by the aforementioned blockchain settings. + +#### System Resources Replenish Algorithm + +EOSIO-based blockchains replenish automatically the consumed CPU and NET system resources. Before a transaction is executed, by the blockchain, it first calculates how many resources the account executing the transaction can consume. The calculation uses an exponential moving average with linear extrapolation when data is missing, and it multiplies the currently accumulated average by `(number of blocks in the window - number of blocks since last update) / (number of blocks in the window)`. The window is set as 24 hours window. + +This formula has the following outcomes: + +* If an account waited `number of blocks in the window` without executing any transaction it resets to zero usage. + +* If an account issues a transaction with every block it would always be `(number of blocks in the window - 1) / (number of blocks in the window)`, a very small value, very close to zero. Mathematically it _never_ reaches zero but the EOSIO implementation truncates off the tiny numbers to zero. + +* The accounts that execute transactions more often than the ones that execute less transactions, replenish their resources slower than the later. In other words, the more transactions an account executes the slower the replenish of resources. + +[[info]] +| The blockchain calculates and updates the remaining resources, for the accounts which execute transactions, with each block, before each transaction is executed. As time passes, as explained above, the consumed system resources are gradually replenished, and the available system resources increase, or decrease, depending on how many transactions an account executes. After waiting for some time, if you check the available resources balance and expect to see it increased, because your account did not executed any transactions, you will not see it updated. That is because it gets updated only before a transaction is executed. Therefore in order to see the available resources you have to execute a transaction. This is counter intuitive and the next versions will improve this aspect. + +### Buy RAM + +The RAM resource must be bought using the system token. Refer to the [cleos manual](https://developers.eos.io/manuals/eos/v2.0/cleos/how-to-guides/how-to-buy-ram) to learn how to do it via the command line interface. When an account consumes all its allocated RAM can not store any additional information on the blockchain database until it frees some of the occupied RAM or more RAM is allocated to the account through the RAM buying process. diff --git a/docs/01_key-concepts/06_vote.md b/docs/01_key-concepts/06_vote.md new file mode 100644 index 000000000..4aa8ba6b1 --- /dev/null +++ b/docs/01_key-concepts/06_vote.md @@ -0,0 +1,6 @@ +--- +content_title: Voting on EOSIO-based blockchains +link_text: Voting on EOSIO-based blockchains +--- + +In a EOSIO-based network the blockchain is kept alive by nodes which are interconnected between each other, communicating with each other via peer to peer protocols. Some of these nodes are elected, via a voting process, by the token holders to be producer nodes. They produce blocks, validate them and reach consensus on what transactions are allowed in each block, their order, and what blocks are finalized and stored forever in the blockchain. This way the governance, the mechanism by which collective decisions are made, of the blockchain is achieved through the 21 active block producers which are appointed by token holders' votes. It's the 21 active block producers which continuously create the blockchain by creating blocks, and securing them by validating them, and reaching consensus. Consensus is reached when 2/3+1 active block producers agree on validity of a block, that is all transactions contained in it and their order. The 21 producers is the default value however it can be configured to be higher or smaller to meet each business case requirements. diff --git a/docs/03_build-and-deploy.md b/docs/03_build-and-deploy.md new file mode 100644 index 000000000..b2db104ff --- /dev/null +++ b/docs/03_build-and-deploy.md @@ -0,0 +1,83 @@ +--- +content_title: How to build eosio.contracts +link_text: How to build eosio.contracts +--- + +## Preconditions +Ensure an appropriate version of `eosio.cdt` is installed. Installing `eosio.cdt` from binaries is sufficient, follow the [`eosio.cdt` installation instructions steps](https://developers.eos.io/manuals/eosio.cdt/latest/installation) to install it. To verify if you have `eosio.cdt` installed and its version run the following command + +```sh +eosio-cpp -v +``` + +### Build contracts using the build script + +#### To build contracts alone +Run the `build.sh` script in the top directory to build all the contracts. + +#### To build the contracts and unit tests +1. Ensure an appropriate version of `eosio` has been built from source and installed. Installing `eosio` from binaries `is not` sufficient. You can find instructions on how to do it [here](https://developers.eos.io/manuals/eos/latest/install/build-from-source) in section `Building from Sources`. +2. Run the `build.sh` script in the top directory with the `-t` flag to build all the contracts and the unit tests for these contracts. + +### Build contracts manually + +To build the `eosio.contracts` execute the following commands. + +On all platforms except macOS: +```sh +cd you_local_path_to/eosio.contracts/ +rm -fr build +mkdir build +cd build +cmake .. +make -j$( nproc ) +cd .. +``` + +For macOS: +```sh +cd you_local_path_to/eosio.contracts/ +rm -fr build +mkdir build +cd build +cmake .. +make -j$(sysctl -n hw.ncpu) +cd .. +``` + +### After build: +* If the build was configured to also build unit tests, the unit tests executable is placed in the _build/tests_ folder and is named __unit_test__. +* The contracts (both `.wasm` and `.abi` files) are built into their corresponding _build/contracts/\_ folder. +* Finally, simply use __cleos__ to _set contract_ by pointing to the previously mentioned directory for the specific contract. + +# How to deploy the eosio.contracts + +## To deploy eosio.bios contract execute the following command: +Let's assume your account name to which you want to deploy the contract is `testerbios` +``` +cleos set contract testerbios you_local_path_to/eosio.contracts/build/contracts/eosio.bios/ -p testerbios +``` + +## To deploy eosio.msig contract execute the following command: +Let's assume your account name to which you want to deploy the contract is `testermsig` +``` +cleos set contract testermsig you_local_path_to/eosio.contracts/build/contracts/eosio.msig/ -p testermsig +``` + +## To deploy eosio.system contract execute the following command: +Let's assume your account name to which you want to deploy the contract is `testersystem` +``` +cleos set contract testersystem you_local_path_to/eosio.contracts/build/contracts/eosio.system/ -p testersystem +``` + +## To deploy eosio.token contract execute the following command: +Let's assume your account name to which you want to deploy the contract is `testertoken` +``` +cleos set contract testertoken you_local_path_to/eosio.contracts/build/contracts/eosio.token/ -p testertoken +``` + +## To deploy eosio.wrap contract execute the following command: +Let's assume your account name to which you want to deploy the contract is `testerwrap` +``` +cleos set contract testerwrap you_local_path_to/eosio.contracts/build/contracts/eosio.wrap/ -p testerwrap +``` \ No newline at end of file diff --git a/docs/04_guides/01_upgrading-the-eosio.system-contract.md b/docs/04_guides/01_upgrading-the-eosio.system-contract.md new file mode 100644 index 000000000..8196453f0 --- /dev/null +++ b/docs/04_guides/01_upgrading-the-eosio.system-contract.md @@ -0,0 +1,229 @@ +--- +content_title: Upgrading the system contract +link_text: Upgrading the system contract +--- + +# Indirect method using eosio.msig contract + +Cleos currently provides tools to propose an action with the eosio.msig contract, but it does not provide an easy interface to propose a custom transaction. + +So, at the moment it is difficult to propose an atomic transaction with multiple actions (for example `eosio::setcode` followed by `eosio::setabi`). + +The advantage of the eosio.msig method is that it makes coordination much easier and does not place strict time limits (less than 9 hours) on signature collection. + +The disadvantage of the eosio.msig method is that it requires the proposer to have sufficient RAM to propose the transaction and currently cleos does not provide convenient tools to use it with custom transactions like the one that would be necessary to atomically upgrade the system contract. + +For now, it is recommended to use the direct method to upgrade the system contract. + +# Direct method (avoids using eosio.msig contract) + +Each of the top 21 block producers should do the following: + +1. Get current system contract for later comparison (actual hash and ABI on the main-net blockchain will be different): + +```sh +cleos get code -c original_system_contract.wast -a original_system_contract.abi eosio +``` +```console +code hash: cc0ffc30150a07c487d8247a484ce1caf9c95779521d8c230040c2cb0e2a3a60 +saving wast to original_system_contract.wast +saving abi to original_system_contract.abi +``` + +2. Generate the unsigned transaction which upgrades the system contract: + +```sh +cleos set contract -s -j -d eosio contracts/eosio.system | tail -n +4 > upgrade_system_contract_trx.json +``` + +The first few lines of the generated file should be something similar to (except with very different numbers for `expiration`, `ref_block_num`, and `ref_block_prefix`): + +```json +{ + "expiration": "2018-06-15T22:17:10", + "ref_block_num": 4552, + "ref_block_prefix": 511016679, + "max_net_usage_words": 0, + "max_cpu_usage_ms": 0, + "delay_sec": 0, + "context_free_actions": [], + "actions": [{ + "account": "eosio", + "name": "setcode", + "authorization": [{ + "actor": "eosio", + "permission": "active" + } + ], +``` + +and the last few lines should be: + +```json + } + ], + "transaction_extensions": [], + "signatures": [], + "context_free_data": [] +} +``` + +One of the top block producers should be chosen to lead the upgrade process. This lead producer should take their generated `upgrade_system_contract_trx.json`, rename it to `upgrade_system_contract_official_trx.json`, and do the following: + +3. Modify the `expiration` timestamp in `upgrade_system_contract_official_trx.json` to a time that is sufficiently far in the future to give enough time to collect all the necessary signatures, but not more than 9 hours from the time the transaction was generated. Also, keep in mind that the transaction will not be accepted into the blockchain if the expiration is more than 1 hour from the present time. + +4. Pass the `upgrade_system_contract_official_trx.json` file to all the other top 21 block producers. + +Then each of the top 21 block producers should do the following: + +5. Compare their generated `upgrade_system_contract_official_trx.json` file with the `upgrade_system_contract_official_trx.json` provided by the lead producer. The only difference should be in `expiration`, `ref_block_num`, `ref_block_prefix`, for example: + +```sh +diff upgrade_system_contract_official_trx.json upgrade_system_contract_trx.json +``` +```json +2,4c2,4 +< "expiration": "2018-06-15T22:17:10", +< "ref_block_num": 4552, +< "ref_block_prefix": 511016679, +--- +> "expiration": "2018-06-15T21:20:39", +> "ref_block_num": 4972, +> "ref_block_prefix": 195390844, +``` + +6. If the comparison is good, each block producer should proceed with signing the official upgrade transaction with the keys necessary to satisfy their active permission. If the block producer only has a single key (i.e the "active key") in the active permission of their block producing account, then they only need to generate one signature using that active key. This signing process can be done offline for extra security. + +First, the block producer should collect all the necessary information. Let us assume that the block producers active key pair is `(EOS5kBmh5kfo6c6pwB8j77vrznoAaygzoYvBsgLyMMmQ9B6j83i9c, 5JjpkhxAmEfynDgSn7gmEKEVcBqJTtu6HiQFf4AVgGv5A89LfG3)`. The block producer needs their active private key (`5JjpkhxAmEfynDgSn7gmEKEVcBqJTtu6HiQFf4AVgGv5A89LfG3` in this example), the `upgrade_system_contract_official_trx.json`, and the `chain_id` (`d0242fb30b71b82df9966d10ff6d09e4f5eb6be7ba85fd78f796937f1959315e` in this example) which can be retrieved through `cleos get info`. + +Then on a secure computer the producer can sign the transaction (the producer will need to paste in their private key when prompted): + +```sh +cleos sign --chain-id d0242fb30b71b82df9966d10ff6d09e4f5eb6be7ba85fd78f796937f1959315e upgrade_system_contract_trx.json | tail -n 5 +``` +```json +private key: "signatures": [ + "SIG_K1_JzABB9gzDGwUHaRmox68UNcfxMVwMnEXqqS1MvtsyUX8KGTbsZ5aZQZjHD5vREQa5BkZ7ft8CceLBLAj8eZ5erZb9cHuy5" + ], + "context_free_data": [] +} +``` + +Make sure to use the `chain_id` of the actual main-net blockchain that the transaction will be submitted to and not the example `chain_id` provided above. + +The output should include the signature (in this case `"SIG_K1_JzABB9gzDGwUHaRmox68UNcfxMVwMnEXqqS1MvtsyUX8KGTbsZ5aZQZjHD5vREQa5BkZ7ft8CceLBLAj8eZ5erZb9cHuy5"`) which the producer should then send to the lead producer. + +When the lead producer collects 15 producer signatures, the lead producer should do the following: + +7. Make a copy of the `upgrade_system_contract_official_trx.json` and call it `upgrade_system_contract_official_trx_signed.json`, and then modify the `upgrade_system_contract_official_trx_signed.json` so that the `signatures` field includes all 15 collected signatures. So the tail end of `upgrade_system_contract_official_trx_signed.json` could look something like: + +```sh +cat upgrade_system_contract_official_trx_signed.json | tail -n 20 +``` +```json + "transaction_extensions": [], + "signatures": [ + "SIG_K1_JzABB9gzDGwUHaRmox68UNcfxMVwMnEXqqS1MvtsyUX8KGTbsZ5aZQZjHD5vREQa5BkZ7ft8CceLBLAj8eZ5erZb9cHuy5", + "SIG_K1_Kj7XJxnPQSxEXZhMA8uK3Q1zAxp7AExzsRd7Xaa7ywcE4iUrhbVA3B6GWre5Ctgikb4q4CeU6Bvv5qmh9uJjqKEbbjd3sX", + "SIG_K1_KbE7qyz3A9LoQPYWzo4e6kg5ZVojQVAkDKuufUN2EwVUqtFhtjmGoC6QPQqLi8J7ftiysBp52wJBPjtNQUfZiGpGMsnZ1f", + "SIG_K1_KdQsE7ahHA9swE9SDGg4oF6XahpgHmZfEgQAy9KPBLd9HuwrF6c8m6jz43zizK2oo32Ejg1DYuMfoEvJgVfXo81jsqTHvA", + "SIG_K1_K6228Hi2z1WabgVdf5bk2UdKyyDSVFwkMaagTn9oLVDV8rCX7aQcjY94c39ah2CkLTsTEqzTPAYknJ8m2m9B7npPkHaFzc", + "SIG_K1_Jzdx75hBCA2WSaXgrupmrNbcQocUCsP8r1BKkPXMreiAKPZDwX9J3G8fS1HhyqWjc7FbukwZf8sVRdS3wKbJVpytqXe7Nn", + "SIG_K1_KW7Qu2SdPD3zuQKh2ziFLzn9QbKqeMpeiemULky5Bbg1Mst6ijbCX3k2AVFGNFLkNLA36PM1WAT5oipzu1B1K7ymRxTx1Z", + "SIG_K1_KXJf1KZNpz73YFKKE7u6jFgsQ8XcX3yA7rDX6ZmG1Qfnc9FLLmT1WViv4bwcPbxaEYfR6SNWfk5cCR9eao2si1soqkXq92", + "SIG_K1_JynjkHFT5UFGDpEcqdriXTzCGCwS36Xztq4UAWQHLQgRUZT2YFoLhUcc87kvUteqCUGVxsmSbfgWv1KLy24voKN4Qs5zTe", + "SIG_K1_JxhfCaGBhuNShpDHn7j1CryG3iSebvfi7FUnJsfkXNTiwLyq2NDBkeakwjCMWFbzr6qqWuMDLjfXbzdtU17f1wCXMjKSgk", + "SIG_K1_KcMSz89QG1ZRFNrXc69R63d5KXbJA8CBjNPYv1VEA3TRfjqVYuhyaHpGXQN4RSKDq4ygr3UTRYBQQVutkJnR6zZ4Ssgd7R", + "SIG_K1_JuxT6bhUAbDs6Q2ppuKyKauduvbaJLxvh4gBH4e4A9yRhvUBT7w3DcvMyhdaor27Kbu29jnqhTbvXcb57QqKWQDpboLv7e", + "SIG_K1_K8BuFYpCiC5FhpVK8ZAzc3VUg7vz6WwLoWBrGN6nnuqUjngGqvHp3UxDVzcwhqccHdv8kdPXvF6G1NszwF1dd3wjCrHBYw", + "SIG_K1_KfH5ZirPwDk1RQKvJv2AGPfsJyPXvXLegZ7LvcPmRtjtMiErs1STXLNT8kiBfhZr4xkWRA5NR1kMF3d49DFMJiB2iWMXJc", + "SIG_K1_KjJB8jtcqpVe3r5jouFiAa9wJeYqoLMh5xrUV6kBF6UWfbYjimMWBJWz2ZPomGDsk7JtdUESVrYj1AhYbdp3X48KLm5Cev" + ], + "context_free_data": [] +} +``` + +8. Push the signed transaction to the blockchain: + +```sh +cleos push transaction --skip-sign upgrade_system_contract_official_trx_signed.json +``` +```json +{ + "transaction_id": "202888b32e7a0f9de1b8483befac8118188c786380f6e62ced445f93fb2b1041", + "processed": { + "id": "202888b32e7a0f9de1b8483befac8118188c786380f6e62ced445f93fb2b1041", + "receipt": { + "status": "executed", + "cpu_usage_us": 4909, + "net_usage_words": 15124 + }, + "elapsed": 4909, + "net_usage": 120992, + "scheduled": false, + "action_traces": [{ +... +``` + +If you get an error message like the following: + +```console +Error 3090003: provided keys, permissions, and delays do not satisfy declared authorizations +Ensure that you have the related private keys inside your wallet and your wallet is unlocked. +``` + +That means that at least one of the signatures provided were bad. This may be because a producer signed the wrong transaction, used the wrong private key, or used the wrong chain ID. + +If you get an error message like the following: + +```console +Error 3090002: irrelevant signature included +Please remove the unnecessary signature from your transaction! +``` + +That means unnecessary signatures were included. If there are 21 active producers, only signatures from exactly 15 of those 21 active producers are needed. + +If you get an error message like the following: + +```console +Error 3040006: Transaction Expiration Too Far +Please decrease the expiration time of your transaction! +``` + +That means that the expiration time is more than 1 hour in the future and you need to wait some time before being allowed to push the transaction. + +If you get an error message like the following: + +```console +Error 3040005: Expired Transaction +Please increase the expiration time of your transaction! +``` + +That means the expiration time of the signed transaction has passed and this entire process has to restart from step 1. + +9. Assuming the transaction successfully executes, everyone can then verify that the new contract is in place: + +```sh +cleos get code -c new_system_contract.wast -a new_system_contract.abi eosio +``` +```console +code hash: 9fd195bc5a26d3cd82ae76b70bb71d8ce83dcfeb0e5e27e4e740998fdb7b98f8 +saving wast to new_system_contract.wast +saving abi to new_system_contract.abi +``` + +```sh +diff original_system_contract.abi new_system_contract.abi +``` +```json +584,592d583 +< },{ +< "name": "deferred_trx_id", +< "type": "uint32" +< },{ +< "name": "last_unstake_time", +< "type": "time_point_sec" +< },{ +< "name": "unstaking", +< "type": "asset" +``` \ No newline at end of file diff --git a/docs/04_guides/02_how-to-buy-ram.md b/docs/04_guides/02_how-to-buy-ram.md new file mode 100644 index 000000000..dee6776e8 --- /dev/null +++ b/docs/04_guides/02_how-to-buy-ram.md @@ -0,0 +1,28 @@ +--- +content_title: How to buy RAM +link_text: How to buy RAM +--- + +# Goal + +Setup an account that require multiple signatures for signing a transaction + +# Before you begin + +* You have an account + +* Ensure the reference system contracts from `eosio.contracts` repository is deployed and used to manage system resources + +* You have sufficient token allocated to your account + +* Install the currently supported version of cleos + +* Unlock your wallet + +# Steps + +Buys RAM in value of 0.1 SYS tokens for account `alice`: + +```shell +cleos system buyram alice alice "0.1 SYS" -p alice@active +``` \ No newline at end of file diff --git a/docs/04_guides/03_how-to-stake.md b/docs/04_guides/03_how-to-stake.md new file mode 100644 index 000000000..0413a01a9 --- /dev/null +++ b/docs/04_guides/03_how-to-stake.md @@ -0,0 +1,33 @@ +--- +content_title: How to stake +link_text: How to stake +--- + +# Goal + +Stake resource for your account + +# Before you begin + +* Install the currently supported version of cleos + +* Ensure the reference system contracts from `eosio.contracts` repository is deployed and used to manage system resources + +* Understand the following: + * What is an account + * What is network bandwidth + * What is CPU bandwidth + +# Steps + +Stake 0.01 SYS network bandwidth for `alice` + +```shell +cleos system delegatebw alice alice "0 SYS" "0.01 SYS" +``` + +Stake 0.01 SYS CPU bandwidth for `alice`: + +```shell +cleos system delegatebw alice alice "0.01 SYS" "0 SYS" +``` \ No newline at end of file diff --git a/docs/04_guides/04_how-to-vote.md b/docs/04_guides/04_how-to-vote.md new file mode 100644 index 000000000..ee9e1f961 --- /dev/null +++ b/docs/04_guides/04_how-to-vote.md @@ -0,0 +1,35 @@ +--- +content_title: How to vote +link_text: How to vote +--- + +# Goal + +Vote for a block producer + +# Before you begin + +* Install the current supported version of cleos + +* Ensure the reference system contracts from `eosio.contracts` repository is deployed and used to manage system resources + +* Understand the following: + * What is a block producer + * How does voting works + +* Unlock your wallet + +# Steps + +Assume you are going to vote for blockproducer1 and blockproducer2 from an account called `eosiotestts2`, execute the following: + +```bash +cleos system voteproducer prods eosiotestts2 blockproducer1 blockproducer2 +``` + +You should see something like below: + +```console +executed transaction: 2d8b58f7387aef52a1746d7a22d304bbbe0304481d7751fc4a50b619df62676d 128 bytes 374 us +# eosio <= eosio::voteproducer {"voter":"eosiotestts2","proxy":"","producers":["blockproducer1","blockproducer2"]} +``` \ No newline at end of file diff --git a/docs/04_guides/05_how-to-create-issue-and-transfer-a-token.md b/docs/04_guides/05_how-to-create-issue-and-transfer-a-token.md new file mode 100644 index 000000000..0a2bf436e --- /dev/null +++ b/docs/04_guides/05_how-to-create-issue-and-transfer-a-token.md @@ -0,0 +1,129 @@ +--- +content_title: How to create, issue and transfer a token +link_text: How to create, issue and transfer a token +--- + +## Step 1: Obtain Contract Source + +Navigate to your contracts directory. + +```sh +cd CONTRACTS_DIR +``` + +Pull the source +```sh +git clone https://github.com/EOSIO/eosio.contracts --branch master --single-branch +``` + +```sh +cd eosio.contracts/contracts/eosio.token +``` + +## Step 2: Create Account for Contract +[[info]] +| You may have to unlock your wallet first! + +```shell +cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV +``` + +## Step 3: Compile the Contract + +```shell +eosio-cpp -I include -o eosio.token.wasm src/eosio.token.cpp --abigen +``` + +## Step 4: Deploy the Token Contract + +```shell +cleos set contract eosio.token CONTRACTS_DIR/eosio.contracts/contracts/eosio.token --abi eosio.token.abi -p eosio.token@active +``` + +Result should look similar to the one below: +```console +Reading WASM from ... +Publishing contract... +executed transaction: 69c68b1bd5d61a0cc146b11e89e11f02527f24e4b240731c4003ad1dc0c87c2c 9696 bytes 6290 us +# eosio <= eosio::setcode {"account":"eosio.token","vmtype":0,"vmversion":0,"code":"0061736d0100000001aa011c60037f7e7f0060047f... +# eosio <= eosio::setabi {"account":"eosio.token","abi":"0e656f73696f3a3a6162692f312e30000605636c6f73650002056f776e6572046e61... +warning: transaction executed locally, but may not be confirmed by the network yet ] +``` + +## Step 5: Create the Token + +```shell +cleos push action eosio.token create '[ "eosio", "1000000000.0000 SYS"]' -p eosio.token@active +``` + +Result should look similar to the one below: +```console +executed transaction: 0e49a421f6e75f4c5e09dd738a02d3f51bd18a0cf31894f68d335cd70d9c0e12 120 bytes 1000 cycles +# eosio.token <= eosio.token::create {"issuer":"eosio","maximum_supply":"1000000000.0000 SYS"} +``` + +An alternate approach uses named arguments: + +```shell +cleos push action eosio.token create '{"issuer":"eosio", "maximum_supply":"1000000000.0000 SYS"}' -p eosio.token@active +``` + +Result should look similar to the one below: +```console +executed transaction: 0e49a421f6e75f4c5e09dd738a02d3f51bd18a0cf31894f68d335cd70d9c0e12 120 bytes 1000 cycles +# eosio.token <= eosio.token::create {"issuer":"eosio","maximum_supply":"1000000000.0000 SYS"} +``` +This command created a new token `SYS` with a precision of 4 decimals and a maximum supply of 1000000000.0000 SYS. To create this token requires the permission of the `eosio.token` contract. For this reason, `-p eosio.token@active` was passed to authorize the request. + +## Step 6: Issue Tokens + +The issuer can issue new tokens to the issuer account in our case `eosio`. + +```sh +cleos push action eosio.token issue '[ "eosio", "100.0000 SYS", "memo" ]' -p eosio@active +``` + +Result should look similar to the one below: +```console +executed transaction: a26b29d66044ad95edf0fc04bad3073e99718bc26d27f3c006589adedb717936 128 bytes 337 us +# eosio.token <= eosio.token::issue {"to":"eosio","quantity":"100.0000 SYS","memo":"memo"} +warning: transaction executed locally, but may not be confirmed by the network yet ] +``` + +## Step 7: Transfer Tokens + +Now that account `eosio` has been issued tokens, transfer some of them to account `bob`. + +```shell +cleos push action eosio.token transfer '[ "eosio", "bob", "25.0000 SYS", "m" ]' -p eosio@active +``` + +Result should look similar to the one below: +```console +executed transaction: 60d334850151cb95c35fe31ce2e8b536b51441c5fd4c3f2fea98edcc6d69f39d 128 bytes 497 us +# eosio.token <= eosio.token::transfer {"from":"eosio","to":"bob","quantity":"25.0000 SYS","memo":"m"} +# eosio <= eosio.token::transfer {"from":"eosio","to":"bob","quantity":"25.0000 SYS","memo":"m"} +# bob <= eosio.token::transfer {"from":"eosio","to":"bob","quantity":"25.0000 SYS","memo":"m"} +warning: transaction executed locally, but may not be confirmed by the network yet ] +``` +Now check if "bob" got the tokens using [cleos get currency balance](https://developers.eos.io/manuals/eos/latest/cleos/command-reference/get/currency-balance) + +```shell +cleos get currency balance eosio.token bob SYS +``` + +Result: +```console +25.00 SYS +``` + +Check "eosio's" balance, notice that tokens were deducted from the account + +```shell +cleos get currency balance eosio.token eosio SYS +``` + +Result: +```console +75.00 SYS +``` \ No newline at end of file diff --git a/docs/04_guides/06_how-to-sign-a-multisig-transaction-with-eosio.msig.md b/docs/04_guides/06_how-to-sign-a-multisig-transaction-with-eosio.msig.md new file mode 100644 index 000000000..6014c9ba1 --- /dev/null +++ b/docs/04_guides/06_how-to-sign-a-multisig-transaction-with-eosio.msig.md @@ -0,0 +1,188 @@ +--- +content_title: How to sign a multisig transaction with eosio.msig +link_text: How to sign a multisig transaction with eosio.msig +--- + +### eosio.msig + +### Prerequisites: + - eosio.token contract installed to eosio.token account, eosio.msig contract installed on eosio.msig account which is a priviliged account. + - account 'treasury' is the issuer of SYS token. + - account 'tester' exists. + - keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked. + +### One user creates a proposal: +```sh +cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token issue '{"to": "tester", "quantity": "1000.0000 SYS", "memo": ""}' -p tester +``` +```console +executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles +# eosio.msig <= eosio.msig::propose {"proposer":"tester","proposal_name":"test","requested":[{"actor":"treasury","permission":"active"}]... +``` + +### Another user reviews the transaction: +```sh +cleos multisig review tester test +``` +```json +{ + "proposal_name": "test", + "requested_approvals": [{ + "actor": "treasury", + "permission": "active" + } + ], + "provided_approvals": [], + "packed_transaction": "00aee75a0000000000000000000000000100a6823403ea30550000000000a5317601000000fe6a6cd4cd00000000a8ed323219000000005c95b1ca809698000000000004454f530000000000", + "transaction": { + "expiration": "2018-05-01T00:00:00", + "region": 0, + "ref_block_num": 0, + "ref_block_prefix": 0, + "max_net_usage_words": 0, + "max_kcpu_usage": 0, + "delay_sec": 0, + "context_free_actions": [], + "actions": [{ + "account": "eosio.token", + "name": "issue", + "authorization": [{ + "actor": "treasury", + "permission": "active" + } + ], + "data": { + "to": "tester", + "quantity": "1000.0000 SYS", + "memo": "" + }, + "hex_data": "000000005c95b1ca809698000000000004454f530000000000" + } + ] + } +} +``` + +### And then approves it: +```sh +cleos multisig approve tester test '{"actor": "treasury", "permission": "active"}' -p treasury +``` +```console +executed transaction: 475970a4b0016368d0503d1ce01577376f91f5a5ba63dd4353683bd95101b88d 256 bytes 108544 cycles +# eosio.msig <= eosio.msig::approve {"proposer":"tester","proposal_name":"test","level":{"actor":"treasury","permission":"active"}} +``` + +### First user initiates execution: +```sh +cleos multisig exec tester test -p tester +``` +```console +executed transaction: 64e5eaceb77362694055f572ae35876111e87b637a55250de315b1b55e56d6c2 248 bytes 109568 cycles +# eosio.msig <= eosio.msig::exec {"proposer":"tester","proposal_name":"test","executer":"tester"} +``` + + +## Cleos usage example for transferring tokens. + +### Prerequisites: + - eosio.token contract installed to eosio.token account, eosio.msig contract installed on eosio.msig account which is a priviliged account. + - account 'treasury' has at least 1.1000 SYS token balance. + - account 'tester' exists. + - keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked. + +### One user creates a proposal: +```sh +cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token transfer '{"from": "treasury", "to": "tester", "quantity": "1.0000 SYS", "memo": ""}' -p tester +``` +```console +executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles +# eosio.msig <= eosio.msig::propose {"proposer":"tester","proposal_name":"test","requested":[{"actor":"treasury","permission":"active"}]... +``` + +### Another user reviews the transaction: +```sh +cleos multisig review tester test +``` +```json +{ + "proposal_name": "test", + "requested_approvals": [{ + "actor": "treasury", + "permission": "active" + } + ], + "provided_approvals": [], + "packed_transaction": "00aee75a0000000000000000000000000100a6823403ea30550000000000a5317601000000fe6a6cd4cd00000000a8ed323219000000005c95b1ca809698000000000004454f530000000000", + "transaction": { + "expiration": "2018-05-01T00:00:00", + "region": 0, + "ref_block_num": 0, + "ref_block_prefix": 0, + "max_net_usage_words": 0, + "max_kcpu_usage": 0, + "delay_sec": 0, + "context_free_actions": [], + "actions": [{ + "account": "eosio.token", + "name": "transfer", + "authorization": [{ + "actor": "treasury", + "permission": "active" + } + ], + "data": { + "from": "treasury", + "to": "tester", + "quantity": "1.0000 SYS", + "memo": "" + }, + "hex_data": "000000005c95b1ca809698000000000004454f530000000000" + } + ] + } +} +``` + +### And then approves it: +```sh +cleos multisig approve tester test '{"actor": "treasury", "permission": "active"}' -p treasury +``` +```console +executed transaction: 475970a4b0016368d0503d1ce01577376f91f5a5ba63dd4353683bd95101b88d 256 bytes 108544 cycles +# eosio.msig <= eosio.msig::approve {"proposer":"tester","proposal_name":"test","level":{"actor":"treasury","permission":"active"}} +``` + +### First user check account balance before executing the proposed transaction +```sh +cleos get account tester +``` +```console +... +SYS balances: + liquid: 1.0487 SYS + staked: 2.0000 SYS + unstaking: 0.0000 SYS + total: 4.0487 SYS +``` + +### First user initiates execution of proposed transaction: +```sh +cleos multisig exec tester test -p tester +``` +```console +executed transaction: 64e5eaceb77362694055f572ae35876111e87b637a55250de315b1b55e56d6c2 248 bytes 109568 cycles +# eosio.msig <= eosio.msig::exec {"proposer":"tester","proposal_name":"test","executer":"tester"} +``` + +### First user can check account balance, it should be increased by 1.0000 SYS +```sh +cleos get account tester +``` +```console +... +SYS balances: + liquid: 2.0487 SYS + staked: 2.0000 SYS + unstaking: 0.0000 SYS + total: 4.0487 SYS +``` diff --git a/eosio.wrap/README.md b/docs/04_guides/07_how-to-use-eosio.wrap.md similarity index 91% rename from eosio.wrap/README.md rename to docs/04_guides/07_how-to-use-eosio.wrap.md index 0bbdb1d82..807441c28 100644 --- a/eosio.wrap/README.md +++ b/docs/04_guides/07_how-to-use-eosio.wrap.md @@ -1,18 +1,9 @@ -# eosio.wrap +--- +content_title: How to use eosio.wrap +link_text: How to use eosio.wrap +--- -## 1. Actions: -The naming convention is codeaccount::actionname followed by a list of parameters. - -Execute a transaction while bypassing regular authorization checks (requires authorization of eosio.wrap which needs to be a privileged account). - -### eosio.wrap::exec executer trx - - **executer** account executing the transaction - - **trx** transaction to execute - - Deferred transaction RAM usage is billed to 'executer' - - -## 2. Installing the eosio.wrap contract +# 1. Installing the eosio.wrap contract The eosio.wrap contract needs to be installed on a privileged account to function. It is recommended to use the account `eosio.wrap`. @@ -22,9 +13,9 @@ The `eosio.wrap` account also needs to have sufficient RAM to host the contract This guide will be using cleos to carry out the process. -### 2.1 Create the eosio.wrap account +## 1.1 Create the eosio.wrap account -#### 2.1.1 Generate the transaction to create the eosio.wrap account +### 1.1.1 Generate the transaction to create the eosio.wrap account The transaction to create the `eosio.wrap` account will need to be proposed to get the necessary approvals from active block producers before executing it. This transaction needs to first be generated and stored as JSON into a file so that it can be used in the cleos command to propose the transaction to the eosio.msig contract. @@ -33,11 +24,17 @@ A simple way to generate a transaction to create a new account is to use the `cl Three unsigned transactions will be generated using cleos and then the actions within those transactions will be appropriately stitched together into a single transaction which will later be proposed using the eosio.msig contract. First, generate a transaction to capture the necessary actions involved in creating a new account: +```sh +cleos system newaccount -s -j -d --transfer --stake-net "1.000 SYS" --stake-cpu "1.000 SYS" --buy-ram-kbytes 50 eosio eosio.wrap EOS8MMUW11TAdTDxqdSwSqJodefSoZbFhcprndomgLi9MeR2o8MT4 > generated_account_creation_trx.json ``` -$ cleos system newaccount -s -j -d --transfer --stake-net "1.000 SYS" --stake-cpu "1.000 SYS" --buy-ram-kbytes 50 eosio eosio.wrap EOS8MMUW11TAdTDxqdSwSqJodefSoZbFhcprndomgLi9MeR2o8MT4 > generated_account_creation_trx.json +```console 726964ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000000000ea305500004d1a03ea305500c80000"} arg: {"code":"eosio","action":"buyrambytes","args":{"payer":"eosio","receiver":"eosio.wrap","bytes":51200}} 726967ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000000000ea305500004d1a03ea3055102700000000000004535953000000001027000000000000045359530000000001"} arg: {"code":"eosio","action":"delegatebw","args":{"from":"eosio","receiver":"eosio.wrap","stake_net_quantity":"1.0000 SYS","stake_cpu_quantity":"1.0000 SYS","transfer":true}} -$ cat generated_account_creation_trx.json +``` +```sh +cat generated_account_creation_trx.json +``` +```json { "expiration": "2018-06-29T17:11:36", "ref_block_num": 16349, @@ -80,12 +77,15 @@ $ cat generated_account_creation_trx.json "context_free_data": [] } ``` + Adjust the amount of delegated tokens and the amount of RAM bytes to gift as necessary. The actual public key used is not important since that data is only encoded into the `eosio::newaccount` action which will be replaced soon anyway. Second, create a file (e.g. newaccount_payload.json) with the JSON payload for the real `eosio::newaccount` action. It should look like: +```sh +cat newaccount_payload.json ``` -$ cat newaccount_payload.json +```json { "creator": "eosio", "name": "eosio.wrap", @@ -111,9 +111,11 @@ $ cat newaccount_payload.json ``` Third, generate a transaction containing the actual `eosio::newaccount` action that will be used in the final transaction: +```sh +cleos push action -s -j -d eosio newaccount newaccount_payload.json -p eosio > generated_newaccount_trx.json +cat generated_newaccount_trx.json ``` -$ cleos push action -s -j -d eosio newaccount newaccount_payload.json -p eosio > generated_newaccount_trx.json -$ cat generated_newaccount_trx.json +```json { "expiration": "2018-06-29T17:11:36", "ref_block_num": 16349, @@ -140,9 +142,11 @@ $ cat generated_newaccount_trx.json ``` Fourth, generate a transaction containing the `eosio::setpriv` action which will make the `eosio.wrap` account privileged: +```sh +cleos push action -s -j -d eosio setpriv '{"account": "eosio.wrap", "is_priv": 1}' -p eosio > generated_setpriv_trx.json +cat generated_setpriv_trx.json ``` -$ cleos push action -s -j -d eosio setpriv '{"account": "eosio.wrap", "is_priv": 1}' -p eosio > generated_setpriv_trx.json -$ cat generated_setpriv_trx.json +```json { "expiration": "2018-06-29T17:11:36", "ref_block_num": 16349, @@ -169,8 +173,10 @@ $ cat generated_setpriv_trx.json ``` Next, the action JSONs of the previously generated transactions will be used to construct a unified transaction which will eventually be proposed with the eosio.msig contract. A good way to get started is to make a copy of the generated_newaccount_trx.json file (call the copied file create_wrap_account_trx.json) and edit the first three fields so it looks something like the following: +```sh +cat create_wrap_account_trx.json ``` -$ cat create_wrap_account_trx.json +```json { "expiration": "2018-07-06T12:00:00", "ref_block_num": 0, @@ -199,8 +205,10 @@ $ cat create_wrap_account_trx.json The `ref_block_num` and `ref_block_prefix` values were set to 0. The proposed transaction does not need to have a valid TaPoS reference block because it will be reset anyway when scheduled as a deferred transaction during the `eosio.msig::exec` action. The `expiration` field, which was the only other field that was changed, will also be reset when the proposed transaction is scheduled as a deferred transaction during `eosio.msig::exec`. However, this field actually does matter during the propose-approve-exec lifecycle of the proposed transaction. If the present time passes the time in the `expiration` field of the proposed transaction, it will not be possible to execute the proposed transaction even if all necessary approvals are gathered. Therefore, it is important to set the expiration time to some point well enough in the future to give all necessary approvers enough time to review and approve the proposed transaction, but it is otherwise arbitrary. Generally, for reviewing/validation purposes it is important that all potential approvers of the transaction (i.e. the block producers) choose the exact same `expiration` time so that there is not any discrepancy in bytes of the serialized transaction if it was to later be included in payload data of some other action. Then, all but the first action JSON object of generated_account_creation_trx.json should be appended to the `actions` array of create_wrap_account_trx.json, and then the single action JSON object of generated_setpriv_trx.json should be appended to the `actions` array of create_wrap_account_trx.json. The final result is a create_wrap_account_trx.json file that looks like the following: +```sh +cat create_wrap_account_trx.json ``` -$ cat create_wrap_account_trx.json +```json { "expiration": "2018-07-06T12:00:00", "ref_block_num": 0, @@ -260,8 +268,10 @@ It will be useful to have a JSON of the active permissions of each of the active This guide will assume that there are 21 active block producers on the chain with account names: `blkproducera`, `blkproducerb`, ..., `blkproduceru`. In that case, create a file producer_permissions.json with the content shown in the command below: +```sh +cat producer_permissions.json ``` -$ cat producer_permissions.json +```json [ {"actor": "blkproducera", "permission": "active"}, {"actor": "blkproducerb", "permission": "active"}, @@ -287,7 +297,7 @@ $ cat producer_permissions.json ] ``` -#### 2.1.2 Propose the transaction to create the eosio.wrap account +### 1.1.2 Propose the transaction to create the eosio.wrap account Only one of the potential approvers will need to propose the transaction that was created in the previous sub-section. All the other approvers should still follow the steps in the previous sub-section to generate the same create_wrap_account_trx.json file as all the other approvers. They will need this to compare to the actual proposed transaction prior to approving. @@ -296,21 +306,25 @@ The approvers are typically going to be the active block producers of the chain, The guide will assume that `blkproducera` was chosen as the lead block producer to propose the transaction. The lead block producer (`blkproducera`) should propose the transaction stored in create_wrap_account_trx.json: +```sh +cleos multisig propose_trx createwrap producer_permissions.json create_wrap_account_trx.json blkproducera ``` -$ cleos multisig propose_trx createwrap producer_permissions.json create_wrap_account_trx.json blkproducera +```console executed transaction: bf6aaa06b40e2a35491525cb11431efd2b5ac94e4a7a9c693c5bf0cfed942393 744 bytes 772 us # eosio.msig <= eosio.msig::propose {"proposer":"blkproducera","proposal_name":"createwrap","requested":[{"actor":"blkproducera","permis... warning: transaction executed locally, but may not be confirmed by the network yet ``` -#### 2.1.3 Review and approve the transaction to create the eosio.wrap account +### 1.1.3 Review and approve the transaction to create the eosio.wrap account Each of the potential approvers of the proposed transaction (i.e. the active block producers) should first review the proposed transaction to make sure they are not approving anything that they do not agree to. The proposed transaction can be reviewed using the `cleos multisig review` command: +```sh +cleos multisig review blkproducera createwrap > create_wrap_account_trx_to_review.json +head -n 30 create_wrap_account_trx_to_review.json ``` -$ cleos multisig review blkproducera createwrap > create_wrap_account_trx_to_review.json -$ head -n 30 create_wrap_account_trx_to_review.json +```json { "proposal_name": "createwrap", "packed_transaction": "c0593f5b00000000000000000000040000000000ea305500409e9a2264b89a010000000000ea305500000000a8ed3232420000000000ea305500004d1a03ea30550100000000010000000000ea305500000000a8ed32320100000100000000010000000000ea305500000000a8ed32320100000000000000ea305500b0cafe4873bd3e010000000000ea305500000000a8ed3232140000000000ea305500004d1a03ea3055002800000000000000ea305500003f2a1ba6a24a010000000000ea305500000000a8ed3232310000000000ea305500004d1a03ea30551027000000000000045359530000000010270000000000000453595300000000010000000000ea305500000060bb5bb3c2010000000000ea305500000000a8ed32320900004d1a03ea30550100", @@ -344,38 +358,52 @@ $ head -n 30 create_wrap_account_trx_to_review.json ``` The approvers should go through the full human-readable transaction output and make sure everything looks fine. But they can also use tools to automatically compare the proposed transaction to the one they generated to make sure there are absolutely no differences: +```sh +cleos multisig propose_trx -j -s -d createwrap '[]' create_wrap_account_trx.json blkproducera | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > expected_create_wrap_trx_serialized.hex +cat expected_create_wrap_trx_serialized.hex ``` -$ cleos multisig propose_trx -j -s -d createwrap '[]' create_wrap_account_trx.json blkproducera | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > expected_create_wrap_trx_serialized.hex -$ cat expected_create_wrap_trx_serialized.hex +```console c0593f5b00000000000000000000040000000000ea305500409e9a2264b89a010000000000ea305500000000a8ed3232420000000000ea305500004d1a03ea30550100000000010000000000ea305500000000a8ed32320100000100000000010000000000ea305500000000a8ed32320100000000000000ea305500b0cafe4873bd3e010000000000ea305500000000a8ed3232140000000000ea305500004d1a03ea3055002800000000000000ea305500003f2a1ba6a24a010000000000ea305500000000a8ed3232310000000000ea305500004d1a03ea30551027000000000000045359530000000010270000000000000453595300000000010000000000ea305500000060bb5bb3c2010000000000ea305500000000a8ed32320900004d1a03ea30550100 -$ cat create_wrap_account_trx_to_review.json | grep '"packed_transaction":' | sed 's/^[ \t]*"packed_transaction":[ \t]*//;s/[",]//g' > proposed_create_wrap_trx_serialized.hex -$ cat proposed_create_wrap_trx_serialized.hex +``` +```sh +cat create_wrap_account_trx_to_review.json | grep '"packed_transaction":' | sed 's/^[ \t]*"packed_transaction":[ \t]*//;s/[",]//g' > proposed_create_wrap_trx_serialized.hex +cat proposed_create_wrap_trx_serialized.hex +``` +```console c0593f5b00000000000000000000040000000000ea305500409e9a2264b89a010000000000ea305500000000a8ed3232420000000000ea305500004d1a03ea30550100000000010000000000ea305500000000a8ed32320100000100000000010000000000ea305500000000a8ed32320100000000000000ea305500b0cafe4873bd3e010000000000ea305500000000a8ed3232140000000000ea305500004d1a03ea3055002800000000000000ea305500003f2a1ba6a24a010000000000ea305500000000a8ed3232310000000000ea305500004d1a03ea30551027000000000000045359530000000010270000000000000453595300000000010000000000ea305500000060bb5bb3c2010000000000ea305500000000a8ed32320900004d1a03ea30550100 -$ diff expected_create_wrap_trx_serialized.hex proposed_create_wrap_trx_serialized.hex +``` +```sh +diff expected_create_wrap_trx_serialized.hex proposed_create_wrap_trx_serialized.hex ``` When an approver (e.g. `blkproducerb`) is satisfied with the proposed transaction, they can simply approve it: +```sh +cleos multisig approve blkproducera createwrap '{"actor": "blkproducerb", "permission": "active"}' -p blkproducerb ``` -$ cleos multisig approve blkproducera createwrap '{"actor": "blkproducerb", "permission": "active"}' -p blkproducerb +```console executed transaction: 03a907e2a3192aac0cd040c73db8273c9da7696dc7960de22b1a479ae5ee9f23 128 bytes 472 us # eosio.msig <= eosio.msig::approve {"proposer":"blkproducera","proposal_name":"createwrap","level":{"actor":"blkproducerb","permission"... warning: transaction executed locally, but may not be confirmed by the network yet ``` -#### 2.1.4 Execute the transaction to create the eosio.wrap account +### 1.1.4 Execute the transaction to create the eosio.wrap account When the necessary approvals are collected (in this example, with 21 block producers, at least 15 of their approvals were required), anyone can push the `eosio.msig::exec` action which executes the approved transaction. It makes a lot of sense for the lead block producer who proposed the transaction to also execute it (this will incur another temporary RAM cost for the deferred transaction that is generated by the eosio.msig contract). +```sh +cleos multisig exec blkproducera createwrap blkproducera ``` -$ cleos multisig exec blkproducera createwrap blkproducera +```console executed transaction: 7ecc183b99915cc411f96dde7c35c3fe0df6e732507f272af3a039b706482e5a 160 bytes 850 us # eosio.msig <= eosio.msig::exec {"proposer":"blkproducera","proposal_name":"createwrap","executer":"blkproducera"} warning: transaction executed locally, but may not be confirmed by the network yet ``` Anyone can now verify that the `eosio.wrap` was created: +```sh +cleos get account eosio.wrap ``` -$ cleos get account eosio.wrap +```console privileged: true permissions: owner 1: 1 eosio@active, @@ -398,22 +426,27 @@ cpu bandwidth: limit: 460.8 ms producers: - ``` -### 2.2 Deploy the eosio.wrap contract +## 1.2 Deploy the eosio.wrap contract -#### 2.2.1 Generate the transaction to deploy the eosio.wrap contract +### 1.2.1 Generate the transaction to deploy the eosio.wrap contract The transaction to deploy the contract to the `eosio.wrap` account will need to be proposed to get the necessary approvals from active block producers before executing it. This transaction needs to first be generated and stored as JSON into a file so that it can be used in the cleos command to propose the transaction to the eosio.msig contract. The easy way to generate this transaction is using cleos: +```sh +cleos set contract -s -j -d eosio.wrap contracts/eosio.wrap/ > deploy_wrap_contract_trx.json ``` -$ cleos set contract -s -j -d eosio.wrap contracts/eosio.wrap/ > deploy_wrap_contract_trx.json +```console Reading WAST/WASM from contracts/eosio.wrap/eosio.wrap.wasm... Using already assembled WASM... Publishing contract... -$ cat deploy_wrap_contract_trx.json +``` +```sh +cat deploy_wrap_contract_trx.json +``` +```json { "expiration": "2018-06-29T19:55:26", "ref_block_num": 18544, @@ -449,8 +482,10 @@ $ cat deploy_wrap_contract_trx.json ``` Once again, as described in sub-section 2.1.1, edit the values of the `ref_block_num` and `ref_block_prefix` fields to be 0 and edit the time of the `expiration` field to some point in the future that provides enough time to approve and execute the proposed transaction. After editing deploy_wrap_contract_trx.json the first few lines of it may look something like the following: +```sh +head -n 9 deploy_wrap_contract_trx.json ``` -$ head -n 9 deploy_wrap_contract_trx.json +```json { "expiration": "2018-07-06T12:00:00", "ref_block_num": 0, @@ -464,7 +499,7 @@ $ head -n 9 deploy_wrap_contract_trx.json This guide will assume that there are 21 active block producers on the chain with account names: `blkproducera`, `blkproducerb`, ..., `blkproduceru`. The end of sub-section 2.1.1 displayed what the JSON of the active permissions of each of the active block producers would look like given the assumptions about the active block producer set. That JSON was stored in the file producer_permissions.json; if the approvers (i.e. block producers) have not created that file already, they should create that file now as shown at the end of sub-section 2.1.1. -#### 2.2.2 Propose the transaction to deploy the eosio.wrap contract +### 1.2.2 Propose the transaction to deploy the eosio.wrap contract Only one of the potential approvers will need to propose the transaction that was created in the previous sub-section. All the other approvers should still follow the steps in the previous sub-section to generate the same deploy_wrap_contract_trx.json file as all the other approvers. They will need this to compare to the actual proposed transaction prior to approving. @@ -473,21 +508,25 @@ The approvers are typically going to be the active block producers of the chain, This guide will assume that `blkproducera` was chosen as the lead block producer to propose the transaction. The lead block producer (`blkproducera`) should propose the transaction stored in deploy_wrap_contract_trx.json: +```sh +cleos multisig propose_trx deploywrap producer_permissions.json deploy_wrap_contract_trx.json blkproducera ``` -$ cleos multisig propose_trx deploywrap producer_permissions.json deploy_wrap_contract_trx.json blkproducera +```console executed transaction: 9e50dd40eba25583a657ee8114986a921d413b917002c8fb2d02e2d670f720a8 4312 bytes 871 us # eosio.msig <= eosio.msig::propose {"proposer":"blkproducera","proposal_name":"deploywrap","requested":[{"actor":"blkproducera","permis... warning: transaction executed locally, but may not be confirmed by the network yet ``` -#### 2.2.3 Review and approve the transaction to deploy the eosio.wrap contract +### 1.2.3 Review and approve the transaction to deploy the eosio.wrap contract Each of the potential approvers of the proposed transaction (i.e. the active block producers) should first review the proposed transaction to make sure they are not approving anything that they do not agree to. The proposed transaction can be reviewed using the `cleos multisig review` command: +```sh +cleos multisig review blkproducera deploywrap > deploy_wrap_contract_trx_to_review.json +cat deploy_wrap_contract_trx_to_review.json ``` -$ cleos multisig review blkproducera deploywrap > deploy_wrap_contract_trx_to_review.json -$ cat deploy_wrap_contract_trx_to_review.json +```json { "proposal_name": "deploywrap", "packed_transaction": "c0593f5b00000000000000000000020000000000ea305500000040258ab2c20100004d1a03ea305500000000a8ed3232d41800004d1a03ea30550000c8180061736d01000000013e0c60017f006000017e60027e7e0060017e006000017f60027f7f017f60027f7f0060037f7f7f017f60057f7e7f7f7f0060000060037e7e7e0060017f017f029d010803656e7610616374696f6e5f646174615f73697a65000403656e760c63757272656e745f74696d65000103656e760c656f73696f5f617373657274000603656e76066d656d637079000703656e7610726561645f616374696f6e5f64617461000503656e760c726571756972655f61757468000303656e760d726571756972655f6175746832000203656e760d73656e645f64656665727265640008030f0e0505050400000a05070b050b000904050170010202050301000107c7010b066d656d6f72790200165f5a6571524b3131636865636b73756d32353653315f0008165f5a6571524b3131636865636b73756d31363053315f0009165f5a6e65524b3131636865636b73756d31363053315f000a036e6f77000b305f5a4e35656f73696f3132726571756972655f6175746845524b4e535f31367065726d697373696f6e5f6c6576656c45000c155f5a4e35656f73696f347375646f34657865634576000d056170706c79000e066d656d636d700010066d616c6c6f630011046672656500140908010041000b02150d0a9a130e0b002000200141201010450b0b002000200141201010450b0d0020002001412010104100470b0a00100142c0843d80a70b0e002000290300200029030810060b9e0102017e027f410028020441206b2202210341002002360204200029030010050240024010002200418104490d002000101121020c010b410020022000410f6a4170716b22023602040b2002200010041a200041074b41101002200341186a2002410810031a2003290318100520032903182101200310013703002003200137030820032003290318200241086a2000410010074100200341206a3602040bfd0403027f047e017f4100410028020441206b220936020442002106423b2105412021044200210703400240024002400240024020064206560d0020042c00002203419f7f6a41ff017141194b0d01200341a5016a21030c020b420021082006420b580d020c030b200341d0016a41002003414f6a41ff01714105491b21030b2003ad42388642388721080b2008421f83200542ffffffff0f838621080b200441016a2104200642017c2106200820078421072005427b7c2205427a520d000b024020072002520d0042002106423b2105413021044200210703400240024002400240024020064204560d0020042c00002203419f7f6a41ff017141194b0d01200341a5016a21030c020b420021082006420b580d020c030b200341d0016a41002003414f6a41ff01714105491b21030b2003ad42388642388721080b2008421f83200542ffffffff0f838621080b200441016a2104200642017c2106200820078421072005427b7c2205427a520d000b200720015141c00010020b0240024020012000510d0042002106423b2105412021044200210703400240024002400240024020064206560d0020042c00002203419f7f6a41ff017141194b0d01200341a5016a21030c020b420021082006420b580d020c030b200341d0016a41002003414f6a41ff01714105491b21030b2003ad42388642388721080b2008421f83200542ffffffff0f838621080b200441016a2104200642017c2106200820078421072005427b7c2205427a520d000b20072002520d010b20092000370318200242808080808080a0aad700520d00200941003602142009410136021020092009290310370208200941186a200941086a100f1a0b4100200941206a3602040b8c0101047f4100280204220521042001280204210220012802002101024010002203450d00024020034180044d0d00200310112205200310041a200510140c010b410020052003410f6a4170716b22053602042005200310041a0b200020024101756a210302402002410171450d00200328020020016a28020021010b200320011100004100200436020441010b4901037f4100210502402002450d000240034020002d0000220320012d00002204470d01200141016a2101200041016a21002002417f6a22020d000c020b0b200320046b21050b20050b0900418001200010120bcd04010c7f02402001450d00024020002802c041220d0d004110210d200041c0c1006a41103602000b200141086a200141046a41077122026b200120021b210202400240024020002802c441220a200d4f0d002000200a410c6c6a4180c0006a21010240200a0d0020004184c0006a220d2802000d0020014180c000360200200d20003602000b200241046a210a034002402001280208220d200a6a20012802004b0d002001280204200d6a220d200d28020041808080807871200272360200200141086a22012001280200200a6a360200200d200d28020041808080807872360200200d41046a22010d030b2000101322010d000b0b41fcffffff0720026b2104200041c8c1006a210b200041c0c1006a210c20002802c8412203210d03402000200d410c6c6a22014188c0006a28020020014180c0006a22052802004641d0c200100220014184c0006a280200220641046a210d0340200620052802006a2107200d417c6a2208280200220941ffffffff07712101024020094100480d000240200120024f0d000340200d20016a220a20074f0d01200a280200220a4100480d012001200a41ffffffff07716a41046a22012002490d000b0b20082001200220012002491b200941808080807871723602000240200120024d0d00200d20026a200420016a41ffffffff07713602000b200120024f0d040b200d20016a41046a220d2007490d000b41002101200b4100200b28020041016a220d200d200c280200461b220d360200200d2003470d000b0b20010f0b2008200828020041808080807872360200200d0f0b41000b870501087f20002802c44121010240024041002d00a643450d0041002802a84321070c010b3f002107410041013a00a6434100200741107422073602a8430b200721030240024002400240200741ffff036a41107622023f0022084d0d00200220086b40001a4100210820023f00470d0141002802a84321030b41002108410020033602a84320074100480d0020002001410c6c6a210220074180800441808008200741ffff037122084181f8034922061b6a2008200741ffff077120061b6b20076b2107024041002d00a6430d003f002103410041013a00a6434100200341107422033602a8430b20024180c0006a210220074100480d01200321060240200741076a417871220520036a41ffff036a41107622083f0022044d0d00200820046b40001a20083f00470d0241002802a84321060b4100200620056a3602a8432003417f460d0120002001410c6c6a22014184c0006a2802002206200228020022086a2003460d020240200820014188c0006a22052802002201460d00200620016a2206200628020041808080807871417c20016b20086a72360200200520022802003602002006200628020041ffffffff07713602000b200041c4c1006a2202200228020041016a220236020020002002410c6c6a22004184c0006a200336020020004180c0006a220820073602000b20080f0b02402002280200220820002001410c6c6a22034188c0006a22012802002207460d0020034184c0006a28020020076a2203200328020041808080807871417c20076b20086a72360200200120022802003602002003200328020041ffffffff07713602000b2000200041c4c1006a220728020041016a22033602c0412007200336020041000f0b2002200820076a36020020020b7b01037f024002402000450d0041002802c04222024101480d004180c10021032002410c6c4180c1006a21010340200341046a2802002202450d010240200241046a20004b0d00200220032802006a20004b0d030b2003410c6a22032001490d000b0b0f0b2000417c6a2203200328020041ffffffff07713602000b0300000b0bcf01060041040b04b04900000041100b0572656164000041200b086f6e6572726f72000041300b06656f73696f000041c0000b406f6e6572726f7220616374696f6e277320617265206f6e6c792076616c69642066726f6d207468652022656f73696f222073797374656d206163636f756e74000041d0c2000b566d616c6c6f635f66726f6d5f6672656564207761732064657369676e656420746f206f6e6c792062652063616c6c6564206166746572205f686561702077617320636f6d706c6574656c7920616c6c6f6361746564000000000000ea305500000000b863b2c20100004d1a03ea305500000000a8ed3232e90400004d1a03ea3055df040e656f73696f3a3a6162692f312e30030c6163636f756e745f6e616d65046e616d650f7065726d697373696f6e5f6e616d65046e616d650b616374696f6e5f6e616d65046e616d6506107065726d697373696f6e5f6c6576656c0002056163746f720c6163636f756e745f6e616d650a7065726d697373696f6e0f7065726d697373696f6e5f6e616d6506616374696f6e0004076163636f756e740c6163636f756e745f6e616d65046e616d650b616374696f6e5f6e616d650d617574686f72697a6174696f6e127065726d697373696f6e5f6c6576656c5b5d0464617461056279746573127472616e73616374696f6e5f68656164657200060a65787069726174696f6e0e74696d655f706f696e745f7365630d7265665f626c6f636b5f6e756d0675696e743136107265665f626c6f636b5f7072656669780675696e743332136d61785f6e65745f75736167655f776f7264730976617275696e743332106d61785f6370755f75736167655f6d730575696e74380964656c61795f7365630976617275696e74333209657874656e73696f6e000204747970650675696e74313604646174610562797465730b7472616e73616374696f6e127472616e73616374696f6e5f6865616465720314636f6e746578745f667265655f616374696f6e7308616374696f6e5b5d07616374696f6e7308616374696f6e5b5d167472616e73616374696f6e5f657874656e73696f6e730b657874656e73696f6e5b5d046578656300020865786563757465720c6163636f756e745f6e616d65037472780b7472616e73616374696f6e0100000000008054570465786563000000000000", @@ -537,57 +576,77 @@ $ cat deploy_wrap_contract_trx_to_review.json Each approver should be able to see that the proposed transaction is setting the code and ABI of the `eosio.wrap` contract. But the data is just hex data and therefore not very meaningful to the approver. And considering that `eosio.wrap` at this point should be a privileged contract, it would be very dangerous for block producers to just allow a contract to be deployed to a privileged account without knowing exactly which WebAssembly code they are deploying and also auditing the source code that generated that WebAssembly code to ensure it is safe to deploy. This guide assumes that each approver has already audited the source code of the contract to be deployed and has already compiled that code to generate the WebAssembly code that should be byte-for-byte identical to the code that every other approver following the same process should have generated. The guide also assumes that this generated code and its associated ABI were provided in the steps in sub-section 2.2.1 that generated the transaction in the deploy_wrap_contract_trx.json file. It then becomes quite simple to verify that the proposed transaction is identical to the one the potential approver could have proposed with the code and ABI that they already audited: +```sh +cleos multisig propose_trx -j -s -d deploywrap '[]' deploy_wrap_contract_trx.json blkproducera | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > expected_deploy_wrap_trx_serialized.hex +cat expected_deploy_wrap_trx_serialized.hex | cut -c -50 ``` -$ cleos multisig propose_trx -j -s -d deploywrap '[]' deploy_wrap_contract_trx.json blkproducera | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > expected_deploy_wrap_trx_serialized.hex -$ cat expected_deploy_wrap_trx_serialized.hex | cut -c -50 +```console c0593f5b00000000000000000000020000000000ea30550000 -$ cat deploy_wrap_account_trx_to_review.json | grep '"packed_transaction":' | sed 's/^[ \t]*"packed_transaction":[ \t]*//;s/[",]//g' > proposed_deploy_wrap_trx_serialized.hex -$ cat proposed_deploy_wrap_trx_serialized.hex | cut -c -50 +``` +```sh +cat deploy_wrap_account_trx_to_review.json | grep '"packed_transaction":' | sed 's/^[ \t]*"packed_transaction":[ \t]*//;s/[",]//g' > proposed_deploy_wrap_trx_serialized.hex +cat proposed_deploy_wrap_trx_serialized.hex | cut -c -50 +``` +```console c0593f5b00000000000000000000020000000000ea30550000 -$ diff expected_deploy_wrap_trx_serialized.hex proposed_deploy_wrap_trx_serialized.hex +``` +```sh +diff expected_deploy_wrap_trx_serialized.hex proposed_deploy_wrap_trx_serialized.hex ``` When an approver (e.g. `blkproducerb`) is satisfied with the proposed transaction, they can simply approve it: +```sh +cleos multisig approve blkproducera deploywrap '{"actor": "blkproducerb", "permission": "active"}' -p blkproducerb ``` -$ cleos multisig approve blkproducera deploywrap '{"actor": "blkproducerb", "permission": "active"}' -p blkproducerb +```console executed transaction: d1e424e05ee4d96eb079fcd5190dd0bf35eca8c27dd7231b59df8e464881abfd 128 bytes 483 us # eosio.msig <= eosio.msig::approve {"proposer":"blkproducera","proposal_name":"deploywrap","level":{"actor":"blkproducerb","permission"... warning: transaction executed locally, but may not be confirmed by the network yet ``` -#### 2.2.4 Execute the transaction to create the eosio.wrap account +### 1.2.4 Execute the transaction to create the eosio.wrap account When the necessary approvals are collected (in this example, with 21 block producers, at least 15 of their approvals were required), anyone can push the `eosio.msig::exec` action which executes the approved transaction. It makes a lot of sense for the lead block producer who proposed the transaction to also execute it (this will incur another temporary RAM cost for the deferred transaction that is generated by the eosio.msig contract). +```sh +cleos multisig exec blkproducera deploywrap blkproducera ``` -$ cleos multisig exec blkproducera deploywrap blkproducera +```console executed transaction: e8da14c6f1fdc3255b5413adccfd0d89b18f832a4cc18c4324ea2beec6abd483 160 bytes 1877 us # eosio.msig <= eosio.msig::exec {"proposer":"blkproducera","proposal_name":"deploywrap","executer":"blkproducera"} ``` Anyone can now verify that the `eosio.wrap` contract was deployed correctly. +```sh +cleos get code -a retrieved-eosio.wrap.abi eosio.wrap ``` -$ cleos get code -a retrieved-eosio.wrap.abi eosio.wrap +```console code hash: 1b3456a5eca28bcaca7a2a3360fbb2a72b9772a416c8e11a303bcb26bfe3263c saving abi to retrieved-eosio.wrap.abi -$ sha256sum contracts/eosio.wrap/eosio.wrap.wasm +``` +```sh +sha256sum contracts/eosio.wrap/eosio.wrap.wasm +``` +```console 1b3456a5eca28bcaca7a2a3360fbb2a72b9772a416c8e11a303bcb26bfe3263c contracts/eosio.wrap/eosio.wrap.wasm ``` If the two hashes match then the local WebAssembly code is the one deployed on the blockchain. The retrieved ABI, which was stored in the file retrieved-eosio.wrap.abi, can then be compared to the original ABI of the contract (contracts/eosio.wrap/eosio.wrap.abi) to ensure they are semantically the same. -## 3. Using the eosio.wrap contract +# 2. Using the eosio.wrap contract -### 3.1 Example: Updating owner authority of an arbitrary account +## 2.1 Example: Updating owner authority of an arbitrary account This example will demonstrate how to use the deployed eosio.wrap contract together with the eosio.msig contract to allow a greater than two-thirds supermajority of block producers of an EOSIO blockchain to change the owner authority of an arbitrary account. The example will use cleos: in particular, the `cleos multisig` command, the `cleos set account permission` sub-command, and the `cleos wrap exec` sub-command. However, the guide also demonstrates what to do if the `cleos wrap exec` sub-command is not available. This guide assumes that there are 21 active block producers on the chain with account names: `blkproducera`, `blkproducerb`, ..., `blkproduceru`. Block producer `blkproducera` will act as the lead block producer handling the proposal of the transaction. The producer permissions will later come in handy when proposing a transaction that must be approved by a supermajority of the producers. So a file producer_permissions.json containing those permission (see contents below) should be created to be used later in this guide: +```sh +cat producer_permissions.json ``` -$ cat producer_permissions.json +```json [ {"actor": "blkproducera", "permission": "active"}, {"actor": "blkproducerb", "permission": "active"}, @@ -613,12 +672,12 @@ $ cat producer_permissions.json ] ``` -#### 3.1.1 Generate the transaction to change the owner permission of an account +### 2.1.1 Generate the transaction to change the owner permission of an account The goal of this example is for the block producers to change the owner permission of the account `alice`. The initial status of the `alice` account might be: -``` +```console permissions: owner 1: 1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV active 1: 1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV @@ -645,13 +704,15 @@ producers: Assume that none of the block producers know the private key corresponding to the public key `EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV` which, as can be seen above, is initially securing access to the `alice` account. The first step is to generate the transaction changing the owner permission of the `alice` account as if `alice` is authorizing the change: -``` -$ cleos set account permission -s -j -d alice owner '{"threshold": 1, "accounts": [{"permission": {"actor": "eosio", "permission": "active"}, "weight": 1}]}' > update_alice_owner_trx.json +```sh +cleos set account permission -s -j -d alice owner '{"threshold": 1, "accounts": [{"permission": {"actor": "eosio", "permission": "active"}, "weight": 1}]}' > update_alice_owner_trx.json ``` Then modify update_alice_owner_trx.json so that the values for the `ref_block_num` and `ref_block_prefix` fields are both 0 and the value of the `expiration` field is `"1970-01-01T00:00:00"`: +```sh +cat update_alice_owner_trx.json ``` -$ cat update_alice_owner_trx.json +```console { "expiration": "1970-01-01T00:00:00", "ref_block_num": 0, @@ -679,13 +740,15 @@ $ cat update_alice_owner_trx.json The next step is to generate the transaction containing the `eosio.wrap::exec` action. This action will contain the transaction in update_alice_owner_trx.json as part of its action payload data. -``` -$ cleos wrap exec -s -j -d blkproducera update_alice_owner_trx.json > wrap_update_alice_owner_trx.json +```sh +cleos wrap exec -s -j -d blkproducera update_alice_owner_trx.json > wrap_update_alice_owner_trx.json ``` Once again modify wrap_update_alice_owner_trx.json so that the value for the `ref_block_num` and `ref_block_prefix` fields are both 0. However, instead of changing the value of the expiration field to `"1970-01-01T00:00:00"`, it should be changed to a time that is far enough in the future to allow enough time for the proposed transaction to be approved and executed. +```sh +cat wrap_update_alice_owner_trx.json ``` -$ cat wrap_update_alice_owner_trx.json +```json { "expiration": "2018-07-06T12:00:00", "ref_block_num": 0, @@ -717,16 +780,20 @@ $ cat wrap_update_alice_owner_trx.json If the `cleos wrap` command is not available, there is an alternative way to generate the above transaction. There is no need to continue reading the remaining of sub-section 3.1.1 if the wrap_update_alice_owner_trx.json file was already generated with content similar to the above using the `cleos wrap exec` sub-command method. First the hex encoding of the binary serialization of the transaction in update_alice_owner_trx.json must be obtained. One way of obtaining this data is through the following command: +```sh +cleos multisig propose_trx -s -j -d nothing '[]' update_alice_owner_trx.json nothing | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > update_alice_owner_trx_serialized.hex +cat update_alice_owner_trx_serialized.hex ``` -$ cleos multisig propose_trx -s -j -d nothing '[]' update_alice_owner_trx.json nothing | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > update_alice_owner_trx_serialized.hex -$ cat update_alice_owner_trx_serialized.hex +```console 0000000000000000000000000000010000000000ea30550040cbdaa86c52d5010000000000855c3400000000a8ed3232310000000000855c340000000080ab26a700000000000000000100000000010000000000ea305500000000a8ed323201000000 ``` Then generate the template for the transaction containing the `eosio.wrap::exec` action: +```sh +cleos push action -s -j -d eosio.wrap exec '{"executer": "blkproducera", "trx": ""}' > wrap_update_alice_owner_trx.json +cat wrap_update_alice_owner_trx.json ``` -$ cleos push action -s -j -d eosio.wrap exec '{"executer": "blkproducera", "trx": ""}' > wrap_update_alice_owner_trx.json -$ cat wrap_update_alice_owner_trx.json +```json { "expiration": "2018-06-29T23:34:01", "ref_block_num": 23708, @@ -754,22 +821,26 @@ Then modify the transaction in wrap_update_alice_owner_trx.json as follows: * append the hex data from update_alice_owner_trx_serialized.hex to the end of the existing hex data in the `data` field in wrap_update_alice_owner_trx.json. -#### 3.1.2 Propose the transaction to change the owner permission of an account +### 2.1.2 Propose the transaction to change the owner permission of an account The lead block producer (`blkproducera`) should propose the transaction stored in wrap_update_alice_owner_trx.json: +```sh +cleos multisig propose_trx updatealice producer_permissions.json wrap_update_alice_owner_trx.json blkproducera ``` -$ cleos multisig propose_trx updatealice producer_permissions.json wrap_update_alice_owner_trx.json blkproducera +```console executed transaction: 10474f52c9e3fc8e729469a577cd2fc9e4330e25b3fd402fc738ddde26605c13 624 bytes 782 us # eosio.msig <= eosio.msig::propose {"proposer":"blkproducera","proposal_name":"updatealice","requested":[{"actor":"blkproducera","permi... warning: transaction executed locally, but may not be confirmed by the network yet ``` -#### 3.1.3 Review and approve the transaction to change the owner permission of an account +### 2.1.3 Review and approve the transaction to change the owner permission of an account Each of the potential approvers of the proposed transaction (i.e. the active block producers) should first review the proposed transaction to make sure they are not approving anything that they do not agree to. +```sh +cleos multisig review blkproducera updatealice > wrap_update_alice_owner_trx_to_review.json +cat wrap_update_alice_owner_trx_to_review.json ``` -$ cleos multisig review blkproducera updatealice > wrap_update_alice_owner_trx_to_review.json -$ cat wrap_update_alice_owner_trx_to_review.json +```json { "proposal_name": "updatealice", "packed_transaction": "c0593f5b000000000000000000000100004d1a03ea305500000000008054570260ae423ad15b613c00000000a8ed323200004d1a03ea305500000000a8ed32326b60ae423ad15b613c0000000000000000000000000000010000000000ea30550040cbdaa86c52d5010000000000855c3400000000a8ed3232310000000000855c340000000080ab26a700000000000000000100000000010000000000ea305500000000a8ed32320100000000", @@ -829,38 +900,52 @@ The approvers should go through the human-readable transaction output and make s Furthermore, even if this usability issue was fixed in nodeos/cleos, there will still be cases where there is no sensible human-readable version of an action data payload within a transaction. An example of this is the proposed transaction in sub-section 2.2.3 which used the `eosio::setcode` action to set the contract code of the `eosio.wrap` account. The best thing to do in such situations is for the reviewer to compare the proposed transaction to one generated by them through a process they trust. Since each block producer generated a transaction in sub-section 3.1.1 (stored in the file wrap_update_alice_owner_trx.json) which should be identical to the transaction proposed by the lead block producer, they can each simply check to see if the two transactions are identical: +```sh +cleos multisig propose_trx -j -s -d updatealice '[]' wrap_update_alice_owner_trx.json blkproducera | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > expected_wrap_update_alice_owner_trx_serialized.hex +cat expected_wrap_update_alice_owner_trx_serialized.hex ``` -$ cleos multisig propose_trx -j -s -d updatealice '[]' wrap_update_alice_owner_trx.json blkproducera | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > expected_wrap_update_alice_owner_trx_serialized.hex -$ cat expected_wrap_update_alice_owner_trx_serialized.hex +```console c0593f5b000000000000000000000100004d1a03ea305500000000008054570260ae423ad15b613c00000000a8ed323200004d1a03ea305500000000a8ed32326b60ae423ad15b613c0000000000000000000000000000010000000000ea30550040cbdaa86c52d5010000000000855c3400000000a8ed3232310000000000855c340000000080ab26a700000000000000000100000000010000000000ea305500000000a8ed32320100000000 -$ cat wrap_update_alice_owner_trx_to_review.json | grep '"packed_transaction":' | sed 's/^[ \t]*"packed_transaction":[ \t]*//;s/[",]//g' > proposed_wrap_update_alice_owner_trx_serialized.hex -$ cat proposed_wrap_update_alice_owner_trx_serialized.hex +``` +```sh +cat wrap_update_alice_owner_trx_to_review.json | grep '"packed_transaction":' | sed 's/^[ \t]*"packed_transaction":[ \t]*//;s/[",]//g' > proposed_wrap_update_alice_owner_trx_serialized.hex +cat proposed_wrap_update_alice_owner_trx_serialized.hex +``` +```console c0593f5b000000000000000000000100004d1a03ea305500000000008054570260ae423ad15b613c00000000a8ed323200004d1a03ea305500000000a8ed32326b60ae423ad15b613c0000000000000000000000000000010000000000ea30550040cbdaa86c52d5010000000000855c3400000000a8ed3232310000000000855c340000000080ab26a700000000000000000100000000010000000000ea305500000000a8ed32320100000000 -$ diff expected_wrap_update_alice_owner_trx_serialized.hex proposed_wrap_update_alice_owner_trx_serialized.hex +``` +```sh +diff expected_wrap_update_alice_owner_trx_serialized.hex proposed_wrap_update_alice_owner_trx_serialized.hex ``` When an approver (e.g. `blkproducerb`) is satisfied with the proposed transaction, they can simply approve it: +```sh +cleos multisig approve blkproducera updatealice '{"actor": "blkproducerb", "permission": "active"}' -p blkproducerb ``` -$ cleos multisig approve blkproducera updatealice '{"actor": "blkproducerb", "permission": "active"}' -p blkproducerb +```console executed transaction: 2bddc7747e0660ba26babf95035225895b134bfb2ede32ba0a2bb6091c7dab56 128 bytes 543 us # eosio.msig <= eosio.msig::approve {"proposer":"blkproducera","proposal_name":"updatealice","level":{"actor":"blkproducerb","permission... warning: transaction executed locally, but may not be confirmed by the network yet ``` -#### 3.1.4 Execute the transaction to change the owner permission of an account +### 2.1.4 Execute the transaction to change the owner permission of an account When the necessary approvals are collected (in this example, with 21 block producers, at least 15 of their approvals were required), anyone can push the `eosio.msig::exec` action which executes the approved transaction. It makes a lot of sense for the lead block producer who proposed the transaction to also execute it (this will incur another temporary RAM cost for the deferred transaction that is generated by the eosio.msig contract). +```sh +cleos multisig exec blkproducera updatealice blkproducera ``` -$ cleos multisig exec blkproducera updatealice blkproducera +```console executed transaction: 7127a66ae307fbef6415bf60c3e91a88b79bcb46030da983c683deb2a1a8e0d0 160 bytes 820 us # eosio.msig <= eosio.msig::exec {"proposer":"blkproducera","proposal_name":"updatealice","executer":"blkproducera"} warning: transaction executed locally, but may not be confirmed by the network yet ``` Anyone can now verify that the owner authority of `alice` was successfully changed: +```sh +cleos get account alice ``` -$ cleos get account alice +```console permissions: owner 1: 1 eosio@active, active 1: 1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV @@ -883,4 +968,4 @@ cpu bandwidth: producers: -``` +``` \ No newline at end of file diff --git a/docs/04_guides/08_configure-use-powerup-resource-model.md b/docs/04_guides/08_configure-use-powerup-resource-model.md new file mode 100644 index 000000000..35a6c9339 --- /dev/null +++ b/docs/04_guides/08_configure-use-powerup-resource-model.md @@ -0,0 +1,271 @@ +--- +content_title: How to configure PowerUp resource model +link_text: How to configure PowerUp resource model +--- +# Configure and Use the PowerUp Resource Model + +## Overview +This new system will create a new optional NET and CPU marketplace which displaces (over time) +the existing staking system and REX market. Under the old model, system token holders +own NET and CPU and may choose to use it themselves, delegate it to others, or make +it available for others to rent using the REX market. Under this new model, the chain +owns almost all NET and CPU resources and the only way to access these resources is +through the new `powerup` action. It channels fees to the REX pool to enable token holders +to profit off the new market. + +## Configuration + +### Definitions + +#### Configuration +```c++ +// configure the `powerup` market. The market becomes available the first time this action is invoked +void cfgpowerup( powerup_config& args ); + +struct powerup_config_resource { + std::optional current_weight_ratio; // Immediately set weight_ratio to this amount. 1x = 10^15. 0.01x = 10^13. + // Do not specify to preserve the existing setting or use the default; + // this avoids sudden price jumps. For new chains which don't need + // to gradually phase out staking and REX, 0.01x (10^13) is a good + // value for both current_weight_ratio and target_weight_ratio. + std::optional target_weight_ratio; // Linearly shrink weight_ratio to this amount. 1x = 10^15. 0.01x = 10^13. + // Do not specify to preserve the existing setting or use the default. + std::optional assumed_stake_weight; // Assumed stake weight for ratio calculations. Use the sum of total + // staked and total rented by REX at the time the power market + // is first activated. Do not specify to preserve the existing + // setting (no default exists); this avoids sudden price jumps. + // For new chains which don't need to phase out staking and REX, + // 10^12 is probably a good value. + std::optional target_timestamp; // Stop automatic weight_ratio shrinkage at this time. Once this + // time hits, weight_ratio will be target_weight_ratio. Ignored + // if current_weight_ratio == target_weight_ratio. Do not specify + // this to preserve the existing setting (no default exists). + std::optional exponent; // Exponent of resource price curve. Must be >= 1. Do not specify + // to preserve the existing setting or use the default. + std::optional decay_secs; // Number of seconds for the gap between adjusted resource + // utilization and instantaneous resource utilization to shrink + // by 63%. Do not specify to preserve the existing setting or + // use the default. + std::optional min_price; // Fee needed to reserve the entire resource market weight at the + // minimum price. For example, this could be set to 0.005% of + // total token supply. Do not specify to preserve the existing + // setting or use the default. + std::optional max_price; // Fee needed to reserve the entire resource market weight at the + // maximum price. For example, this could be set to 10% of total + // token supply. Do not specify to preserve the existing + // setting (no default exists). + + }; + +struct powerup_config { + powerup_config_resource net; // NET market configuration + powerup_config_resource cpu; // CPU market configuration + std::optional powerup_days; // `powerup` `days` argument must match this. Do not specify to preserve the + // existing setting or use the default. + std::optional min_powerup_fee; // Powerup fees below this amount are rejected. Do not specify to preserve the + // existing setting (no default exists). +}; +``` +#### State + +Definitions useful to help understand the configuration, including defaults: +```c++ +inline constexpr int64_t powerup_frac = 1'000'000'000'000'000ll; // 1.0 = 10^15 + +struct powerup_state_resource { + static constexpr double default_exponent = 2.0; // Exponent of 2.0 means that the price to reserve a + // tiny amount of resources increases linearly + // with utilization. + static constexpr uint32_t default_decay_secs = 1 * seconds_per_day; // 1 day; if 100% of bandwidth resources are in a + // single loan, then, assuming no further powerup usage, + // 1 day after it expires the adjusted utilization + // will be at approximately 37% and after 3 days + // the adjusted utilization will be less than 5%. + + uint8_t version = 0; + int64_t weight = 0; // resource market weight. calculated; varies over time. + // 1 represents the same amount of resources as 1 + // satoshi of SYS staked. + int64_t weight_ratio = 0; // resource market weight ratio: + // assumed_stake_weight / (assumed_stake_weight + weight). + // calculated; varies over time. 1x = 10^15. 0.01x = 10^13. + int64_t assumed_stake_weight = 0; // Assumed stake weight for ratio calculations. + int64_t initial_weight_ratio = powerup_frac; // Initial weight_ratio used for linear shrinkage. + int64_t target_weight_ratio = powerup_frac / 100; // Linearly shrink the weight_ratio to this amount. + time_point_sec initial_timestamp = {}; // When weight_ratio shrinkage started + time_point_sec target_timestamp = {}; // Stop automatic weight_ratio shrinkage at this time. Once this + // time hits, weight_ratio will be target_weight_ratio. + double exponent = default_exponent; // Exponent of resource price curve. + uint32_t decay_secs = default_decay_secs; // Number of seconds for the gap between adjusted resource + // utilization and instantaneous utilization to shrink by 63%. + asset min_price = {}; // Fee needed to reserve the entire resource market weight at + // the minimum price (defaults to 0). + asset max_price = {}; // Fee needed to reserve the entire resource market weight at + // the maximum price. + int64_t utilization = 0; // Instantaneous resource utilization. This is the current + // amount sold. utilization <= weight. + int64_t adjusted_utilization = 0; // Adjusted resource utilization. This is >= utilization and + // <= weight. It grows instantly but decays exponentially. + time_point_sec utilization_timestamp = {}; // When adjusted_utilization was last updated +}; + +struct powerup_state { + static constexpr uint32_t default_powerup_days = 30; // 30 day resource powerups + + uint8_t version = 0; + powerup_state_resource net = {}; // NET market state + powerup_state_resource cpu = {}; // CPU market state + uint32_t powerup_days = default_powerup_days; // `powerup` `days` argument must match this. + asset min_powerup_fee = {}; // fees below this amount are rejected + + uint64_t primary_key()const { return 0; } +}; +``` + +### Preparation for Upgrade +1. Build [eosio.contracts](https://github.com/EOSIO/eosio.contracts) with `powerup` code. Version **1.9.x** or greater . +2. Deploy eosio.system contract to `eosio`. +3. Create account `eosio.reserv` and ensure the account has enough RAM, at least 4 KiB. +4. Deploy `powup.results.abi` to `eosio.reserv` account using `setabi`. The ABI can be found in the `build/contracts/eosio.system/.powerup/` directory. +5. Enable the REX system (if not enabled). + +### Configuring PowerUp + +#### Config file +```json +# config.json +{ + "net": { + "assumed_stake_weight": 944076307, + "current_weight_ratio": 1000000000000000, + "decay_secs": 86400, + "exponent": 2, + "max_price": "10000000.0000 TST", + "min_price": "0.0000 TST", + "target_timestamp": "2022-01-01T00:00:00.000", + "target_weight_ratio": 10000000000000 + }, + "cpu": { + "assumed_stake_weight": 3776305228, + "current_weight_ratio": 1000000000000000, + "decay_secs": 86400, + "exponent": 2, + "max_price": "10000000.0000 TST", + "min_price": "0.0000 TST", + "target_timestamp": "2022-01-01T00:00:00.000", + "target_weight_ratio": 10000000000000 + }, + "min_powerup_fee": "0.0001 TST", + "powerup_days": 1 +} +``` + +#### cfgpowerup Action Call +```sh +# call to `cfgpowerup` +cleos push action eosio cfgpowerup "[`cat ./config.json`]" -p eosio +``` + +#### Check state +```sh +cleos get table eosio 0 powup.state +``` +```json +{ + "rows": [{ + "version": 0, + "net": { + "version": 0, + "weight": 0, + "weight_ratio": "1000000000000000", + "assumed_stake_weight": 944076307, + "initial_weight_ratio": "1000000000000000", + "target_weight_ratio": "10000000000000", + "initial_timestamp": "2020-11-16T19:52:50", + "target_timestamp": "2022-01-01T00:00:00", + "exponent": "2.00000000000000000", + "decay_secs": 3600, + "min_price": "0.0000 TST", + "max_price": "10000000.0000 TST", + "utilization": 0, + "adjusted_utilization": 0, + "utilization_timestamp": "2020-11-16T19:52:50" + }, + "cpu": { + "version": 0, + "weight": 0, + "weight_ratio": "1000000000000000", + "assumed_stake_weight": 3776305228, + "initial_weight_ratio": "1000000000000000", + "target_weight_ratio": "10000000000000", + "initial_timestamp": "2020-11-16T19:52:50", + "target_timestamp": "2022-01-01T00:00:00", + "exponent": "2.00000000000000000", + "decay_secs": 3600, + "min_price": "0.0000 TST", + "max_price": "10000000.0000 TST", + "utilization": 0, + "adjusted_utilization": 0, + "utilization_timestamp": "2020-11-16T19:52:50" + }, + "powerup_days": 1, + "min_powerup_fee": "0.0001 TST" + } + ], + "more": false, + "next_key": "" +} +``` + +### Using PowerUp + +#### Executing an order +The action to power up an account is `powerup`. It takes a `payer` of the fee and a `receiver` of the resources. The `days` must always match `state.powerup_days`. `net_frac` and `cpu_frac` are the percentage of the resources that you need. The easiest way to caclulate the percentage is to multiple 10^15 (100%) by the desired percentage. For example: 10^15 * 0.01 = 10^13. +```sh +cleos push action eosio powerup '[user, user, 1, 10000000000000, 10000000000000, "1000.0000 TST"]' -p user +``` +``` +executed transaction: 82b7124601612b371b812e3bf65cf63bb44616802d3cd33a2c0422b58399f54f 144 bytes 521 us +# eosio <= eosio::powerup {"payer":"user","receiver":"user","days":1,"net_frac":"10000000000000","cpu_frac":"10000000000000","... +# eosio.token <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 TST","memo":"transfer from user to eosio.rex"} +# eosio.reserv <= eosio.reserv::powupresult {"fee":"999.9901 TST","powup_net_weight":"16354","powup_cpu_weight":"65416"} +# user <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 TST","memo":"transfer from user to eosio.rex"} +# eosio.rex <= eosio.token::transfer {"from":"user","to":"eosio.rex","quantity":"999.9901 TST","memo":"transfer from user to eosio.rex"} +``` +You can see how much NET and CPU weight was received as well as the fee by looking at the `eosio.reserv::powupresult` informational action. + +*It is worth mentioning that the network being used for the example has not fully transitioned so the available resources are minimal therefore 1% of the resources are quite expensive. As the system continues the transition more resources are available to the `PowerUp` resource model and will become more affordable.* + +#### Processing Expired Orders +The resources in loans that expire do not automatically get reclaimed by the system. The expired loans sit in a queue that must be processed. Anyone calling the `powerup` action will help with processing this queue (limited to processing at most two expired loans at a time) so that normally the expired loans will be automatically processed in a timely manner. However, in some cases it may be necessary to manual process expired loans in the queue to make resources available to the system again and thus make prices cheaper. In such a scenario, any account may process up to an arbitrary number of expired loans by calling the `powerupexec` action. + +The orders table `powup.order` can be viewed by calling: +```sh +cleos get table eosio 0 powup.order +``` +```json +{ + "rows": [{ + "version": 0, + "id": 0, + "owner": "user", + "net_weight": 16354, + "cpu_weight": 65416, + "expires": "2020-11-18T13:04:33" + } + ], + "more": false, + "next_key": "" +} +``` + +Example `powerupexec` call: + +```sh +cleos push action eosio powerupexec '[user, 2]' -p user +``` +```console +executed transaction: 93ab4ac900a7902e4e59e5e925e8b54622715328965150db10774aa09855dc98 104 bytes 363 us +# eosio <= eosio::powerupexec {"user":"user","max":2} +warning: transaction executed locally, but may not be confirmed by the network yet ] +``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..37759d127 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,27 @@ +--- +content_title: About System Contracts +--- + +The EOSIO blockchain platform is unique in that the features and characteristics of the blockchain built on it are flexible, that is, they can be changed, or modified completely to suit each business case requirement. Core blockchain features such as consensus, fee schedules, account creation and modification, token economics, block producer registration, voting, multi-sig, etc., are implemented inside smart contracts which are deployed on the blockchain built on the EOSIO platform. + +## System contracts defined in eosio.contracts + +Block.one implements and maintains EOSIO open source platform which contains, as an example, the system contracts encapsulating the base functionality for an EOSIO based blockchain. + +1. [eosio.bios](action-reference/eosio.bios) +2. [eosio.system](action-reference/eosio.system) +3. [eosio.msig](action-reference/eosio.msig) +4. [eosio.token](action-reference/eosio.token) +5. [eosio.wrap](action-reference/eosio.wrap) + +## Key Concepts Implemented by eosio.system + +1. [System](01_key-concepts/01_system.md) +2. [RAM](01_key-concepts/02_ram.md) +3. [CPU](01_key-concepts/03_cpu.md) +4. [NET](01_key-concepts/04_net.md) +5. [Stake](01_key-concepts/05_stake.md) +6. [Vote](01_key-concepts/06_vote.md) + +## Build and deploy +To build and deploy the system contract follow the instruction from [Build and deploy](03_build-and-deploy.md) section. \ No newline at end of file diff --git a/eosio.bios/CMakeLists.txt b/eosio.bios/CMakeLists.txt deleted file mode 100644 index d4ed66f8b..000000000 --- a/eosio.bios/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_contract(eosio.bios eosio.bios ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.bios.cpp) -target_include_directories(eosio.bios.wasm - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include) - -set_target_properties(eosio.bios.wasm - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/eosio.bios/include/eosio.bios/eosio.bios.hpp b/eosio.bios/include/eosio.bios/eosio.bios.hpp deleted file mode 100644 index 06c24a012..000000000 --- a/eosio.bios/include/eosio.bios/eosio.bios.hpp +++ /dev/null @@ -1,170 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace eosio { - using eosio::permission_level; - using eosio::public_key; - using eosio::ignore; - - struct permission_level_weight { - permission_level permission; - uint16_t weight; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( permission_level_weight, (permission)(weight) ) - }; - - struct key_weight { - eosio::public_key key; - uint16_t weight; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( key_weight, (key)(weight) ) - }; - - struct wait_weight { - uint32_t wait_sec; - uint16_t weight; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( wait_weight, (wait_sec)(weight) ) - }; - - struct authority { - uint32_t threshold = 0; - std::vector keys; - std::vector accounts; - std::vector waits; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( authority, (threshold)(keys)(accounts)(waits) ) - }; - - struct block_header { - uint32_t timestamp; - name producer; - uint16_t confirmed = 0; - capi_checksum256 previous; - capi_checksum256 transaction_mroot; - capi_checksum256 action_mroot; - uint32_t schedule_version = 0; - std::optional new_producers; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE(block_header, (timestamp)(producer)(confirmed)(previous)(transaction_mroot)(action_mroot) - (schedule_version)(new_producers)) - }; - - class [[eosio::contract("eosio.bios")]] bios : public contract { - public: - using contract::contract; - [[eosio::action]] - void newaccount( name creator, - name name, - ignore owner, - ignore active){} - - - [[eosio::action]] - void updateauth( ignore account, - ignore permission, - ignore parent, - ignore auth ) {} - - [[eosio::action]] - void deleteauth( ignore account, - ignore permission ) {} - - [[eosio::action]] - void linkauth( ignore account, - ignore code, - ignore type, - ignore requirement ) {} - - [[eosio::action]] - void unlinkauth( ignore account, - ignore code, - ignore type ) {} - - [[eosio::action]] - void canceldelay( ignore canceling_auth, ignore trx_id ) {} - - [[eosio::action]] - void onerror( ignore sender_id, ignore> sent_trx ) {} - - [[eosio::action]] - void setcode( name account, uint8_t vmtype, uint8_t vmversion, const std::vector& code ) {} - - [[eosio::action]] - void setpriv( name account, uint8_t is_priv ) { - require_auth( _self ); - set_privileged( account.value, is_priv ); - } - - [[eosio::action]] - void setalimits( name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight ) { - require_auth( _self ); - set_resource_limits( account.value, ram_bytes, net_weight, cpu_weight ); - } - - [[eosio::action]] - void setglimits( uint64_t ram, uint64_t net, uint64_t cpu ) { - (void)ram; (void)net; (void)cpu; - require_auth( _self ); - } - - [[eosio::action]] - void setprods( std::vector schedule ) { - (void)schedule; // schedule argument just forces the deserialization of the action data into vector (necessary check) - require_auth( _self ); - - constexpr size_t max_stack_buffer_size = 512; - size_t size = action_data_size(); - char* buffer = (char*)( max_stack_buffer_size < size ? malloc(size) : alloca(size) ); - read_action_data( buffer, size ); - set_proposed_producers(buffer, size); - } - - [[eosio::action]] - void setparams( const eosio::blockchain_parameters& params ) { - require_auth( _self ); - set_blockchain_parameters( params ); - } - - [[eosio::action]] - void reqauth( name from ) { - require_auth( from ); - } - - [[eosio::action]] - void setabi( name account, const std::vector& abi ) { - abi_hash_table table(_self, _self.value); - auto itr = table.find( account.value ); - if( itr == table.end() ) { - table.emplace( account, [&]( auto& row ) { - row.owner = account; - sha256( const_cast(abi.data()), abi.size(), &row.hash ); - }); - } else { - table.modify( itr, same_payer, [&]( auto& row ) { - sha256( const_cast(abi.data()), abi.size(), &row.hash ); - }); - } - } - - struct [[eosio::table]] abi_hash { - name owner; - capi_checksum256 hash; - uint64_t primary_key()const { return owner.value; } - - EOSLIB_SERIALIZE( abi_hash, (owner)(hash) ) - }; - - typedef eosio::multi_index< "abihash"_n, abi_hash > abi_hash_table; - }; - -} /// namespace eosio diff --git a/eosio.bios/src/eosio.bios.cpp b/eosio.bios/src/eosio.bios.cpp deleted file mode 100644 index 01e85c02d..000000000 --- a/eosio.bios/src/eosio.bios.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include - -EOSIO_DISPATCH( eosio::bios, (setpriv)(setalimits)(setglimits)(setprods)(setparams)(reqauth)(setabi) ) diff --git a/eosio.msig/CMakeLists.txt b/eosio.msig/CMakeLists.txt deleted file mode 100644 index 84614e87e..000000000 --- a/eosio.msig/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_contract(eosio.msig eosio.msig ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.msig.cpp) -target_include_directories(eosio.msig.wasm - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include) - -set_target_properties(eosio.msig.wasm - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/eosio.msig/README.md b/eosio.msig/README.md deleted file mode 100644 index 1d7279139..000000000 --- a/eosio.msig/README.md +++ /dev/null @@ -1,113 +0,0 @@ -eosio.msig --------- - -Actions: -The naming convention is codeaccount::actionname followed by a list of paramters. - -Create a proposal -## eosio.msig::propose proposer proposal_name requested trx - - **proposer** account proposing a transaction - - **proposal_name** name of the proposal (should be unique for proposer) - - **requested** permission levels expected to approve the proposal - - **trx** proposed transaction - - Storage changes are billed to 'proposer' - -Approve a proposal -## eosio.msig::approve proposer proposal_name level - - **proposer** account proposing a transaction - - **proposal_name** name of the proposal - - **level** permission level approving the transaction - - Storage changes are billed to 'proposer' - -Revoke an approval of transaction -## eosio.msig::unapprove proposer proposal_name level - - **proposer** account proposing a transaction - - **proposal_name** name of the proposal - - **level** permission level revoking approval from the transaction - - Storage changes are billed to 'proposer' - -Cancel a proposal -## eosio.msig::cancel proposer proposal_name canceler - - **proposer** account proposing a transaction - - **proposal_name** name of the proposal - - **canceler** account canceling the transaction (only proposer can cancel not expired transaction) - -Execute a proposal -## eosio.msig::exec proposer proposal_name executer - - **proposer** account proposing a transaction - - **proposal_name** name of the proposal - - **executer** account executing the transaction - - -Cleos usage example. - -Prerequisites: - - eosio.token contract installed to eosio.token accountm, eosio.msig contract installed on eosio.msig account which is a priviliged account. - - account 'treasury' is the issuer of EOS token. - - account 'tester' exists. - - keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked. - -One user creates a proposal: -```` -$ cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token issue '{"to": "tester", "quantity": "1000.0000 EOS", "memo": ""}' -p tester -executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles -# eosio.msig <= eosio.msig::propose {"proposer":"tester","proposal_name":"test","requested":[{"actor":"treasury","permission":"active"}]... -```` - -Another user reviews the transaction: -```` -$ cleos multisig review tester test -p treasury -{ - "proposal_name": "test", - "requested_approvals": [{ - "actor": "treasury", - "permission": "active" - } - ], - "provided_approvals": [], - "packed_transaction": "00aee75a0000000000000000000000000100a6823403ea30550000000000a5317601000000fe6a6cd4cd00000000a8ed323219000000005c95b1ca809698000000000004454f530000000000", - "transaction": { - "expiration": "2018-05-01T00:00:00", - "region": 0, - "ref_block_num": 0, - "ref_block_prefix": 0, - "max_net_usage_words": 0, - "max_kcpu_usage": 0, - "delay_sec": 0, - "context_free_actions": [], - "actions": [{ - "account": "eosio.token", - "name": "issue", - "authorization": [{ - "actor": "treasury", - "permission": "active" - } - ], - "data": { - "to": "tester", - "quantity": "1000.0000 EOS", - "memo": "" - }, - "hex_data": "000000005c95b1ca809698000000000004454f530000000000" - } - ] - } -} -```` - -And then approves it: -```` -$ cleos multisig approve tester test '{"actor": "treasury", "permission": "active"}' -p treasury -executed transaction: 475970a4b0016368d0503d1ce01577376f91f5a5ba63dd4353683bd95101b88d 256 bytes 108544 cycles -# eosio.msig <= eosio.msig::approve {"proposer":"tester","proposal_name":"test","level":{"actor":"treasury","permission":"active"}} -```` - -First user initiates execution: -```` -$ cleos multisig exec tester test -p tester -executed transaction: 64e5eaceb77362694055f572ae35876111e87b637a55250de315b1b55e56d6c2 248 bytes 109568 cycles -# eosio.msig <= eosio.msig::exec {"proposer":"tester","proposal_name":"test","executer":"tester"} -```` diff --git a/eosio.msig/include/eosio.msig/eosio.msig.hpp b/eosio.msig/include/eosio.msig/eosio.msig.hpp deleted file mode 100644 index a8c506e78..000000000 --- a/eosio.msig/include/eosio.msig/eosio.msig.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once -#include -#include -#include - -namespace eosio { - - class [[eosio::contract("eosio.msig")]] multisig : public contract { - public: - using contract::contract; - - [[eosio::action]] - void propose(ignore proposer, ignore proposal_name, - ignore> requested, ignore trx); - [[eosio::action]] - void approve( name proposer, name proposal_name, permission_level level, - const eosio::binary_extension& proposal_hash ); - [[eosio::action]] - void unapprove( name proposer, name proposal_name, permission_level level ); - [[eosio::action]] - void cancel( name proposer, name proposal_name, name canceler ); - [[eosio::action]] - void exec( name proposer, name proposal_name, name executer ); - [[eosio::action]] - void invalidate( name account ); - - private: - struct [[eosio::table]] proposal { - name proposal_name; - std::vector packed_transaction; - - uint64_t primary_key()const { return proposal_name.value; } - }; - - typedef eosio::multi_index< "proposal"_n, proposal > proposals; - - struct [[eosio::table]] old_approvals_info { - name proposal_name; - std::vector requested_approvals; - std::vector provided_approvals; - - uint64_t primary_key()const { return proposal_name.value; } - }; - typedef eosio::multi_index< "approvals"_n, old_approvals_info > old_approvals; - - struct approval { - permission_level level; - time_point time; - }; - - struct [[eosio::table]] approvals_info { - uint8_t version = 1; - name proposal_name; - //requested approval doesn't need to cointain time, but we want requested approval - //to be of exact the same size ad provided approval, in this case approve/unapprove - //doesn't change serialized data size. So, we use the same type. - std::vector requested_approvals; - std::vector provided_approvals; - - uint64_t primary_key()const { return proposal_name.value; } - }; - typedef eosio::multi_index< "approvals2"_n, approvals_info > approvals; - - struct [[eosio::table]] invalidation { - name account; - time_point last_invalidation_time; - - uint64_t primary_key() const { return account.value; } - }; - - typedef eosio::multi_index< "invals"_n, invalidation > invalidations; - }; - -} /// namespace eosio diff --git a/eosio.system/CMakeLists.txt b/eosio.system/CMakeLists.txt deleted file mode 100644 index 66a9e312c..000000000 --- a/eosio.system/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_contract(eosio.system eosio.system ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.system.cpp) -#add_executable(eosio.system.wasm ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.system.cpp) -target_include_directories(eosio.system.wasm - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/../eosio.token/include) - -set_target_properties(eosio.system.wasm - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/eosio.system/README.md b/eosio.system/README.md deleted file mode 100644 index 9e5c31600..000000000 --- a/eosio.system/README.md +++ /dev/null @@ -1,84 +0,0 @@ -eosio.system ----------- - -This contract enables users to stake tokens, and then configure and vote on producers and worker proposals. - -Users can also proxy their voting influence to other users. - -The state of this contract is read to determine the 21 active block producers. - -Actions: -The naming convention is codeaccount::actionname followed by a list of paramters. - -Indicates that a particular account wishes to become a producer -## eosio.system::cfgproducer account config - - **account** the producer account to update - - updates the configuration settings for a particular producer, these - - Storage changes are billed to 'account' - -## eosio.system::okproducer account producer vote - - **account** the account which is doing the voting - - **producer** the producer which is being voted for (or unvoted for) - - **vote** true if the producer should be voted for, false if not - - Each account has a maximum number of votes it can maintain. Storage changes will be billed to 'account' - -## eosio.system::setproxy account proxy - - **account** the account which is updating it's proxy - - **proxy** the account which will have the power to vote account's stake - - All current votes are removed and a new proxy link is created. The votes for every producer the proxy - has voted for are updated immediately. - - Storage changes will be billed to 'account' - -## eosio.system::unstake account quantity - - **account** - the account which is requesting their balance be unstaked - - **quantity** - the quantity which will be unstaked, unstaked tokens lose voting influence immediately - - - in order to unstake tokens, an account must request them. The user will receive them over - time via weekly withdraws. The length of time will be configured by the median time as set by - the active producers. - - - If this is called while in the process of unstaking, the currently pending unstake is canceled as if - quantity were 0, then it is applied as if a new unstake request was made. - - - all producers this 'from' has voted for will have their votes updated immediately. - - - bandwidth and storage for the deferred transaction will be billed to 'from' - -## eosio.system::withdraw account - - this action can only be triggered by eosio.system via a deferred transaction generated by unstake - - this will generate an inline eosio.token::transfer call from=eosio.system to=account and amount equal to the next withdraw increment - - this will generate another deferred withdraw to continue the process if there are still withdraws to be made - - -## eosio.system::transfer from to amount memo - - decrements balance of from if amount <= balance - - increments balance of to by amount - - memo is ignored - -## eosio.system::stakevote account amount - - the primary currency of eosio is controlled by the token contract which enables users to transfer - balances from one user to another. The receiver is notified on incoming balances and the vote contract - will stake the tokens on receipt. - - - all producers this 'from' has voted for will have their votes updated immediately. - - -## eosio.system::onblock account blocktime blocknum - - this special action is triggered when a block is applied by the given producer and cannot be generated from - any other source. It is used to pay producers and calculate missed blocks of other producers. - - - producer pay is deposited into the producer's stake balance and can be withdrawn over time. - - - if blocknum is the start of a new round this may update the active producer config from the producer votes. - -## eosio.system::freeze producer accounts true|false - - requires permission of the @producers account - - if an account is frozen, all authorizations of that account are rejected and the code for that account will not be run - -## eosio.system::paystandby producer - - every block some amount of tokens is paid - - at most once per day a producer may claim a percentage of the standby pay equal to their totalvotes / allvotes diff --git a/eosio.system/include/eosio.system/eosio.system.hpp b/eosio.system/include/eosio.system/eosio.system.hpp deleted file mode 100644 index 32ccdce76..000000000 --- a/eosio.system/include/eosio.system/eosio.system.hpp +++ /dev/null @@ -1,356 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ -#pragma once - -#include -#include -#include -#include -#include -#include - -#include - -namespace eosiosystem { - - using eosio::name; - using eosio::asset; - using eosio::symbol; - using eosio::symbol_code; - using eosio::indexed_by; - using eosio::const_mem_fun; - using eosio::block_timestamp; - using eosio::time_point; - using eosio::microseconds; - using eosio::datastream; - - struct [[eosio::table, eosio::contract("eosio.system")]] name_bid { - name newname; - name high_bidder; - int64_t high_bid = 0; ///< negative high_bid == closed auction waiting to be claimed - time_point last_bid_time; - - uint64_t primary_key()const { return newname.value; } - uint64_t by_high_bid()const { return static_cast(-high_bid); } - }; - - struct [[eosio::table, eosio::contract("eosio.system")]] bid_refund { - name bidder; - asset amount; - - uint64_t primary_key()const { return bidder.value; } - }; - - typedef eosio::multi_index< "namebids"_n, name_bid, - indexed_by<"highbid"_n, const_mem_fun > - > name_bid_table; - - typedef eosio::multi_index< "bidrefunds"_n, bid_refund > bid_refund_table; - - struct [[eosio::table("global"), eosio::contract("eosio.system")]] eosio_global_state : eosio::blockchain_parameters { - uint64_t free_ram()const { return max_ram_size - total_ram_bytes_reserved; } - - uint64_t max_ram_size = 64ll*1024 * 1024 * 1024; - uint64_t total_ram_bytes_reserved = 0; - int64_t total_ram_stake = 0; - - block_timestamp last_producer_schedule_update; - time_point last_pervote_bucket_fill; - int64_t pervote_bucket = 0; - int64_t perblock_bucket = 0; - uint32_t total_unpaid_blocks = 0; /// all blocks which have been produced but not paid - int64_t total_activated_stake = 0; - time_point thresh_activated_stake_time; - uint16_t last_producer_schedule_size = 0; - double total_producer_vote_weight = 0; /// the sum of all producer votes - block_timestamp last_name_close; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE_DERIVED( eosio_global_state, eosio::blockchain_parameters, - (max_ram_size)(total_ram_bytes_reserved)(total_ram_stake) - (last_producer_schedule_update)(last_pervote_bucket_fill) - (pervote_bucket)(perblock_bucket)(total_unpaid_blocks)(total_activated_stake)(thresh_activated_stake_time) - (last_producer_schedule_size)(total_producer_vote_weight)(last_name_close) ) - }; - - /** - * Defines new global state parameters added after version 1.0 - */ - struct [[eosio::table("global2"), eosio::contract("eosio.system")]] eosio_global_state2 { - eosio_global_state2(){} - - uint16_t new_ram_per_block = 0; - block_timestamp last_ram_increase; - block_timestamp last_block_num; /* deprecated */ - double total_producer_votepay_share = 0; - uint8_t revision = 0; ///< used to track version updates in the future. - - EOSLIB_SERIALIZE( eosio_global_state2, (new_ram_per_block)(last_ram_increase)(last_block_num) - (total_producer_votepay_share)(revision) ) - }; - - struct [[eosio::table("global3"), eosio::contract("eosio.system")]] eosio_global_state3 { - eosio_global_state3() { } - time_point last_vpay_state_update; - double total_vpay_share_change_rate = 0; - - EOSLIB_SERIALIZE( eosio_global_state3, (last_vpay_state_update)(total_vpay_share_change_rate) ) - }; - - struct [[eosio::table, eosio::contract("eosio.system")]] producer_info { - name owner; - double total_votes = 0; - eosio::public_key producer_key; /// a packed public key object - bool is_active = true; - std::string url; - uint32_t unpaid_blocks = 0; - time_point last_claim_time; - uint16_t location = 0; - - uint64_t primary_key()const { return owner.value; } - double by_votes()const { return is_active ? -total_votes : total_votes; } - bool active()const { return is_active; } - void deactivate() { producer_key = public_key(); is_active = false; } - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( producer_info, (owner)(total_votes)(producer_key)(is_active)(url) - (unpaid_blocks)(last_claim_time)(location) ) - }; - - struct [[eosio::table, eosio::contract("eosio.system")]] producer_info2 { - name owner; - double votepay_share = 0; - time_point last_votepay_share_update; - - uint64_t primary_key()const { return owner.value; } - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( producer_info2, (owner)(votepay_share)(last_votepay_share_update) ) - }; - - struct [[eosio::table, eosio::contract("eosio.system")]] voter_info { - name owner; /// the voter - name proxy; /// the proxy set by the voter, if any - std::vector producers; /// the producers approved by this voter if no proxy set - int64_t staked = 0; - - /** - * Every time a vote is cast we must first "undo" the last vote weight, before casting the - * new vote weight. Vote weight is calculated as: - * - * stated.amount * 2 ^ ( weeks_since_launch/weeks_per_year) - */ - double last_vote_weight = 0; /// the vote weight cast the last time the vote was updated - - /** - * Total vote weight delegated to this voter. - */ - double proxied_vote_weight= 0; /// the total vote weight delegated to this voter as a proxy - bool is_proxy = 0; /// whether the voter is a proxy for others - - - uint32_t reserved1 = 0; - uint32_t reserved2 = 0; - eosio::asset reserved3; - - uint64_t primary_key()const { return owner.value; } - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( voter_info, (owner)(proxy)(producers)(staked)(last_vote_weight)(proxied_vote_weight)(is_proxy)(reserved1)(reserved2)(reserved3) ) - }; - - typedef eosio::multi_index< "voters"_n, voter_info > voters_table; - - - typedef eosio::multi_index< "producers"_n, producer_info, - indexed_by<"prototalvote"_n, const_mem_fun > - > producers_table; - typedef eosio::multi_index< "producers2"_n, producer_info2 > producers_table2; - - typedef eosio::singleton< "global"_n, eosio_global_state > global_state_singleton; - typedef eosio::singleton< "global2"_n, eosio_global_state2 > global_state2_singleton; - typedef eosio::singleton< "global3"_n, eosio_global_state3 > global_state3_singleton; - - // static constexpr uint32_t max_inflation_rate = 5; // 5% annual inflation - static constexpr uint32_t seconds_per_day = 24 * 3600; - - class [[eosio::contract("eosio.system")]] system_contract : public native { - private: - voters_table _voters; - producers_table _producers; - producers_table2 _producers2; - global_state_singleton _global; - global_state2_singleton _global2; - global_state3_singleton _global3; - eosio_global_state _gstate; - eosio_global_state2 _gstate2; - eosio_global_state3 _gstate3; - rammarket _rammarket; - - public: - static constexpr eosio::name active_permission{"active"_n}; - static constexpr eosio::name token_account{"eosio.token"_n}; - static constexpr eosio::name ram_account{"eosio.ram"_n}; - static constexpr eosio::name ramfee_account{"eosio.ramfee"_n}; - static constexpr eosio::name stake_account{"eosio.stake"_n}; - static constexpr eosio::name bpay_account{"eosio.bpay"_n}; - static constexpr eosio::name vpay_account{"eosio.vpay"_n}; - static constexpr eosio::name names_account{"eosio.names"_n}; - static constexpr eosio::name saving_account{"eosio.saving"_n}; - static constexpr symbol ramcore_symbol = symbol(symbol_code("RAMCORE"), 4); - static constexpr symbol ram_symbol = symbol(symbol_code("RAM"), 0); - - system_contract( name s, name code, datastream ds ); - ~system_contract(); - - static symbol get_core_symbol( name system_account = "eosio"_n ) { - rammarket rm(system_account, system_account.value); - const static auto sym = get_core_symbol( rm ); - return sym; - } - - // Actions: - [[eosio::action]] - void init( unsigned_int version, symbol core ); - [[eosio::action]] - void onblock( ignore header ); - - [[eosio::action]] - void setalimits( name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight ); - // functions defined in delegate_bandwidth.cpp - - /** - * Stakes SYS from the balance of 'from' for the benfit of 'receiver'. - * If transfer == true, then 'receiver' can unstake to their account - * Else 'from' can unstake at any time. - */ - [[eosio::action]] - void delegatebw( name from, name receiver, - asset stake_net_quantity, asset stake_cpu_quantity, bool transfer ); - - - /** - * Decreases the total tokens delegated by from to receiver and/or - * frees the memory associated with the delegation if there is nothing - * left to delegate. - * - * This will cause an immediate reduction in net/cpu bandwidth of the - * receiver. - * - * A transaction is scheduled to send the tokens back to 'from' after - * the staking period has passed. If existing transaction is scheduled, it - * will be canceled and a new transaction issued that has the combined - * undelegated amount. - * - * The 'from' account loses voting power as a result of this call and - * all producer tallies are updated. - */ - [[eosio::action]] - void undelegatebw( name from, name receiver, - asset unstake_net_quantity, asset unstake_cpu_quantity ); - - - /** - * Increases receiver's ram quota based upon current price and quantity of - * tokens provided. An inline transfer from receiver to system contract of - * tokens will be executed. - */ - [[eosio::action]] - void buyram( name payer, name receiver, asset quant ); - [[eosio::action]] - void buyrambytes( name payer, name receiver, uint32_t bytes ); - - /** - * Reduces quota my bytes and then performs an inline transfer of tokens - * to receiver based upon the average purchase price of the original quota. - */ - [[eosio::action]] - void sellram( name account, int64_t bytes ); - - /** - * This action is called after the delegation-period to claim all pending - * unstaked tokens belonging to owner - */ - [[eosio::action]] - void refund( name owner ); - - // functions defined in voting.cpp - - [[eosio::action]] - void regproducer( const name producer, const public_key& producer_key, const std::string& url, uint16_t location ); - - [[eosio::action]] - void unregprod( const name producer ); - - [[eosio::action]] - void setram( uint64_t max_ram_size ); - [[eosio::action]] - void setramrate( uint16_t bytes_per_block ); - - [[eosio::action]] - void voteproducer( const name voter, const name proxy, const std::vector& producers ); - - [[eosio::action]] - void regproxy( const name proxy, bool isproxy ); - - [[eosio::action]] - void setparams( const eosio::blockchain_parameters& params ); - - // functions defined in producer_pay.cpp - [[eosio::action]] - void claimrewards( const name owner ); - - [[eosio::action]] - void setpriv( name account, uint8_t is_priv ); - - [[eosio::action]] - void rmvproducer( name producer ); - - [[eosio::action]] - void updtrevision( uint8_t revision ); - - [[eosio::action]] - void bidname( name bidder, name newname, asset bid ); - - [[eosio::action]] - void bidrefund( name bidder, name newname ); - - private: - // Implementation details: - - static symbol get_core_symbol( const rammarket& rm ) { - auto itr = rm.find(ramcore_symbol.raw()); - eosio_assert(itr != rm.end(), "system contract must first be initialized"); - return itr->quote.balance.symbol; - } - - //defined in eosio.system.cpp - static eosio_global_state get_default_parameters(); - static time_point current_time_point(); - static block_timestamp current_block_time(); - - symbol core_symbol()const; - - void update_ram_supply(); - - //defined in delegate_bandwidth.cpp - void changebw( name from, name receiver, - asset stake_net_quantity, asset stake_cpu_quantity, bool transfer ); - - //defined in voting.hpp - void update_elected_producers( block_timestamp timestamp ); - void update_votes( const name voter, const name proxy, const std::vector& producers, bool voting ); - - // defined in voting.cpp - void propagate_weight_change( const voter_info& voter ); - - double update_producer_votepay_share( const producers_table2::const_iterator& prod_itr, - time_point ct, - double shares_rate, bool reset_to_zero = false ); - double update_total_votepay_share( time_point ct, - double additional_shares_delta = 0.0, double shares_rate_delta = 0.0 ); - }; - -} /// eosiosystem diff --git a/eosio.system/include/eosio.system/exchange_state.hpp b/eosio.system/include/eosio.system/exchange_state.hpp deleted file mode 100644 index aba1eefee..000000000 --- a/eosio.system/include/eosio.system/exchange_state.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include - -namespace eosiosystem { - using eosio::asset; - using eosio::symbol; - - typedef double real_type; - - /** - * Uses Bancor math to create a 50/50 relay between two asset types. The state of the - * bancor exchange is entirely contained within this struct. There are no external - * side effects associated with using this API. - */ - struct [[eosio::table, eosio::contract("eosio.system")]] exchange_state { - asset supply; - - struct connector { - asset balance; - double weight = .5; - - EOSLIB_SERIALIZE( connector, (balance)(weight) ) - }; - - connector base; - connector quote; - - uint64_t primary_key()const { return supply.symbol.raw(); } - - asset convert_to_exchange( connector& c, asset in ); - asset convert_from_exchange( connector& c, asset in ); - asset convert( asset from, const symbol& to ); - - EOSLIB_SERIALIZE( exchange_state, (supply)(base)(quote) ) - }; - - typedef eosio::multi_index< "rammarket"_n, exchange_state > rammarket; - -} /// namespace eosiosystem diff --git a/eosio.system/include/eosio.system/native.hpp b/eosio.system/include/eosio.system/native.hpp deleted file mode 100644 index 6b0445f09..000000000 --- a/eosio.system/include/eosio.system/native.hpp +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -namespace eosiosystem { - using eosio::name; - using eosio::permission_level; - using eosio::public_key; - using eosio::ignore; - - struct permission_level_weight { - permission_level permission; - uint16_t weight; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( permission_level_weight, (permission)(weight) ) - }; - - struct key_weight { - eosio::public_key key; - uint16_t weight; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( key_weight, (key)(weight) ) - }; - - struct wait_weight { - uint32_t wait_sec; - uint16_t weight; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( wait_weight, (wait_sec)(weight) ) - }; - - struct authority { - uint32_t threshold = 0; - std::vector keys; - std::vector accounts; - std::vector waits; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( authority, (threshold)(keys)(accounts)(waits) ) - }; - - struct block_header { - uint32_t timestamp; - name producer; - uint16_t confirmed = 0; - capi_checksum256 previous; - capi_checksum256 transaction_mroot; - capi_checksum256 action_mroot; - uint32_t schedule_version = 0; - std::optional new_producers; - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE(block_header, (timestamp)(producer)(confirmed)(previous)(transaction_mroot)(action_mroot) - (schedule_version)(new_producers)) - }; - - - struct [[eosio::table("abihash"), eosio::contract("eosio.system")]] abi_hash { - name owner; - capi_checksum256 hash; - uint64_t primary_key()const { return owner.value; } - - EOSLIB_SERIALIZE( abi_hash, (owner)(hash) ) - }; - - /* - * Method parameters commented out to prevent generation of code that parses input data. - */ - class [[eosio::contract("eosio.system")]] native : public eosio::contract { - public: - - using eosio::contract::contract; - - /** - * Called after a new account is created. This code enforces resource-limits rules - * for new accounts as well as new account naming conventions. - * - * 1. accounts cannot contain '.' symbols which forces all acccounts to be 12 - * characters long without '.' until a future account auction process is implemented - * which prevents name squatting. - * - * 2. new accounts must stake a minimal number of tokens (as set in system parameters) - * therefore, this method will execute an inline buyram from receiver for newacnt in - * an amount equal to the current new account creation fee. - */ - [[eosio::action]] - void newaccount( name creator, - name name, - ignore owner, - ignore active); - - - [[eosio::action]] - void updateauth( ignore account, - ignore permission, - ignore parent, - ignore auth ) {} - - [[eosio::action]] - void deleteauth( ignore account, - ignore permission ) {} - - [[eosio::action]] - void linkauth( ignore account, - ignore code, - ignore type, - ignore requirement ) {} - - [[eosio::action]] - void unlinkauth( ignore account, - ignore code, - ignore type ) {} - - [[eosio::action]] - void canceldelay( ignore canceling_auth, ignore trx_id ) {} - - [[eosio::action]] - void onerror( ignore sender_id, ignore> sent_trx ) {} - - [[eosio::action]] - void setabi( name account, const std::vector& abi ); - - [[eosio::action]] - void setcode( name account, uint8_t vmtype, uint8_t vmversion, const std::vector& code ) {} - }; -} diff --git a/eosio.system/src/delegate_bandwidth.cpp b/eosio.system/src/delegate_bandwidth.cpp deleted file mode 100644 index dfe073a6a..000000000 --- a/eosio.system/src/delegate_bandwidth.cpp +++ /dev/null @@ -1,453 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - - -#include -#include - -namespace eosiosystem { - using eosio::asset; - using eosio::indexed_by; - using eosio::const_mem_fun; - using eosio::print; - using eosio::permission_level; - using eosio::time_point_sec; - using std::map; - using std::pair; - - static constexpr uint32_t refund_delay_sec = 3*24*3600; - static constexpr int64_t ram_gift_bytes = 1400; - - struct [[eosio::table, eosio::contract("eosio.system")]] user_resources { - name owner; - asset net_weight; - asset cpu_weight; - int64_t ram_bytes = 0; - - uint64_t primary_key()const { return owner.value; } - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( user_resources, (owner)(net_weight)(cpu_weight)(ram_bytes) ) - }; - - - /** - * Every user 'from' has a scope/table that uses every receipient 'to' as the primary key. - */ - struct [[eosio::table, eosio::contract("eosio.system")]] delegated_bandwidth { - name from; - name to; - asset net_weight; - asset cpu_weight; - - uint64_t primary_key()const { return to.value; } - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( delegated_bandwidth, (from)(to)(net_weight)(cpu_weight) ) - - }; - - struct [[eosio::table, eosio::contract("eosio.system")]] refund_request { - name owner; - time_point_sec request_time; - eosio::asset net_amount; - eosio::asset cpu_amount; - - uint64_t primary_key()const { return owner.value; } - - // explicit serialization macro is not necessary, used here only to improve compilation time - EOSLIB_SERIALIZE( refund_request, (owner)(request_time)(net_amount)(cpu_amount) ) - }; - - /** - * These tables are designed to be constructed in the scope of the relevant user, this - * facilitates simpler API for per-user queries - */ - typedef eosio::multi_index< "userres"_n, user_resources > user_resources_table; - typedef eosio::multi_index< "delband"_n, delegated_bandwidth > del_bandwidth_table; - typedef eosio::multi_index< "refunds"_n, refund_request > refunds_table; - - - - /** - * This action will buy an exact amount of ram and bill the payer the current market price. - */ - void system_contract::buyrambytes( name payer, name receiver, uint32_t bytes ) { - - auto itr = _rammarket.find(ramcore_symbol.raw()); - auto tmp = *itr; - auto eosout = tmp.convert( asset(bytes, ram_symbol), core_symbol() ); - - buyram( payer, receiver, eosout ); - } - - - /** - * When buying ram the payer irreversiblly transfers quant to system contract and only - * the receiver may reclaim the tokens via the sellram action. The receiver pays for the - * storage of all database records associated with this action. - * - * RAM is a scarce resource whose supply is defined by global properties max_ram_size. RAM is - * priced using the bancor algorithm such that price-per-byte with a constant reserve ratio of 100:1. - */ - void system_contract::buyram( name payer, name receiver, asset quant ) - { - require_auth( payer ); - update_ram_supply(); - - eosio_assert( quant.symbol == core_symbol(), "must buy ram with core token" ); - eosio_assert( quant.amount > 0, "must purchase a positive amount" ); - - auto fee = quant; - fee.amount = ( fee.amount + 199 ) / 200; /// .5% fee (round up) - // fee.amount cannot be 0 since that is only possible if quant.amount is 0 which is not allowed by the assert above. - // If quant.amount == 1, then fee.amount == 1, - // otherwise if quant.amount > 1, then 0 < fee.amount < quant.amount. - auto quant_after_fee = quant; - quant_after_fee.amount -= fee.amount; - // quant_after_fee.amount should be > 0 if quant.amount > 1. - // If quant.amount == 1, then quant_after_fee.amount == 0 and the next inline transfer will fail causing the buyram action to fail. - - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {payer, active_permission}, {ram_account, active_permission} }, - { payer, ram_account, quant_after_fee, std::string("buy ram") } - ); - - if( fee.amount > 0 ) { - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {payer, active_permission} }, - { payer, ramfee_account, fee, std::string("ram fee") } - ); - } - - int64_t bytes_out; - - const auto& market = _rammarket.get(ramcore_symbol.raw(), "ram market does not exist"); - _rammarket.modify( market, same_payer, [&]( auto& es ) { - bytes_out = es.convert( quant_after_fee, ram_symbol ).amount; - }); - - eosio_assert( bytes_out > 0, "must reserve a positive amount" ); - - _gstate.total_ram_bytes_reserved += uint64_t(bytes_out); - _gstate.total_ram_stake += quant_after_fee.amount; - - user_resources_table userres( _self, receiver.value ); - auto res_itr = userres.find( receiver.value ); - if( res_itr == userres.end() ) { - res_itr = userres.emplace( receiver, [&]( auto& res ) { - res.owner = receiver; - res.net_weight = asset( 0, core_symbol() ); - res.cpu_weight = asset( 0, core_symbol() ); - res.ram_bytes = bytes_out; - }); - } else { - userres.modify( res_itr, receiver, [&]( auto& res ) { - res.ram_bytes += bytes_out; - }); - } - set_resource_limits( res_itr->owner.value, res_itr->ram_bytes + ram_gift_bytes, res_itr->net_weight.amount, res_itr->cpu_weight.amount ); - } - - /** - * The system contract now buys and sells RAM allocations at prevailing market prices. - * This may result in traders buying RAM today in anticipation of potential shortages - * tomorrow. Overall this will result in the market balancing the supply and demand - * for RAM over time. - */ - void system_contract::sellram( name account, int64_t bytes ) { - require_auth( account ); - update_ram_supply(); - - eosio_assert( bytes > 0, "cannot sell negative byte" ); - - user_resources_table userres( _self, account.value ); - auto res_itr = userres.find( account.value ); - eosio_assert( res_itr != userres.end(), "no resource row" ); - eosio_assert( res_itr->ram_bytes >= bytes, "insufficient quota" ); - - asset tokens_out; - auto itr = _rammarket.find(ramcore_symbol.raw()); - _rammarket.modify( itr, same_payer, [&]( auto& es ) { - /// the cast to int64_t of bytes is safe because we certify bytes is <= quota which is limited by prior purchases - tokens_out = es.convert( asset(bytes, ram_symbol), core_symbol()); - }); - - eosio_assert( tokens_out.amount > 1, "token amount received from selling ram is too low" ); - - _gstate.total_ram_bytes_reserved -= static_cast(bytes); // bytes > 0 is asserted above - _gstate.total_ram_stake -= tokens_out.amount; - - //// this shouldn't happen, but just in case it does we should prevent it - eosio_assert( _gstate.total_ram_stake >= 0, "error, attempt to unstake more tokens than previously staked" ); - - userres.modify( res_itr, account, [&]( auto& res ) { - res.ram_bytes -= bytes; - }); - set_resource_limits( res_itr->owner.value, res_itr->ram_bytes + ram_gift_bytes, res_itr->net_weight.amount, res_itr->cpu_weight.amount ); - - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {ram_account, active_permission}, {account, active_permission} }, - { ram_account, account, asset(tokens_out), std::string("sell ram") } - ); - - auto fee = ( tokens_out.amount + 199 ) / 200; /// .5% fee (round up) - // since tokens_out.amount was asserted to be at least 2 earlier, fee.amount < tokens_out.amount - if( fee > 0 ) { - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {account, active_permission} }, - { account, ramfee_account, asset(fee, core_symbol()), std::string("sell ram fee") } - ); - } - } - - void validate_b1_vesting( int64_t stake ) { - const int64_t base_time = 1527811200; /// 2018-06-01 - const int64_t max_claimable = 100'000'000'0000ll; - const int64_t claimable = int64_t(max_claimable * double(now()-base_time) / (10*seconds_per_year) ); - - eosio_assert( max_claimable - claimable <= stake, "b1 can only claim their tokens over 10 years" ); - } - - void system_contract::changebw( name from, name receiver, - const asset stake_net_delta, const asset stake_cpu_delta, bool transfer ) - { - require_auth( from ); - eosio_assert( stake_net_delta.amount != 0 || stake_cpu_delta.amount != 0, "should stake non-zero amount" ); - eosio_assert( std::abs( (stake_net_delta + stake_cpu_delta).amount ) - >= std::max( std::abs( stake_net_delta.amount ), std::abs( stake_cpu_delta.amount ) ), - "net and cpu deltas cannot be opposite signs" ); - - name source_stake_from = from; - if ( transfer ) { - from = receiver; - } - - // update stake delegated from "from" to "receiver" - { - del_bandwidth_table del_tbl( _self, from.value ); - auto itr = del_tbl.find( receiver.value ); - if( itr == del_tbl.end() ) { - itr = del_tbl.emplace( from, [&]( auto& dbo ){ - dbo.from = from; - dbo.to = receiver; - dbo.net_weight = stake_net_delta; - dbo.cpu_weight = stake_cpu_delta; - }); - } - else { - del_tbl.modify( itr, same_payer, [&]( auto& dbo ){ - dbo.net_weight += stake_net_delta; - dbo.cpu_weight += stake_cpu_delta; - }); - } - eosio_assert( 0 <= itr->net_weight.amount, "insufficient staked net bandwidth" ); - eosio_assert( 0 <= itr->cpu_weight.amount, "insufficient staked cpu bandwidth" ); - if ( itr->net_weight.amount == 0 && itr->cpu_weight.amount == 0 ) { - del_tbl.erase( itr ); - } - } // itr can be invalid, should go out of scope - - // update totals of "receiver" - { - user_resources_table totals_tbl( _self, receiver.value ); - auto tot_itr = totals_tbl.find( receiver.value ); - if( tot_itr == totals_tbl.end() ) { - tot_itr = totals_tbl.emplace( from, [&]( auto& tot ) { - tot.owner = receiver; - tot.net_weight = stake_net_delta; - tot.cpu_weight = stake_cpu_delta; - }); - } else { - totals_tbl.modify( tot_itr, from == receiver ? from : same_payer, [&]( auto& tot ) { - tot.net_weight += stake_net_delta; - tot.cpu_weight += stake_cpu_delta; - }); - } - eosio_assert( 0 <= tot_itr->net_weight.amount, "insufficient staked total net bandwidth" ); - eosio_assert( 0 <= tot_itr->cpu_weight.amount, "insufficient staked total cpu bandwidth" ); - - int64_t ram_bytes, net, cpu; - get_resource_limits( receiver.value, &ram_bytes, &net, &cpu ); - - set_resource_limits( receiver.value, std::max( tot_itr->ram_bytes + ram_gift_bytes, ram_bytes ), tot_itr->net_weight.amount, tot_itr->cpu_weight.amount ); - - if ( tot_itr->net_weight.amount == 0 && tot_itr->cpu_weight.amount == 0 && tot_itr->ram_bytes == 0 ) { - totals_tbl.erase( tot_itr ); - } - } // tot_itr can be invalid, should go out of scope - - // create refund or update from existing refund - if ( stake_account != source_stake_from ) { //for eosio both transfer and refund make no sense - refunds_table refunds_tbl( _self, from.value ); - auto req = refunds_tbl.find( from.value ); - - //create/update/delete refund - auto net_balance = stake_net_delta; - auto cpu_balance = stake_cpu_delta; - bool need_deferred_trx = false; - - - // net and cpu are same sign by assertions in delegatebw and undelegatebw - // redundant assertion also at start of changebw to protect against misuse of changebw - bool is_undelegating = (net_balance.amount + cpu_balance.amount ) < 0; - bool is_delegating_to_self = (!transfer && from == receiver); - - if( is_delegating_to_self || is_undelegating ) { - if ( req != refunds_tbl.end() ) { //need to update refund - refunds_tbl.modify( req, same_payer, [&]( refund_request& r ) { - if ( net_balance.amount < 0 || cpu_balance.amount < 0 ) { - r.request_time = current_time_point(); - } - r.net_amount -= net_balance; - if ( r.net_amount.amount < 0 ) { - net_balance = -r.net_amount; - r.net_amount.amount = 0; - } else { - net_balance.amount = 0; - } - r.cpu_amount -= cpu_balance; - if ( r.cpu_amount.amount < 0 ){ - cpu_balance = -r.cpu_amount; - r.cpu_amount.amount = 0; - } else { - cpu_balance.amount = 0; - } - }); - - eosio_assert( 0 <= req->net_amount.amount, "negative net refund amount" ); //should never happen - eosio_assert( 0 <= req->cpu_amount.amount, "negative cpu refund amount" ); //should never happen - - if ( req->net_amount.amount == 0 && req->cpu_amount.amount == 0 ) { - refunds_tbl.erase( req ); - need_deferred_trx = false; - } else { - need_deferred_trx = true; - } - } else if ( net_balance.amount < 0 || cpu_balance.amount < 0 ) { //need to create refund - refunds_tbl.emplace( from, [&]( refund_request& r ) { - r.owner = from; - if ( net_balance.amount < 0 ) { - r.net_amount = -net_balance; - net_balance.amount = 0; - } else { - r.net_amount = asset( 0, core_symbol() ); - } - if ( cpu_balance.amount < 0 ) { - r.cpu_amount = -cpu_balance; - cpu_balance.amount = 0; - } else { - r.cpu_amount = asset( 0, core_symbol() ); - } - r.request_time = current_time_point(); - }); - need_deferred_trx = true; - } // else stake increase requested with no existing row in refunds_tbl -> nothing to do with refunds_tbl - } /// end if is_delegating_to_self || is_undelegating - - if ( need_deferred_trx ) { - eosio::transaction out; - out.actions.emplace_back( permission_level{from, active_permission}, - _self, "refund"_n, - from - ); - out.delay_sec = refund_delay_sec; - cancel_deferred( from.value ); // TODO: Remove this line when replacing deferred trxs is fixed - out.send( from.value, from, true ); - } else { - cancel_deferred( from.value ); - } - - auto transfer_amount = net_balance + cpu_balance; - if ( 0 < transfer_amount.amount ) { - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {source_stake_from, active_permission} }, - { source_stake_from, stake_account, asset(transfer_amount), std::string("stake bandwidth") } - ); - } - } - - // update voting power - { - asset total_update = stake_net_delta + stake_cpu_delta; - auto from_voter = _voters.find( from.value ); - if( from_voter == _voters.end() ) { - from_voter = _voters.emplace( from, [&]( auto& v ) { - v.owner = from; - v.staked = total_update.amount; - }); - } else { - _voters.modify( from_voter, same_payer, [&]( auto& v ) { - v.staked += total_update.amount; - }); - } - eosio_assert( 0 <= from_voter->staked, "stake for voting cannot be negative"); - if( from == "b1"_n ) { - validate_b1_vesting( from_voter->staked ); - } - - if( from_voter->producers.size() || from_voter->proxy ) { - update_votes( from, from_voter->proxy, from_voter->producers, false ); - } - } - } - - void system_contract::delegatebw( name from, name receiver, - asset stake_net_quantity, - asset stake_cpu_quantity, bool transfer ) - { - asset zero_asset( 0, core_symbol() ); - eosio_assert( stake_cpu_quantity >= zero_asset, "must stake a positive amount" ); - eosio_assert( stake_net_quantity >= zero_asset, "must stake a positive amount" ); - eosio_assert( stake_net_quantity.amount + stake_cpu_quantity.amount > 0, "must stake a positive amount" ); - eosio_assert( !transfer || from != receiver, "cannot use transfer flag if delegating to self" ); - - changebw( from, receiver, stake_net_quantity, stake_cpu_quantity, transfer); - } // delegatebw - - void system_contract::undelegatebw( name from, name receiver, - asset unstake_net_quantity, asset unstake_cpu_quantity ) - { - asset zero_asset( 0, core_symbol() ); - eosio_assert( unstake_cpu_quantity >= zero_asset, "must unstake a positive amount" ); - eosio_assert( unstake_net_quantity >= zero_asset, "must unstake a positive amount" ); - eosio_assert( unstake_cpu_quantity.amount + unstake_net_quantity.amount > 0, "must unstake a positive amount" ); - eosio_assert( _gstate.total_activated_stake >= min_activated_stake, - "cannot undelegate bandwidth until the chain is activated (at least 15% of all tokens participate in voting)" ); - - changebw( from, receiver, -unstake_net_quantity, -unstake_cpu_quantity, false); - } // undelegatebw - - - void system_contract::refund( const name owner ) { - require_auth( owner ); - - refunds_table refunds_tbl( _self, owner.value ); - auto req = refunds_tbl.find( owner.value ); - eosio_assert( req != refunds_tbl.end(), "refund request not found" ); - eosio_assert( req->request_time + seconds(refund_delay_sec) <= current_time_point(), - "refund is not available yet" ); - - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {stake_account, active_permission}, {req->owner, active_permission} }, - { stake_account, req->owner, req->net_amount + req->cpu_amount, std::string("unstake") } - ); - - refunds_tbl.erase( req ); - } - - -} //namespace eosiosystem diff --git a/eosio.system/src/eosio.system.cpp b/eosio.system/src/eosio.system.cpp deleted file mode 100644 index eb99a2081..000000000 --- a/eosio.system/src/eosio.system.cpp +++ /dev/null @@ -1,318 +0,0 @@ -#include -#include -#include - -#include "producer_pay.cpp" -#include "delegate_bandwidth.cpp" -#include "voting.cpp" -#include "exchange_state.cpp" - - -namespace eosiosystem { - - system_contract::system_contract( name s, name code, datastream ds ) - :native(s,code,ds), - _voters(_self, _self.value), - _producers(_self, _self.value), - _producers2(_self, _self.value), - _global(_self, _self.value), - _global2(_self, _self.value), - _global3(_self, _self.value), - _rammarket(_self, _self.value) - { - - //print( "construct system\n" ); - _gstate = _global.exists() ? _global.get() : get_default_parameters(); - _gstate2 = _global2.exists() ? _global2.get() : eosio_global_state2{}; - _gstate3 = _global3.exists() ? _global3.get() : eosio_global_state3{}; - } - - eosio_global_state system_contract::get_default_parameters() { - eosio_global_state dp; - get_blockchain_parameters(dp); - return dp; - } - - time_point system_contract::current_time_point() { - const static time_point ct{ microseconds{ static_cast( current_time() ) } }; - return ct; - } - - block_timestamp system_contract::current_block_time() { - const static block_timestamp cbt{ current_time_point() }; - return cbt; - } - - symbol system_contract::core_symbol()const { - const static auto sym = get_core_symbol( _rammarket ); - return sym; - } - - system_contract::~system_contract() { - _global.set( _gstate, _self ); - _global2.set( _gstate2, _self ); - _global3.set( _gstate3, _self ); - } - - void system_contract::setram( uint64_t max_ram_size ) { - require_auth( _self ); - - eosio_assert( _gstate.max_ram_size < max_ram_size, "ram may only be increased" ); /// decreasing ram might result market maker issues - eosio_assert( max_ram_size < 1024ll*1024*1024*1024*1024, "ram size is unrealistic" ); - eosio_assert( max_ram_size > _gstate.total_ram_bytes_reserved, "attempt to set max below reserved" ); - - auto delta = int64_t(max_ram_size) - int64_t(_gstate.max_ram_size); - auto itr = _rammarket.find(ramcore_symbol.raw()); - - /** - * Increase the amount of ram for sale based upon the change in max ram size. - */ - _rammarket.modify( itr, same_payer, [&]( auto& m ) { - m.base.balance.amount += delta; - }); - - _gstate.max_ram_size = max_ram_size; - } - - void system_contract::update_ram_supply() { - auto cbt = current_block_time(); - - if( cbt <= _gstate2.last_ram_increase ) return; - - auto itr = _rammarket.find(ramcore_symbol.raw()); - auto new_ram = (cbt.slot - _gstate2.last_ram_increase.slot)*_gstate2.new_ram_per_block; - _gstate.max_ram_size += new_ram; - - /** - * Increase the amount of ram for sale based upon the change in max ram size. - */ - _rammarket.modify( itr, same_payer, [&]( auto& m ) { - m.base.balance.amount += new_ram; - }); - _gstate2.last_ram_increase = cbt; - } - - /** - * Sets the rate of increase of RAM in bytes per block. It is capped by the uint16_t to - * a maximum rate of 3 TB per year. - * - * If update_ram_supply hasn't been called for the most recent block, then new ram will - * be allocated at the old rate up to the present block before switching the rate. - */ - void system_contract::setramrate( uint16_t bytes_per_block ) { - require_auth( _self ); - - update_ram_supply(); - _gstate2.new_ram_per_block = bytes_per_block; - } - - void system_contract::setparams( const eosio::blockchain_parameters& params ) { - require_auth( _self ); - (eosio::blockchain_parameters&)(_gstate) = params; - eosio_assert( 3 <= _gstate.max_authority_depth, "max_authority_depth should be at least 3" ); - set_blockchain_parameters( params ); - } - - void system_contract::setpriv( name account, uint8_t ispriv ) { - require_auth( _self ); - set_privileged( account.value, ispriv ); - } - - void system_contract::setalimits( name account, int64_t ram, int64_t net, int64_t cpu ) { - require_auth( _self ); - user_resources_table userres( _self, account.value ); - auto ritr = userres.find( account.value ); - eosio_assert( ritr == userres.end(), "only supports unlimited accounts" ); - set_resource_limits( account.value, ram, net, cpu ); - } - - void system_contract::rmvproducer( name producer ) { - require_auth( _self ); - auto prod = _producers.find( producer.value ); - eosio_assert( prod != _producers.end(), "producer not found" ); - _producers.modify( prod, same_payer, [&](auto& p) { - p.deactivate(); - }); - } - - void system_contract::updtrevision( uint8_t revision ) { - require_auth( _self ); - eosio_assert( _gstate2.revision < 255, "can not increment revision" ); // prevent wrap around - eosio_assert( revision == _gstate2.revision + 1, "can only increment revision by one" ); - eosio_assert( revision <= 1, // set upper bound to greatest revision supported in the code - "specified revision is not yet supported by the code" ); - _gstate2.revision = revision; - } - - void system_contract::bidname( name bidder, name newname, asset bid ) { - require_auth( bidder ); - eosio_assert( newname.suffix() == newname, "you can only bid on top-level suffix" ); - - eosio_assert( (bool)newname, "the empty name is not a valid account name to bid on" ); - eosio_assert( (newname.value & 0xFull) == 0, "13 character names are not valid account names to bid on" ); - eosio_assert( (newname.value & 0x1F0ull) == 0, "accounts with 12 character names and no dots can be created without bidding required" ); - eosio_assert( !is_account( newname ), "account already exists" ); - eosio_assert( bid.symbol == core_symbol(), "asset must be system token" ); - eosio_assert( bid.amount > 0, "insufficient bid" ); - - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {bidder, active_permission} }, - { bidder, names_account, bid, std::string("bid name ")+ newname.to_string() } - ); - - name_bid_table bids(_self, _self.value); - print( name{bidder}, " bid ", bid, " on ", name{newname}, "\n" ); - auto current = bids.find( newname.value ); - if( current == bids.end() ) { - bids.emplace( bidder, [&]( auto& b ) { - b.newname = newname; - b.high_bidder = bidder; - b.high_bid = bid.amount; - b.last_bid_time = current_time_point(); - }); - } else { - eosio_assert( current->high_bid > 0, "this auction has already closed" ); - eosio_assert( bid.amount - current->high_bid > (current->high_bid / 10), "must increase bid by 10%" ); - eosio_assert( current->high_bidder != bidder, "account is already highest bidder" ); - - bid_refund_table refunds_table(_self, newname.value); - - auto it = refunds_table.find( current->high_bidder.value ); - if ( it != refunds_table.end() ) { - refunds_table.modify( it, same_payer, [&](auto& r) { - r.amount += asset( current->high_bid, core_symbol() ); - }); - } else { - refunds_table.emplace( bidder, [&](auto& r) { - r.bidder = current->high_bidder; - r.amount = asset( current->high_bid, core_symbol() ); - }); - } - - transaction t; - t.actions.emplace_back( permission_level{_self, active_permission}, - _self, "bidrefund"_n, - std::make_tuple( current->high_bidder, newname ) - ); - t.delay_sec = 0; - uint128_t deferred_id = (uint128_t(newname.value) << 64) | current->high_bidder.value; - cancel_deferred( deferred_id ); - t.send( deferred_id, bidder ); - - bids.modify( current, bidder, [&]( auto& b ) { - b.high_bidder = bidder; - b.high_bid = bid.amount; - b.last_bid_time = current_time_point(); - }); - } - } - - void system_contract::bidrefund( name bidder, name newname ) { - bid_refund_table refunds_table(_self, newname.value); - auto it = refunds_table.find( bidder.value ); - eosio_assert( it != refunds_table.end(), "refund not found" ); - INLINE_ACTION_SENDER(eosio::token, transfer)( - token_account, { {names_account, active_permission}, {bidder, active_permission} }, - { names_account, bidder, asset(it->amount), std::string("refund bid on name ")+(name{newname}).to_string() } - ); - refunds_table.erase( it ); - } - - /** - * Called after a new account is created. This code enforces resource-limits rules - * for new accounts as well as new account naming conventions. - * - * Account names containing '.' symbols must have a suffix equal to the name of the creator. - * This allows users who buy a premium name (shorter than 12 characters with no dots) to be the only ones - * who can create accounts with the creator's name as a suffix. - * - */ - void native::newaccount( name creator, - name newact, - ignore owner, - ignore active ) { - - if( creator != _self ) { - uint64_t tmp = newact.value >> 4; - bool has_dot = false; - - for( uint32_t i = 0; i < 12; ++i ) { - has_dot |= !(tmp & 0x1f); - tmp >>= 5; - } - if( has_dot ) { // or is less than 12 characters - auto suffix = newact.suffix(); - if( suffix == newact ) { - name_bid_table bids(_self, _self.value); - auto current = bids.find( newact.value ); - eosio_assert( current != bids.end(), "no active bid for name" ); - eosio_assert( current->high_bidder == creator, "only highest bidder can claim" ); - eosio_assert( current->high_bid < 0, "auction for name is not closed yet" ); - bids.erase( current ); - } else { - eosio_assert( creator == suffix, "only suffix may create this account" ); - } - } - } - - user_resources_table userres( _self, newact.value); - - userres.emplace( newact, [&]( auto& res ) { - res.owner = newact; - res.net_weight = asset( 0, system_contract::get_core_symbol() ); - res.cpu_weight = asset( 0, system_contract::get_core_symbol() ); - }); - - set_resource_limits( newact.value, 0, 0, 0 ); - } - - void native::setabi( name acnt, const std::vector& abi ) { - eosio::multi_index< "abihash"_n, abi_hash > table(_self, _self.value); - auto itr = table.find( acnt.value ); - if( itr == table.end() ) { - table.emplace( acnt, [&]( auto& row ) { - row.owner= acnt; - sha256( const_cast(abi.data()), abi.size(), &row.hash ); - }); - } else { - table.modify( itr, same_payer, [&]( auto& row ) { - sha256( const_cast(abi.data()), abi.size(), &row.hash ); - }); - } - } - - void system_contract::init( unsigned_int version, symbol core ) { - require_auth( _self ); - eosio_assert( version.value == 0, "unsupported version for init action" ); - - auto itr = _rammarket.find(ramcore_symbol.raw()); - eosio_assert( itr == _rammarket.end(), "system contract has already been initialized" ); - - auto system_token_supply = eosio::token::get_supply(token_account, core.code() ); - eosio_assert( system_token_supply.symbol == core, "specified core symbol does not exist (precision mismatch)" ); - - eosio_assert( system_token_supply.amount > 0, "system token supply must be greater than 0" ); - _rammarket.emplace( _self, [&]( auto& m ) { - m.supply.amount = 100000000000000ll; - m.supply.symbol = ramcore_symbol; - m.base.balance.amount = int64_t(_gstate.free_ram()); - m.base.balance.symbol = ram_symbol; - m.quote.balance.amount = system_token_supply.amount / 1000; - m.quote.balance.symbol = core; - }); - } -} /// eosio.system - - -EOSIO_DISPATCH( eosiosystem::system_contract, - // native.hpp (newaccount definition is actually in eosio.system.cpp) - (newaccount)(updateauth)(deleteauth)(linkauth)(unlinkauth)(canceldelay)(onerror)(setabi) - // eosio.system.cpp - (init)(setram)(setramrate)(setparams)(setpriv)(setalimits)(rmvproducer)(updtrevision)(bidname)(bidrefund) - // delegate_bandwidth.cpp - (buyrambytes)(buyram)(sellram)(delegatebw)(undelegatebw)(refund) - // voting.cpp - (regproducer)(unregprod)(voteproducer)(regproxy) - // producer_pay.cpp - (onblock)(claimrewards) -) diff --git a/eosio.system/src/exchange_state.cpp b/eosio.system/src/exchange_state.cpp deleted file mode 100644 index 28b43de7c..000000000 --- a/eosio.system/src/exchange_state.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include - -namespace eosiosystem { - asset exchange_state::convert_to_exchange( connector& c, asset in ) { - - real_type R(supply.amount); - real_type C(c.balance.amount+in.amount); - real_type F(c.weight); - real_type T(in.amount); - real_type ONE(1.0); - - real_type E = -R * (ONE - std::pow( ONE + T / C, F) ); - int64_t issued = int64_t(E); - - supply.amount += issued; - c.balance.amount += in.amount; - - return asset( issued, supply.symbol ); - } - - asset exchange_state::convert_from_exchange( connector& c, asset in ) { - eosio_assert( in.symbol== supply.symbol, "unexpected asset symbol input" ); - - real_type R(supply.amount - in.amount); - real_type C(c.balance.amount); - real_type F(1.0/c.weight); - real_type E(in.amount); - real_type ONE(1.0); - - - // potentially more accurate: - // The functions std::expm1 and std::log1p are useful for financial calculations, for example, - // when calculating small daily interest rates: (1+x)n - // -1 can be expressed as std::expm1(n * std::log1p(x)). - // real_type T = C * std::expm1( F * std::log1p(E/R) ); - - real_type T = C * (std::pow( ONE + E/R, F) - ONE); - int64_t out = int64_t(T); - - supply.amount -= in.amount; - c.balance.amount -= out; - - return asset( out, c.balance.symbol ); - } - - asset exchange_state::convert( asset from, const symbol& to ) { - auto sell_symbol = from.symbol; - auto ex_symbol = supply.symbol; - auto base_symbol = base.balance.symbol; - auto quote_symbol = quote.balance.symbol; - - //print( "From: ", from, " TO ", asset( 0,to), "\n" ); - //print( "base: ", base_symbol, "\n" ); - //print( "quote: ", quote_symbol, "\n" ); - //print( "ex: ", supply.symbol, "\n" ); - - if( sell_symbol != ex_symbol ) { - if( sell_symbol == base_symbol ) { - from = convert_to_exchange( base, from ); - } else if( sell_symbol == quote_symbol ) { - from = convert_to_exchange( quote, from ); - } else { - eosio_assert( false, "invalid sell" ); - } - } else { - if( to == base_symbol ) { - from = convert_from_exchange( base, from ); - } else if( to == quote_symbol ) { - from = convert_from_exchange( quote, from ); - } else { - eosio_assert( false, "invalid conversion" ); - } - } - - if( to != from.symbol ) - return convert( from, to ); - - return from; - } - - - -} /// namespace eosiosystem diff --git a/eosio.token/CMakeLists.txt b/eosio.token/CMakeLists.txt deleted file mode 100644 index 5582d04aa..000000000 --- a/eosio.token/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_contract(eosio.token eosio.token ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.token.cpp) -target_include_directories(eosio.token.wasm - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include) - -set_target_properties(eosio.token.wasm - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/eosio.token/README.md b/eosio.token/README.md deleted file mode 100644 index b482fc400..000000000 --- a/eosio.token/README.md +++ /dev/null @@ -1,7 +0,0 @@ -eosio.token ------------ - -This eosio contract allows users to create, issue, and manage tokens on -eosio based blockchains. - - diff --git a/eosio.token/include/eosio.token/eosio.token.hpp b/eosio.token/include/eosio.token/eosio.token.hpp deleted file mode 100644 index 53130bdbb..000000000 --- a/eosio.token/include/eosio.token/eosio.token.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ -#pragma once - -#include -#include - -#include - -namespace eosiosystem { - class system_contract; -} - -namespace eosio { - - using std::string; - - class [[eosio::contract("eosio.token")]] token : public contract { - public: - using contract::contract; - - [[eosio::action]] - void create( name issuer, - asset maximum_supply); - - [[eosio::action]] - void issue( name to, asset quantity, string memo ); - - [[eosio::action]] - void retire( asset quantity, string memo ); - - [[eosio::action]] - void transfer( name from, - name to, - asset quantity, - string memo ); - - [[eosio::action]] - void open( name owner, const symbol& symbol, name ram_payer ); - - [[eosio::action]] - void 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; - } - - private: - struct [[eosio::table]] account { - asset balance; - - uint64_t primary_key()const { return balance.symbol.code().raw(); } - }; - - struct [[eosio::table]] currency_stats { - asset supply; - asset max_supply; - name issuer; - - uint64_t primary_key()const { return supply.symbol.code().raw(); } - }; - - typedef eosio::multi_index< "accounts"_n, account > accounts; - typedef eosio::multi_index< "stat"_n, currency_stats > stats; - - void sub_balance( name owner, asset value ); - void add_balance( name owner, asset value, name ram_payer ); - }; - -} /// namespace eosio diff --git a/eosio.token/src/eosio.token.cpp b/eosio.token/src/eosio.token.cpp deleted file mode 100644 index b18a68af5..000000000 --- a/eosio.token/src/eosio.token.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ - -#include - -namespace eosio { - -void 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; - }); -} - - -void 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 } - ); - } -} - -void 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 ); -} - -void 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 ); -} - -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; - }); -} - -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; - }); - } -} - -void 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}; - }); - } -} - -void 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)(open)(close)(retire) ) diff --git a/eosio.wrap/CMakeLists.txt b/eosio.wrap/CMakeLists.txt deleted file mode 100644 index d67ef83a5..000000000 --- a/eosio.wrap/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_contract(eosio.wrap eosio.wrap ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.wrap.cpp) -target_include_directories(eosio.wrap.wasm - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include) - -set_target_properties(eosio.wrap.wasm - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp b/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp deleted file mode 100644 index a01aa363a..000000000 --- a/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace eosio { - - class [[eosio::contract("eosio.wrap")]] wrap : public contract { - public: - using contract::contract; - - [[eosio::action]] - void exec( ignore executer, ignore trx ); - - }; - -} /// namespace eosio diff --git a/pipeline.jsonc b/pipeline.jsonc new file mode 100644 index 000000000..b9d36799a --- /dev/null +++ b/pipeline.jsonc @@ -0,0 +1,11 @@ +{ + "eosio-dot-contracts": + { + "pipeline-branch": "master", + "dependencies": // dependencies to pull for a build of contracts, by branch, tag, or commit hash + { + "eosio": "release/2.0.x", + "eosio.cdt": "release/1.7.x" + } + } +} diff --git a/scripts/.environment b/scripts/.environment new file mode 100755 index 000000000..5f5b7731e --- /dev/null +++ b/scripts/.environment @@ -0,0 +1,12 @@ +export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +export REPO_ROOT="${SCRIPT_DIR}/.." +export TEST_DIR="${REPO_ROOT}/tests" + +export EOSIO_MIN_VERSION_MAJOR=$(cat $TEST_DIR/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*EOSIO_VERSION_MIN" | tail -1 | sed 's/.*EOSIO_VERSION_MIN //g' | sed 's/ //g' | sed 's/"//g' | cut -d\) -f1 | cut -f1 -d '.') +export EOSIO_MIN_VERSION_MINOR=$(cat $TEST_DIR/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*EOSIO_VERSION_MIN" | tail -1 | sed 's/.*EOSIO_VERSION_MIN //g' | sed 's/ //g' | sed 's/"//g' | cut -d\) -f1 | cut -f2 -d '.') +export EOSIO_SOFT_MAX_MAJOR=$(cat $TEST_DIR/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*EOSIO_VERSION_SOFT_MAX" | tail -1 | sed 's/.*EOSIO_VERSION_SOFT_MAX //g' | sed 's/ //g' | sed 's/"//g' | cut -d\) -f1 | cut -f1 -d '.') +export EOSIO_SOFT_MAX_MINOR=$(cat $TEST_DIR/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*EOSIO_VERSION_SOFT_MAX" | tail -1 | sed 's/.*EOSIO_VERSION_SOFT_MAX //g' | sed 's/ //g' | sed 's/"//g' | cut -d\) -f1 | cut -f2 -d '.') +export EOSIO_MAX_VERSION=$(cat $TEST_DIR/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*EOSIO_VERSION_HARD_MAX" | tail -1 | sed 's/.*EOSIO_VERSION_HARD_MAX //g' | sed 's/ //g' | sed 's/"//g' | cut -d\) -f1) +export EOSIO_MAX_VERSION="${EOSIO_MAX_VERSION:-$(echo $EOSIO_SOFT_MAX_MAJOR.999)}" +export EOSIO_MAX_VERSION_MAJOR=$(echo $EOSIO_MAX_VERSION | cut -f1 -d '.') +export EOSIO_MAX_VERSION_MINOR=$(echo $EOSIO_MAX_VERSION | cut -f2 -d '.') \ No newline at end of file diff --git a/scripts/helper.sh b/scripts/helper.sh new file mode 100755 index 000000000..6ef760b30 --- /dev/null +++ b/scripts/helper.sh @@ -0,0 +1,137 @@ +# Ensures passed in version values are supported. +function check-version-numbers() { + CHECK_VERSION_MAJOR=$1 + CHECK_VERSION_MINOR=$2 + + if [[ $CHECK_VERSION_MAJOR -lt $EOSIO_MIN_VERSION_MAJOR ]]; then + exit 1 + fi + if [[ $CHECK_VERSION_MAJOR -gt $EOSIO_MAX_VERSION_MAJOR ]]; then + exit 1 + fi + if [[ $CHECK_VERSION_MAJOR -eq $EOSIO_MIN_VERSION_MAJOR ]]; then + if [[ $CHECK_VERSION_MINOR -lt $EOSIO_MIN_VERSION_MINOR ]]; then + exit 1 + fi + fi + if [[ $CHECK_VERSION_MAJOR -eq $EOSIO_MAX_VERSION_MAJOR ]]; then + if [[ $CHECK_VERSION_MINOR -gt $EOSIO_MAX_VERSION_MINOR ]]; then + exit 1 + fi + fi + exit 0 +} + + +# Handles choosing which EOSIO directory to select when the default location is used. +function default-eosio-directories() { + REGEX='^[0-9]+([.][0-9]+)?$' + ALL_EOSIO_SUBDIRS=() + if [[ -d ${HOME}/eosio ]]; then + ALL_EOSIO_SUBDIRS=($(ls ${HOME}/eosio | sort -V)) + fi + for ITEM in "${ALL_EOSIO_SUBDIRS[@]}"; do + if [[ "$ITEM" =~ $REGEX ]]; then + DIR_MAJOR=$(echo $ITEM | cut -f1 -d '.') + DIR_MINOR=$(echo $ITEM | cut -f2 -d '.') + if $(check-version-numbers $DIR_MAJOR $DIR_MINOR); then + PROMPT_EOSIO_DIRS+=($ITEM) + fi + fi + done + for ITEM in "${PROMPT_EOSIO_DIRS[@]}"; do + if [[ "$ITEM" =~ $REGEX ]]; then + EOSIO_VERSION=$ITEM + fi + done +} + + +# Prompts or sets default behavior for choosing EOSIO directory. +function eosio-directory-prompt() { + if [[ -z $EOSIO_DIR_PROMPT ]]; then + default-eosio-directories; + echo 'No EOSIO location was specified.' + while true; do + if [[ $NONINTERACTIVE != true ]]; then + if [[ -z $EOSIO_VERSION ]]; then + echo "No default EOSIO installations detected..." + PROCEED=n + else + printf "Is EOSIO installed in the default location: $HOME/eosio/$EOSIO_VERSION (y/n)" && read -p " " PROCEED + fi + fi + echo "" + case $PROCEED in + "" ) + echo "Is EOSIO installed in the default location?";; + 0 | true | [Yy]* ) + break;; + 1 | false | [Nn]* ) + if [[ $PROMPT_EOSIO_DIRS ]]; then + echo "Found these compatible EOSIO versions in the default location." + printf "$HOME/eosio/%s\n" "${PROMPT_EOSIO_DIRS[@]}" + fi + printf "Enter the installation location of EOSIO:" && read -e -p " " EOSIO_DIR_PROMPT; + EOSIO_DIR_PROMPT="${EOSIO_DIR_PROMPT/#\~/$HOME}" + break;; + * ) + echo "Please type 'y' for yes or 'n' for no.";; + esac + done + fi + export EOSIO_INSTALL_DIR="${EOSIO_DIR_PROMPT:-${HOME}/eosio/${EOSIO_VERSION}}" +} + + +# Prompts or default behavior for choosing EOSIO.CDT directory. +function cdt-directory-prompt() { + if [[ -z $CDT_DIR_PROMPT ]]; then + echo 'No EOSIO.CDT location was specified.' + while true; do + if [[ $NONINTERACTIVE != true ]]; then + printf "Is EOSIO.CDT installed in the default location? /usr/local/eosio.cdt (y/n)" && read -p " " PROCEED + fi + echo "" + case $PROCEED in + "" ) + echo "Is EOSIO.CDT installed in the default location?";; + 0 | true | [Yy]* ) + break;; + 1 | false | [Nn]* ) + printf "Enter the installation location of EOSIO.CDT:" && read -e -p " " CDT_DIR_PROMPT; + CDT_DIR_PROMPT="${CDT_DIR_PROMPT/#\~/$HOME}" + break;; + * ) + echo "Please type 'y' for yes or 'n' for no.";; + esac + done + fi + export CDT_INSTALL_DIR="${CDT_DIR_PROMPT:-/usr/local/eosio.cdt}" +} + + +# Ensures EOSIO is installed and compatible via version listed in tests/CMakeLists.txt. +function nodeos-version-check() { + INSTALLED_VERSION=$(echo $($EOSIO_INSTALL_DIR/bin/nodeos --version)) + INSTALLED_VERSION_MAJOR=$(echo $INSTALLED_VERSION | cut -f1 -d '.' | sed 's/v//g') + INSTALLED_VERSION_MINOR=$(echo $INSTALLED_VERSION | cut -f2 -d '.' | sed 's/v//g') + + if [[ -z $INSTALLED_VERSION_MAJOR || -z $INSTALLED_VERSION_MINOR ]]; then + echo "Could not determine EOSIO version. Exiting..." + exit 1; + fi + + if $(check-version-numbers $INSTALLED_VERSION_MAJOR $INSTALLED_VERSION_MINOR); then + if [[ $INSTALLED_VERSION_MAJOR -gt $EOSIO_SOFT_MAX_MAJOR ]]; then + echo "Detected EOSIO version is greater than recommended soft max: $EOSIO_SOFT_MAX_MAJOR.$EOSIO_SOFT_MAX_MINOR. Proceed with caution." + fi + if [[ $INSTALLED_VERSION_MAJOR -eq $EOSIO_SOFT_MAX_MAJOR && $INSTALLED_VERSION_MINOR -gt $EOSIO_SOFT_MAX_MINOR ]]; then + echo "Detected EOSIO version is greater than recommended soft max: $EOSIO_SOFT_MAX_MAJOR.$EOSIO_SOFT_MAX_MINOR. Proceed with caution." + fi + else + echo "Supported versions are: $EOSIO_MIN_VERSION_MAJOR.$EOSIO_MIN_VERSION_MINOR - $EOSIO_MAX_VERSION_MAJOR.$EOSIO_MAX_VERSION_MINOR" + echo "Invalid EOSIO installation. Exiting..." + exit 1; + fi +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1e78a70f6..2048afffb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required( VERSION 3.5 ) -set(EOSIO_VERSION_MIN "1.4") -set(EOSIO_VERSION_SOFT_MAX "1.4") +set(EOSIO_VERSION_MIN "2.0") +set(EOSIO_VERSION_SOFT_MAX "2.0") #set(EOSIO_VERSION_HARD_MAX "") find_package(eosio) @@ -21,13 +21,21 @@ else() # INVALID OR MISMATCH message(FATAL_ERROR "Found eosio version ${EOSIO_VERSION} but it does not satisfy version requirements: ${VERSION_MATCH_ERROR_MSG}\nPlease use eosio version ${EOSIO_VERSION_SOFT_MAX}.x") endif(VERSION_OUTPUT STREQUAL "MATCH") - -enable_testing() - configure_file(${CMAKE_SOURCE_DIR}/contracts.hpp.in ${CMAKE_BINARY_DIR}/contracts.hpp) include_directories(${CMAKE_BINARY_DIR}) - -file(GLOB UNIT_TESTS "*.cpp" "*.hpp") - -add_eosio_test( unit_test ${UNIT_TESTS} ) +### UNIT TESTING ### +include(CTest) # eliminates DartConfiguration.tcl errors at test runtime +enable_testing() +# build unit test executable +file(GLOB UNIT_TESTS "*.cpp" "*.hpp") # find all unit test suites +add_eosio_test_executable(unit_test ${UNIT_TESTS}) # build unit tests as one executable +# mark test suites for execution +foreach(TEST_SUITE ${UNIT_TESTS}) # create an independent target for each test suite + execute_process(COMMAND bash -c "grep -E 'BOOST_AUTO_TEST_SUITE\\s*[(]' ${TEST_SUITE} | grep -vE '//.*BOOST_AUTO_TEST_SUITE\\s*[(]' | cut -d ')' -f 1 | cut -d '(' -f 2" OUTPUT_VARIABLE SUITE_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) # get the test suite name from the *.cpp file + if (NOT "" STREQUAL "${SUITE_NAME}") # ignore empty lines + execute_process(COMMAND bash -c "echo ${SUITE_NAME} | sed -e 's/s$//' | sed -e 's/_test$//'" OUTPUT_VARIABLE TRIMMED_SUITE_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) # trim "_test" or "_tests" from the end of ${SUITE_NAME} + # to run unit_test with all log from blockchain displayed, put "--verbose" after "--", i.e. "unit_test -- --verbose" + add_test(NAME ${TRIMMED_SUITE_NAME}_unit_test COMMAND unit_test --run_test=${SUITE_NAME} --report_level=detailed --color_output) + endif() +endforeach(TEST_SUITE) diff --git a/tests/contracts.hpp.in b/tests/contracts.hpp.in index efe4950dc..ad6e090d8 100644 --- a/tests/contracts.hpp.in +++ b/tests/contracts.hpp.in @@ -4,29 +4,26 @@ namespace eosio { namespace testing { struct contracts { - static std::vector system_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../eosio.system/eosio.system.wasm"); } - static std::string system_wast() { return read_wast("${CMAKE_BINARY_DIR}/../eosio.system/eosio.system.wast"); } - static std::vector system_abi() { return read_abi("${CMAKE_BINARY_DIR}/../eosio.system/eosio.system.abi"); } - static std::vector token_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../eosio.token/eosio.token.wasm"); } - static std::string token_wast() { return read_wast("${CMAKE_BINARY_DIR}/../eosio.token/eosio.token.wast"); } - static std::vector token_abi() { return read_abi("${CMAKE_BINARY_DIR}/../eosio.token/eosio.token.abi"); } - static std::vector msig_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../eosio.msig/eosio.msig.wasm"); } - static std::string msig_wast() { return read_wast("${CMAKE_BINARY_DIR}/../eosio.msig/eosio.msig.wast"); } - static std::vector msig_abi() { return read_abi("${CMAKE_BINARY_DIR}/../eosio.msig/eosio.msig.abi"); } - static std::vector wrap_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../eosio.wrap/eosio.wrap.wasm"); } - static std::string wrap_wast() { return read_wast("${CMAKE_BINARY_DIR}/../eosio.wrap/eosio.wrap.wast"); } - static std::vector wrap_abi() { return read_abi("${CMAKE_BINARY_DIR}/../eosio.wrap/eosio.wrap.abi"); } - static std::vector bios_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../eosio.bios/eosio.bios.wasm"); } - static std::string bios_wast() { return read_wast("${CMAKE_BINARY_DIR}/../eosio.bios/eosio.bios.wast"); } - static std::vector bios_abi() { return read_abi("${CMAKE_BINARY_DIR}/../eosio.bios/eosio.bios.abi"); } + static std::vector system_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../contracts/eosio.system/eosio.system.wasm"); } + static std::vector system_abi() { return read_abi("${CMAKE_BINARY_DIR}/../contracts/eosio.system/eosio.system.abi"); } + static std::vector token_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../contracts/eosio.token/eosio.token.wasm"); } + static std::vector token_abi() { return read_abi("${CMAKE_BINARY_DIR}/../contracts/eosio.token/eosio.token.abi"); } + static std::vector msig_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../contracts/eosio.msig/eosio.msig.wasm"); } + static std::vector msig_abi() { return read_abi("${CMAKE_BINARY_DIR}/../contracts/eosio.msig/eosio.msig.abi"); } + static std::vector wrap_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../contracts/eosio.wrap/eosio.wrap.wasm"); } + static std::vector wrap_abi() { return read_abi("${CMAKE_BINARY_DIR}/../contracts/eosio.wrap/eosio.wrap.abi"); } + static std::vector bios_wasm() { return read_wasm("${CMAKE_BINARY_DIR}/../contracts/eosio.bios/eosio.bios.wasm"); } + static std::vector bios_abi() { return read_abi("${CMAKE_BINARY_DIR}/../contracts/eosio.bios/eosio.bios.abi"); } struct util { - static std::vector test_api_wasm() { return read_wasm("${CMAKE_SOURCE_DIR}/test_contracts/test_api.wasm"); } + static std::vector reject_all_wasm() { return read_wasm("${CMAKE_SOURCE_DIR}/test_contracts/reject_all.wasm"); } static std::vector exchange_wasm() { return read_wasm("${CMAKE_SOURCE_DIR}/test_contracts/exchange.wasm"); } - static std::vector system_wasm_old() { return read_wasm("${CMAKE_SOURCE_DIR}/test_contracts/eosio.system.old/eosio.system.wasm"); } - static std::vector system_abi_old() { return read_abi("${CMAKE_SOURCE_DIR}/test_contracts/eosio.system.old/eosio.system.abi"); } - static std::vector msig_wasm_old() { return read_wasm("${CMAKE_SOURCE_DIR}/test_contracts/eosio.msig.old/eosio.msig.wasm"); } - static std::vector msig_abi_old() { return read_abi("${CMAKE_SOURCE_DIR}/test_contracts/eosio.msig.old/eosio.msig.abi"); } + static std::vector system_wasm_v1_8() { return read_wasm("${CMAKE_SOURCE_DIR}/test_contracts/old_versions/v1.8.3/eosio.system/eosio.system.wasm"); } + static std::vector system_abi_v1_8() { return read_abi("${CMAKE_SOURCE_DIR}/test_contracts/old_versions/v1.8.3/eosio.system/eosio.system.abi"); } + static std::vector system_wasm_old() { return read_wasm("${CMAKE_SOURCE_DIR}/test_contracts/old_versions/v1.2.1/eosio.system/eosio.system.wasm"); } + static std::vector system_abi_old() { return read_abi("${CMAKE_SOURCE_DIR}/test_contracts/old_versions/v1.2.1/eosio.system/eosio.system.abi"); } + static std::vector msig_wasm_old() { return read_wasm("${CMAKE_SOURCE_DIR}/test_contracts/old_versions/v1.2.1/eosio.msig/eosio.msig.wasm"); } + static std::vector msig_abi_old() { return read_abi("${CMAKE_SOURCE_DIR}/test_contracts/old_versions/v1.2.1/eosio.msig/eosio.msig.abi"); } }; }; }} //ns eosio::testing diff --git a/tests/eosio.msig_tests.cpp b/tests/eosio.msig_tests.cpp index 39b6a5f94..89f7dbc93 100644 --- a/tests/eosio.msig_tests.cpp +++ b/tests/eosio.msig_tests.cpp @@ -36,7 +36,7 @@ class eosio_msig_tester : public tester { const auto& accnt = control->db().get( N(eosio.msig) ); abi_def abi; BOOST_REQUIRE_EQUAL(abi_serializer::to_abi(accnt.abi, abi), true); - abi_ser.set_abi(abi, abi_serializer_max_time); + abi_ser.set_abi(abi, abi_serializer::create_yield_function(abi_serializer_max_time)); } transaction_trace_ptr create_account_with_resources( account_name a, account_name creator, asset ramfunds, bool multisig, @@ -138,7 +138,7 @@ class eosio_msig_tester : public tester { action act; act.account = N(eosio.msig); act.name = name; - act.data = abi_ser.variant_to_binary( action_type_name, data, abi_serializer_max_time ); + act.data = abi_ser.variant_to_binary( action_type_name, data, abi_serializer::create_yield_function(abi_serializer_max_time) ); //std::cout << "test:\n" << fc::to_hex(act.data.data(), act.data.size()) << " size = " << act.data.size() << std::endl; return base_tester::push_action( std::move(act), auth ? uint64_t(signer) : 0 ); @@ -174,14 +174,14 @@ transaction eosio_msig_tester::reqauth( account_name from, const vectorapplied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); push_action( N(alice), N(exec), mvo() ("proposer", "alice") ("proposal_name", "first") @@ -222,7 +226,7 @@ BOOST_FIXTURE_TEST_CASE( propose_approve_execute, eosio_msig_tester ) try { BOOST_FIXTURE_TEST_CASE( propose_approve_unapprove, eosio_msig_tester ) try { - auto trx = reqauth("alice", {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); + auto trx = reqauth( N(alice), {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); push_action( N(alice), N(propose), mvo() ("proposer", "alice") @@ -256,7 +260,7 @@ BOOST_FIXTURE_TEST_CASE( propose_approve_unapprove, eosio_msig_tester ) try { BOOST_FIXTURE_TEST_CASE( propose_approve_by_two, eosio_msig_tester ) try { - auto trx = reqauth("alice", vector{ { N(alice), config::active_name }, { N(bob), config::active_name } }, abi_serializer_max_time ); + auto trx = reqauth( N(alice), vector{ { N(alice), config::active_name }, { N(bob), config::active_name } }, abi_serializer_max_time ); push_action( N(alice), N(propose), mvo() ("proposer", "alice") ("proposal_name", "first") @@ -290,7 +294,11 @@ BOOST_FIXTURE_TEST_CASE( propose_approve_by_two, eosio_msig_tester ) try { ); transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); push_action( N(alice), N(exec), mvo() ("proposer", "alice") @@ -305,7 +313,7 @@ BOOST_FIXTURE_TEST_CASE( propose_approve_by_two, eosio_msig_tester ) try { BOOST_FIXTURE_TEST_CASE( propose_with_wrong_requested_auth, eosio_msig_tester ) try { - auto trx = reqauth("alice", vector{ { N(alice), config::active_name }, { N(bob), config::active_name } }, abi_serializer_max_time ); + auto trx = reqauth( N(alice), vector{ { N(alice), config::active_name }, { N(bob), config::active_name } }, abi_serializer_max_time ); //try with not enough requested auth BOOST_REQUIRE_EXCEPTION( push_action( N(alice), N(propose), mvo() ("proposer", "alice") @@ -346,7 +354,7 @@ BOOST_FIXTURE_TEST_CASE( big_transaction, eosio_msig_tester ) try { ); transaction trx; - abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer_max_time); + abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer::create_yield_function(abi_serializer_max_time)); push_action( N(alice), N(propose), mvo() ("proposer", "alice") @@ -369,7 +377,11 @@ BOOST_FIXTURE_TEST_CASE( big_transaction, eosio_msig_tester ) try { ); transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); push_action( N(alice), N(exec), mvo() ("proposer", "alice") @@ -394,22 +406,29 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, eosio_msig_tester ) // / | \ <--- implicitly updated in onblock action // alice active bob active carol active - set_authority(N(eosio), "active", authority(1, - vector{{get_private_key("eosio", "active").get_public_key(), 1}}, - vector{{{N(eosio.prods), config::active_name}, 1}}), "owner", - { { N(eosio), "active" } }, { get_private_key( N(eosio), "active" ) }); + set_authority( + config::system_account_name, + config::active_name, + authority( 1, + vector{{get_private_key(config::system_account_name, "active").get_public_key(), 1}}, + vector{{{N(eosio.prods), config::active_name}, 1}} + ), + config::owner_name, + {{config::system_account_name, config::active_name}}, + {get_private_key(config::system_account_name, "active")} + ); set_producers( {N(alice),N(bob),N(carol)} ); produce_blocks(50); - create_accounts( { N(eosio.token) } ); + create_accounts( { N(eosio.token), N(eosio.rex) } ); set_code( N(eosio.token), contracts::token_wasm() ); set_abi( N(eosio.token), contracts::token_abi().data() ); create_currency( N(eosio.token), config::system_account_name, core_sym::from_string("10000000000.0000") ); issue(config::system_account_name, core_sym::from_string("1000000000.0000")); BOOST_REQUIRE_EQUAL( core_sym::from_string("1000000000.0000"), - get_balance("eosio") + get_balance("eosio.ramfee") + get_balance("eosio.stake") + get_balance("eosio.ram") ); + get_balance(config::system_account_name) + get_balance(N(eosio.ramfee)) + get_balance(N(eosio.stake)) + get_balance(N(eosio.ram)) ); set_code( config::system_account_name, contracts::system_wasm() ); set_abi( config::system_account_name, contracts::system_abi().data() ); @@ -424,14 +443,14 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, eosio_msig_tester ) create_account_with_resources( N(carol1111111), N(eosio), core_sym::from_string("1.0000"), false ); BOOST_REQUIRE_EQUAL( core_sym::from_string("1000000000.0000"), - get_balance("eosio") + get_balance("eosio.ramfee") + get_balance("eosio.stake") + get_balance("eosio.ram") ); + get_balance(config::system_account_name) + get_balance(N(eosio.ramfee)) + get_balance(N(eosio.stake)) + get_balance(N(eosio.ram)) ); vector perm = { { N(alice), config::active_name }, { N(bob), config::active_name }, {N(carol), config::active_name} }; vector action_perm = {{N(eosio), config::active_name}}; - auto wasm = contracts::util::test_api_wasm(); + auto wasm = contracts::util::reject_all_wasm(); variant pretty_trx = fc::mutable_variant_object() ("expiration", "2020-01-01T00:30") @@ -455,7 +474,7 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, eosio_msig_tester ) ); transaction trx; - abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer_max_time); + abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer::create_yield_function(abi_serializer_max_time)); // propose action push_action( N(alice), N(propose), mvo() @@ -485,7 +504,11 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, eosio_msig_tester ) ); // execute by alice to replace the eosio system contract transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); push_action( N(alice), N(exec), mvo() ("proposer", "alice") @@ -497,10 +520,10 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, eosio_msig_tester ) BOOST_REQUIRE_EQUAL( 1, trace->action_traces.size() ); BOOST_REQUIRE_EQUAL( transaction_receipt::executed, trace->receipt->status ); - // can't create account because system contract was replace by the test_api contract + // can't create account because system contract was replaced by the reject_all contract BOOST_REQUIRE_EXCEPTION( create_account_with_resources( N(alice1111112), N(eosio), core_sym::from_string("1.0000"), false ), - eosio_assert_message_exception, eosio_assert_message_is("Unknown Test") + eosio_assert_message_exception, eosio_assert_message_is("rejecting all actions") ); } FC_LOG_AND_RETHROW() @@ -508,22 +531,29 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, eosio_msig_tester ) BOOST_FIXTURE_TEST_CASE( update_system_contract_major_approve, eosio_msig_tester ) try { // set up the link between (eosio active) and (eosio.prods active) - set_authority(N(eosio), "active", authority(1, - vector{{get_private_key("eosio", "active").get_public_key(), 1}}, - vector{{{N(eosio.prods), config::active_name}, 1}}), "owner", - { { N(eosio), "active" } }, { get_private_key( N(eosio), "active" ) }); + set_authority( + config::system_account_name, + config::active_name, + authority( 1, + vector{{get_private_key(config::system_account_name, "active").get_public_key(), 1}}, + vector{{{N(eosio.prods), config::active_name}, 1}} + ), + config::owner_name, + {{config::system_account_name, config::active_name}}, + {get_private_key(config::system_account_name, "active")} + ); create_accounts( { N(apple) } ); set_producers( {N(alice),N(bob),N(carol), N(apple)} ); produce_blocks(50); - create_accounts( { N(eosio.token) } ); + create_accounts( { N(eosio.token), N(eosio.rex) } ); set_code( N(eosio.token), contracts::token_wasm() ); set_abi( N(eosio.token), contracts::token_abi().data() ); create_currency( N(eosio.token), config::system_account_name, core_sym::from_string("10000000000.0000") ); issue(config::system_account_name, core_sym::from_string("1000000000.0000")); - BOOST_REQUIRE_EQUAL( core_sym::from_string("1000000000.0000"), get_balance( "eosio" ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("1000000000.0000"), get_balance( config::system_account_name ) ); set_code( config::system_account_name, contracts::system_wasm() ); set_abi( config::system_account_name, contracts::system_abi().data() ); @@ -539,14 +569,14 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_major_approve, eosio_msig_tester create_account_with_resources( N(carol1111111), N(eosio), core_sym::from_string("1.0000"), false ); BOOST_REQUIRE_EQUAL( core_sym::from_string("1000000000.0000"), - get_balance("eosio") + get_balance("eosio.ramfee") + get_balance("eosio.stake") + get_balance("eosio.ram") ); + get_balance(config::system_account_name) + get_balance(N(eosio.ramfee)) + get_balance(N(eosio.stake)) + get_balance(N(eosio.ram)) ); vector perm = { { N(alice), config::active_name }, { N(bob), config::active_name }, {N(carol), config::active_name}, {N(apple), config::active_name}}; vector action_perm = {{N(eosio), config::active_name}}; - auto wasm = contracts::util::test_api_wasm(); + auto wasm = contracts::util::reject_all_wasm(); variant pretty_trx = fc::mutable_variant_object() ("expiration", "2020-01-01T00:30") @@ -570,7 +600,7 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_major_approve, eosio_msig_tester ); transaction trx; - abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer_max_time); + abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer::create_yield_function(abi_serializer_max_time)); // propose action push_action( N(alice), N(propose), mvo() @@ -611,7 +641,11 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_major_approve, eosio_msig_tester ); // execute by alice to replace the eosio system contract transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); // execute by another producer different from proposer push_action( N(apple), N(exec), mvo() @@ -624,16 +658,16 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_major_approve, eosio_msig_tester BOOST_REQUIRE_EQUAL( 1, trace->action_traces.size() ); BOOST_REQUIRE_EQUAL( transaction_receipt::executed, trace->receipt->status ); - // can't create account because system contract was replace by the test_api contract + // can't create account because system contract was replaced by the reject_all contract BOOST_REQUIRE_EXCEPTION( create_account_with_resources( N(alice1111112), N(eosio), core_sym::from_string("1.0000"), false ), - eosio_assert_message_exception, eosio_assert_message_is("Unknown Test") + eosio_assert_message_exception, eosio_assert_message_is("rejecting all actions") ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( propose_approve_invalidate, eosio_msig_tester ) try { - auto trx = reqauth("alice", {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); + auto trx = reqauth( N(alice), {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); push_action( N(alice), N(propose), mvo() ("proposer", "alice") @@ -676,7 +710,7 @@ BOOST_FIXTURE_TEST_CASE( propose_approve_invalidate, eosio_msig_tester ) try { } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( propose_invalidate_approve, eosio_msig_tester ) try { - auto trx = reqauth("alice", {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); + auto trx = reqauth( N(alice), {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); push_action( N(alice), N(propose), mvo() ("proposer", "alice") @@ -709,7 +743,11 @@ BOOST_FIXTURE_TEST_CASE( propose_invalidate_approve, eosio_msig_tester ) try { //successfully execute transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); push_action( N(bob), N(exec), mvo() ("proposer", "alice") @@ -728,7 +766,7 @@ BOOST_FIXTURE_TEST_CASE( approve_execute_old, eosio_msig_tester ) try { produce_blocks(); //propose with old version of eosio.msig - auto trx = reqauth("alice", {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); + auto trx = reqauth( N(alice), {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); push_action( N(alice), N(propose), mvo() ("proposer", "alice") ("proposal_name", "first") @@ -748,7 +786,12 @@ BOOST_FIXTURE_TEST_CASE( approve_execute_old, eosio_msig_tester ) try { ); transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); + push_action( N(alice), N(exec), mvo() ("proposer", "alice") ("proposal_name", "first") @@ -768,7 +811,7 @@ BOOST_FIXTURE_TEST_CASE( approve_unapprove_old, eosio_msig_tester ) try { produce_blocks(); //propose with old version of eosio.msig - auto trx = reqauth("alice", {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); + auto trx = reqauth( N(alice), {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); push_action( N(alice), N(propose), mvo() ("proposer", "alice") ("proposal_name", "first") @@ -810,7 +853,7 @@ BOOST_FIXTURE_TEST_CASE( approve_by_two_old, eosio_msig_tester ) try { set_abi( N(eosio.msig), contracts::util::msig_abi_old().data() ); produce_blocks(); - auto trx = reqauth("alice", vector{ { N(alice), config::active_name }, { N(bob), config::active_name } }, abi_serializer_max_time ); + auto trx = reqauth( N(alice), vector{ { N(alice), config::active_name }, { N(bob), config::active_name } }, abi_serializer_max_time ); push_action( N(alice), N(propose), mvo() ("proposer", "alice") ("proposal_name", "first") @@ -847,7 +890,11 @@ BOOST_FIXTURE_TEST_CASE( approve_by_two_old, eosio_msig_tester ) try { ); transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); push_action( N(alice), N(exec), mvo() ("proposer", "alice") @@ -862,7 +909,7 @@ BOOST_FIXTURE_TEST_CASE( approve_by_two_old, eosio_msig_tester ) try { } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( approve_with_hash, eosio_msig_tester ) try { - auto trx = reqauth("alice", {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); + auto trx = reqauth( N(alice), {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); auto trx_hash = fc::sha256::hash( trx ); auto not_trx_hash = fc::sha256::hash( trx_hash ); @@ -893,7 +940,12 @@ BOOST_FIXTURE_TEST_CASE( approve_with_hash, eosio_msig_tester ) try { ); transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); + push_action( N(alice), N(exec), mvo() ("proposer", "alice") ("proposal_name", "first") @@ -906,7 +958,7 @@ BOOST_FIXTURE_TEST_CASE( approve_with_hash, eosio_msig_tester ) try { } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( switch_proposal_and_fail_approve_with_hash, eosio_msig_tester ) try { - auto trx1 = reqauth("alice", {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); + auto trx1 = reqauth( N(alice), {permission_level{N(alice), config::active_name}}, abi_serializer_max_time ); auto trx1_hash = fc::sha256::hash( trx1 ); push_action( N(alice), N(propose), mvo() @@ -916,7 +968,7 @@ BOOST_FIXTURE_TEST_CASE( switch_proposal_and_fail_approve_with_hash, eosio_msig_ ("requested", vector{{ N(alice), config::active_name }}) ); - auto trx2 = reqauth("alice", + auto trx2 = reqauth( N(alice), { permission_level{N(alice), config::active_name}, permission_level{N(alice), config::owner_name} }, abi_serializer_max_time ); diff --git a/tests/eosio.powerup_tests.cpp b/tests/eosio.powerup_tests.cpp new file mode 100644 index 000000000..3c8f43e0f --- /dev/null +++ b/tests/eosio.powerup_tests.cpp @@ -0,0 +1,858 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "eosio.system_tester.hpp" + +inline constexpr int64_t powerup_frac = 1'000'000'000'000'000ll; // 1.0 = 10^15 +inline constexpr int64_t stake_weight = 100'000'000'0000ll; // 10^12 + +struct powerup_config_resource { + fc::optional current_weight_ratio = {}; + fc::optional target_weight_ratio = {}; + fc::optional assumed_stake_weight = {}; + fc::optional target_timestamp = {}; + fc::optional exponent = {}; + fc::optional decay_secs = {}; + fc::optional min_price = {}; + fc::optional max_price = {}; +}; +FC_REFLECT(powerup_config_resource, // + (current_weight_ratio)(target_weight_ratio)(assumed_stake_weight)(target_timestamp) // + (exponent)(decay_secs)(min_price)(max_price)) + +struct powerup_config { + powerup_config_resource net = {}; + powerup_config_resource cpu = {}; + fc::optional powerup_days = {}; + fc::optional min_powerup_fee = {}; +}; +FC_REFLECT(powerup_config, (net)(cpu)(powerup_days)(min_powerup_fee)) + +struct powerup_state_resource { + uint8_t version; + int64_t weight; + int64_t weight_ratio; + int64_t assumed_stake_weight; + int64_t initial_weight_ratio; + int64_t target_weight_ratio; + time_point_sec initial_timestamp; + time_point_sec target_timestamp; + double exponent; + uint32_t decay_secs; + asset min_price; + asset max_price; + int64_t utilization; + int64_t adjusted_utilization; + time_point_sec utilization_timestamp; +}; +FC_REFLECT(powerup_state_resource, // + (version)(weight)(weight_ratio)(assumed_stake_weight)(initial_weight_ratio)(target_weight_ratio) // + (initial_timestamp)(target_timestamp)(exponent)(decay_secs)(min_price)(max_price)(utilization) // + (adjusted_utilization)(utilization_timestamp)) + +struct powerup_state { + uint8_t version; + powerup_state_resource net; + powerup_state_resource cpu; + uint32_t powerup_days; + asset min_powerup_fee; +}; +FC_REFLECT(powerup_state, (version)(net)(cpu)(powerup_days)(min_powerup_fee)) + +using namespace eosio_system; + +struct powerup_tester : eosio_system_tester { + + powerup_tester() { create_accounts_with_resources({ N(eosio.reserv) }); } + + void start_rex() { + create_account_with_resources(N(rexholder111), config::system_account_name, core_sym::from_string("1.0000"), + false); + transfer(config::system_account_name, N(rexholder111), core_sym::from_string("1001.0000")); + BOOST_REQUIRE_EQUAL("", stake(N(rexholder111), N(rexholder111), core_sym::from_string("500.0000"), + core_sym::from_string("500.0000"))); + create_account_with_resources(N(proxyaccount), config::system_account_name, core_sym::from_string("1.0000"), + false, core_sym::from_string("500.0000"), core_sym::from_string("500.0000")); + BOOST_REQUIRE_EQUAL("", + push_action(N(proxyaccount), N(regproxy), mvo()("proxy", "proxyaccount")("isproxy", true))); + BOOST_REQUIRE_EQUAL("", vote(N(rexholder111), {}, N(proxyaccount))); + BOOST_REQUIRE_EQUAL("", push_action(N(rexholder111), N(deposit), + mvo()("owner", "rexholder111")("amount", asset::from_string("1.0000 TST")))); + BOOST_REQUIRE_EQUAL("", push_action(N(rexholder111), N(buyrex), + mvo()("from", "rexholder111")("amount", asset::from_string("1.0000 TST")))); + } + + template + powerup_config make_config(F f) { + powerup_config config; + + config.net.current_weight_ratio = powerup_frac; + config.net.target_weight_ratio = powerup_frac / 100; + config.net.assumed_stake_weight = stake_weight; + config.net.target_timestamp = control->head_block_time() + fc::days(100); + config.net.exponent = 2; + config.net.decay_secs = fc::days(1).to_seconds(); + config.net.min_price = asset::from_string("0.0000 TST"); + config.net.max_price = asset::from_string("1000000.0000 TST"); + + config.cpu.current_weight_ratio = powerup_frac; + config.cpu.target_weight_ratio = powerup_frac / 100; + config.cpu.assumed_stake_weight = stake_weight; + config.cpu.target_timestamp = control->head_block_time() + fc::days(100); + config.cpu.exponent = 2; + config.cpu.decay_secs = fc::days(1).to_seconds(); + config.cpu.min_price = asset::from_string("0.0000 TST"); + config.cpu.max_price = asset::from_string("1000000.0000 TST"); + + config.powerup_days = 30; + config.min_powerup_fee = asset::from_string("1.0000 TST"); + + f(config); + return config; + } + + powerup_config make_config() { + return make_config([](auto&) {}); + } + + template + powerup_config make_default_config(F f) { + powerup_config config; + f(config); + return config; + } + + action_result configbw(const powerup_config& config) { + // Verbose solution needed to work around bug in abi_serializer that fails if optional values aren't explicitly + // specified with a null value. + + auto optional_to_variant = []( const auto& v ) -> fc::variant { + return (!v ? fc::variant() : fc::variant(*v)); + }; + + auto resource_conf_vo = [&optional_to_variant](const powerup_config_resource& c ) { + return mvo("current_weight_ratio", optional_to_variant(c.current_weight_ratio)) + ("target_weight_ratio", optional_to_variant(c.target_weight_ratio)) + ("assumed_stake_weight", optional_to_variant(c.assumed_stake_weight)) + ("target_timestamp", optional_to_variant(c.target_timestamp)) + ("exponent", optional_to_variant(c.exponent)) + ("decay_secs", optional_to_variant(c.decay_secs)) + ("min_price", optional_to_variant(c.min_price)) + ("max_price", optional_to_variant(c.max_price)) + ; + }; + + auto conf = mvo("net", resource_conf_vo(config.net)) + ("cpu", resource_conf_vo(config.cpu)) + ("powerup_days", optional_to_variant(config.powerup_days)) + ("min_powerup_fee", optional_to_variant(config.min_powerup_fee)) + ; + + //idump((fc::json::to_pretty_string(conf))); + return push_action(config::system_account_name, N(cfgpowerup), mvo()("args", std::move(conf))); + + // If abi_serializer worked correctly, the following is all that would be needed: + //return push_action(config::system_account_name, N(cfgpowerup), mvo()("args", config)); + } + + action_result powerupexec(name user, uint16_t max) { + return push_action(user, N(powerupexec), mvo()("user", user)("max", max)); + } + + action_result powerup(const name& payer, const name& receiver, uint32_t days, int64_t net_frac, int64_t cpu_frac, + const asset& max_payment) { + return push_action(payer, N(powerup), + mvo()("payer", payer)("receiver", receiver)("days", days)("net_frac", net_frac)( + "cpu_frac", cpu_frac)("max_payment", max_payment)); + } + + powerup_state get_state() { + vector data = get_row_by_account(config::system_account_name, {}, N(powup.state), N(powup.state)); + return fc::raw::unpack(data); + } + + struct account_info { + int64_t ram = 0; + int64_t net = 0; + int64_t cpu = 0; + asset liquid; + }; + + account_info get_account_info(account_name acc) { + account_info info; + control->get_resource_limits_manager().get_account_limits(acc, info.ram, info.net, info.cpu); + info.liquid = get_balance(acc); + return info; + }; + + void check_powerup(const name& payer, const name& receiver, uint32_t days, int64_t net_frac, int64_t cpu_frac, + const asset& expected_fee, int64_t expected_net, int64_t expected_cpu) { + auto before_payer = get_account_info(payer); + auto before_receiver = get_account_info(receiver); + auto before_reserve = get_account_info(N(eosio.reserv)); + auto before_state = get_state(); + BOOST_REQUIRE_EQUAL("", powerup(payer, receiver, days, net_frac, cpu_frac, expected_fee)); + auto after_payer = get_account_info(payer); + auto after_receiver = get_account_info(receiver); + auto after_reserve = get_account_info(N(eosio.reserv)); + auto after_state = get_state(); + + if (false) { + ilog("before_state.net.assumed_stake_weight: ${x}", ("x", before_state.net.assumed_stake_weight)); + ilog("before_state.net.weight_ratio: ${x}", + ("x", before_state.net.weight_ratio / double(powerup_frac))); + ilog("before_state.net.assumed_stake_weight: ${x}", ("x", before_state.net.assumed_stake_weight)); + ilog("before_state.net.weight: ${x}", ("x", before_state.net.weight)); + + ilog("before_receiver.net: ${x}", ("x", before_receiver.net)); + ilog("after_receiver.net: ${x}", ("x", after_receiver.net)); + ilog("after_receiver.net - before_receiver.net: ${x}", ("x", after_receiver.net - before_receiver.net)); + ilog("expected_net: ${x}", ("x", expected_net)); + ilog("before_payer.liquid - after_payer.liquid: ${x}", ("x", before_payer.liquid - after_payer.liquid)); + ilog("expected_fee: ${x}", ("x", expected_fee)); + + ilog("before_reserve.net: ${x}", ("x", before_reserve.net)); + ilog("after_reserve.net: ${x}", ("x", after_reserve.net)); + ilog("before_reserve.cpu: ${x}", ("x", before_reserve.cpu)); + ilog("after_reserve.cpu: ${x}", ("x", after_reserve.cpu)); + } + + if (payer != receiver) { + BOOST_REQUIRE_EQUAL(before_payer.ram, after_payer.ram); + BOOST_REQUIRE_EQUAL(before_payer.net, after_payer.net); + BOOST_REQUIRE_EQUAL(before_payer.cpu, after_payer.cpu); + BOOST_REQUIRE_EQUAL(before_receiver.liquid, after_receiver.liquid); + } + BOOST_REQUIRE_EQUAL(before_receiver.ram, after_receiver.ram); + BOOST_REQUIRE_EQUAL(after_receiver.net - before_receiver.net, expected_net); + BOOST_REQUIRE_EQUAL(after_receiver.cpu - before_receiver.cpu, expected_cpu); + BOOST_REQUIRE_EQUAL(before_payer.liquid - after_payer.liquid, expected_fee); + + BOOST_REQUIRE_EQUAL(before_reserve.net - after_reserve.net, expected_net); + BOOST_REQUIRE_EQUAL(before_reserve.cpu - after_reserve.cpu, expected_cpu); + BOOST_REQUIRE_EQUAL(after_state.net.utilization - before_state.net.utilization, expected_net); + BOOST_REQUIRE_EQUAL(after_state.cpu.utilization - before_state.cpu.utilization, expected_cpu); + } +}; + +template +bool near(A a, B b, D delta) { + if (abs(a - b) <= delta) + return true; + elog("near: ${a} ${b}", ("a", a)("b", b)); + return false; +} + +BOOST_AUTO_TEST_SUITE(eosio_system_powerup_tests) + +BOOST_FIXTURE_TEST_CASE(config_tests, powerup_tester) try { + BOOST_REQUIRE_EQUAL("missing authority of eosio", + push_action(N(alice1111111), N(cfgpowerup), mvo()("args", make_config()))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("powerup hasn't been initialized"), powerupexec(N(alice1111111), 10)); + + BOOST_REQUIRE_EQUAL(wasm_assert_msg("powerup_days must be > 0"), + configbw(make_config([&](auto& c) { c.powerup_days = 0; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_powerup_fee doesn't match core symbol"), configbw(make_config([&](auto& c) { + c.min_powerup_fee = asset::from_string("1000000.000 TST"); + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_powerup_fee does not have a default value"), + configbw(make_config([&](auto& c) { c.min_powerup_fee = {}; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_powerup_fee must be positive"), + configbw(make_config([&](auto& c) { c.min_powerup_fee = asset::from_string("0.0000 TST"); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_powerup_fee must be positive"), + configbw(make_config([&](auto& c) { c.min_powerup_fee = asset::from_string("-1.0000 TST"); }))); + + // net assertions + BOOST_REQUIRE_EQUAL(wasm_assert_msg("current_weight_ratio is too large"), + configbw(make_config([](auto& c) { c.net.current_weight_ratio = powerup_frac + 1; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("assumed_stake_weight/target_weight_ratio is too large"), + configbw(make_config([](auto& c) { + c.net.assumed_stake_weight = 100000; + c.net.target_weight_ratio = 10; + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("weight can't grow over time"), + configbw(make_config([](auto& c) { c.net.target_weight_ratio = powerup_frac + 1; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("assumed_stake_weight does not have a default value"), + configbw(make_config([](auto& c) { c.net.assumed_stake_weight = {}; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("assumed_stake_weight must be at least 1; a much larger value is recommended"), + configbw(make_config([](auto& c) { c.net.assumed_stake_weight = 0; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("target_timestamp does not have a default value"), + configbw(make_config([&](auto& c) { c.net.target_timestamp = {}; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("target_timestamp must be in the future"), + configbw(make_config([&](auto& c) { c.net.target_timestamp = control->head_block_time(); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("target_timestamp must be in the future"), configbw(make_config([&](auto& c) { + c.net.target_timestamp = control->head_block_time() - fc::seconds(1); + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("exponent must be >= 1"), + configbw(make_config([&](auto& c) { c.net.exponent = .999; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("decay_secs must be >= 1"), + configbw(make_config([&](auto& c) { c.net.decay_secs = 0; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("max_price does not have a default value"), + configbw(make_config([&](auto& c) { c.net.max_price = {}; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("max_price doesn't match core symbol"), configbw(make_config([&](auto& c) { + c.net.max_price = asset::from_string("1000000.000 TST"); + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("max_price must be positive"), + configbw(make_config([&](auto& c) { c.net.max_price = asset::from_string("0.0000 TST"); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("max_price must be positive"), + configbw(make_config([&](auto& c) { c.net.max_price = asset::from_string("-1.0000 TST"); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_price doesn't match core symbol"), configbw(make_config([&](auto& c) { + c.net.min_price = asset::from_string("1000000.000 TST"); + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_price must be non-negative"), + configbw(make_config([&](auto& c) { c.net.min_price = asset::from_string("-1.0000 TST"); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_price cannot exceed max_price"), + configbw(make_config([&](auto& c) { + c.net.min_price = asset::from_string("3.0000 TST"); + c.net.max_price = asset::from_string("2.0000 TST"); + }))); + + // cpu assertions + BOOST_REQUIRE_EQUAL(wasm_assert_msg("current_weight_ratio is too large"), + configbw(make_config([](auto& c) { c.cpu.current_weight_ratio = powerup_frac + 1; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("assumed_stake_weight/target_weight_ratio is too large"), + configbw(make_config([](auto& c) { + c.cpu.assumed_stake_weight = 100000; + c.cpu.target_weight_ratio = 10; + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("weight can't grow over time"), + configbw(make_config([](auto& c) { c.cpu.target_weight_ratio = powerup_frac + 1; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("assumed_stake_weight does not have a default value"), + configbw(make_config([](auto& c) { c.cpu.assumed_stake_weight = {}; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("assumed_stake_weight must be at least 1; a much larger value is recommended"), + configbw(make_config([](auto& c) { c.cpu.assumed_stake_weight = 0; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("target_timestamp does not have a default value"), + configbw(make_config([&](auto& c) { c.cpu.target_timestamp = {}; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("target_timestamp must be in the future"), + configbw(make_config([&](auto& c) { c.cpu.target_timestamp = control->head_block_time(); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("target_timestamp must be in the future"), configbw(make_config([&](auto& c) { + c.cpu.target_timestamp = control->head_block_time() - fc::seconds(1); + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("exponent must be >= 1"), + configbw(make_config([&](auto& c) { c.cpu.exponent = .999; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("decay_secs must be >= 1"), + configbw(make_config([&](auto& c) { c.cpu.decay_secs = 0; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("max_price does not have a default value"), + configbw(make_config([&](auto& c) { c.cpu.max_price = {}; }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("max_price doesn't match core symbol"), configbw(make_config([&](auto& c) { + c.cpu.max_price = asset::from_string("1000000.000 TST"); + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("max_price must be positive"), + configbw(make_config([&](auto& c) { c.cpu.max_price = asset::from_string("0.0000 TST"); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("max_price must be positive"), + configbw(make_config([&](auto& c) { c.cpu.max_price = asset::from_string("-1.0000 TST"); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_price doesn't match core symbol"), configbw(make_config([&](auto& c) { + c.cpu.min_price = asset::from_string("1000000.000 TST"); + }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_price must be non-negative"), + configbw(make_config([&](auto& c) { c.cpu.min_price = asset::from_string("-1.0000 TST"); }))); + BOOST_REQUIRE_EQUAL(wasm_assert_msg("min_price cannot exceed max_price"), + configbw(make_config([&](auto& c) { + c.cpu.min_price = asset::from_string("3.0000 TST"); + c.cpu.max_price = asset::from_string("2.0000 TST"); + }))); +} // config_tests +FC_LOG_AND_RETHROW() + +BOOST_FIXTURE_TEST_CASE(weight_tests, powerup_tester) try { + produce_block(); + + auto net_start = (powerup_frac * 11) / 100; + auto net_target = (powerup_frac * 1) / 100; + auto cpu_start = (powerup_frac * 11) / 1000; + auto cpu_target = (powerup_frac * 1) / 1000; + + BOOST_REQUIRE_EQUAL("", configbw(make_config([&](powerup_config& config) { + config.net.current_weight_ratio = net_start; + config.net.target_weight_ratio = net_target; + config.net.assumed_stake_weight = stake_weight; + config.net.target_timestamp = control->head_block_time() + fc::days(10); + + config.cpu.current_weight_ratio = cpu_start; + config.cpu.target_weight_ratio = cpu_target; + config.cpu.assumed_stake_weight = stake_weight; + config.cpu.target_timestamp = control->head_block_time() + fc::days(20); + }))); + + int64_t net; + int64_t cpu; + + auto check_weight = [&] { + auto state = get_state(); + BOOST_REQUIRE(near( // + state.net.weight_ratio, // + int64_t(state.net.assumed_stake_weight * eosio::chain::int128_t(powerup_frac) / + (state.net.weight + state.net.assumed_stake_weight)), + 10)); + }; + + for (int i = 0; i <= 6; ++i) { + if (i == 2) { + // Leaves config as-is, but may introduce slight rounding + produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", configbw({})); + } else if (i) { + produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", powerupexec(config::system_account_name, 10)); + } + net = net_start + i * (net_target - net_start) / 10; + cpu = cpu_start + i * (cpu_target - cpu_start) / 20; + BOOST_REQUIRE(near(get_state().net.weight_ratio, net, 1)); + BOOST_REQUIRE(near(get_state().cpu.weight_ratio, cpu, 1)); + check_weight(); + } + + // Extend transition time + { + int i = 7; + produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", configbw(make_default_config([&](powerup_config& config) { + config.net.target_timestamp = control->head_block_time() + fc::days(30); + config.cpu.target_timestamp = control->head_block_time() + fc::days(40); + }))); + net_start = net = net_start + i * (net_target - net_start) / 10; + cpu_start = cpu = cpu_start + i * (cpu_target - cpu_start) / 20; + BOOST_REQUIRE(near(get_state().net.weight_ratio, net, 1)); + BOOST_REQUIRE(near(get_state().cpu.weight_ratio, cpu, 1)); + check_weight(); + } + + for (int i = 0; i <= 5; ++i) { + if (i) { + produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", powerupexec(config::system_account_name, 10)); + } + net = net_start + i * (net_target - net_start) / 30; + cpu = cpu_start + i * (cpu_target - cpu_start) / 40; + BOOST_REQUIRE(near(get_state().net.weight_ratio, net, 1)); + BOOST_REQUIRE(near(get_state().cpu.weight_ratio, cpu, 1)); + check_weight(); + } + + // Change target, keep existing transition time + { + int i = 6; + produce_block(fc::days(1) - fc::milliseconds(500)); + auto new_net_target = net_target / 10; + auto new_cpu_target = cpu_target / 20; + BOOST_REQUIRE_EQUAL("", configbw(make_default_config([&](powerup_config& config) { + config.net.target_weight_ratio = new_net_target; + config.cpu.target_weight_ratio = new_cpu_target; + }))); + net_start = net = net_start + i * (net_target - net_start) / 30; + cpu_start = cpu = cpu_start + i * (cpu_target - cpu_start) / 40; + net_target = new_net_target; + cpu_target = new_cpu_target; + BOOST_REQUIRE(near(get_state().net.weight_ratio, net, 1)); + BOOST_REQUIRE(near(get_state().cpu.weight_ratio, cpu, 1)); + check_weight(); + } + + for (int i = 0; i <= 10; ++i) { + if (i) { + produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", powerupexec(config::system_account_name, 10)); + } + net = net_start + i * (net_target - net_start) / (30 - 6); + cpu = cpu_start + i * (cpu_target - cpu_start) / (40 - 6); + BOOST_REQUIRE(near(get_state().net.weight_ratio, net, 1)); + BOOST_REQUIRE(near(get_state().cpu.weight_ratio, cpu, 1)); + check_weight(); + } + + // Move transition time to immediate future + { + produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", configbw(make_default_config([&](powerup_config& config) { + config.net.target_timestamp = control->head_block_time() + fc::milliseconds(1000); + config.cpu.target_timestamp = control->head_block_time() + fc::milliseconds(1000); + }))); + produce_blocks(2); + } + + // Verify targets hold as time advances + for (int i = 0; i <= 10; ++i) { + BOOST_REQUIRE_EQUAL("", powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE(near(get_state().net.weight_ratio, net_target, 1)); + BOOST_REQUIRE(near(get_state().cpu.weight_ratio, cpu_target, 1)); + check_weight(); + produce_block(fc::days(1)); + } +} // weight_tests +FC_LOG_AND_RETHROW() + +BOOST_AUTO_TEST_CASE(rent_tests) try { + { + powerup_tester t; + t.produce_block(); + + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("powerup hasn't been initialized"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac / 4, powerup_frac / 8, + asset::from_string("1.000 TST"))); + + BOOST_REQUIRE_EQUAL("", t.configbw(t.make_config([&](auto& config) { + config.net.current_weight_ratio = powerup_frac; + config.net.target_weight_ratio = powerup_frac; + config.net.assumed_stake_weight = stake_weight; + config.net.exponent = 1; + config.net.min_price = asset::from_string("1000000.0000 TST"); + config.net.max_price = asset::from_string("1000000.0000 TST"); + + config.cpu.current_weight_ratio = powerup_frac; + config.cpu.target_weight_ratio = powerup_frac; + config.cpu.assumed_stake_weight = stake_weight; + config.cpu.exponent = 1; + config.cpu.min_price = asset::from_string("1000000.0000 TST"); + config.cpu.max_price = asset::from_string("1000000.0000 TST"); + + config.powerup_days = 30; + config.min_powerup_fee = asset::from_string("1.0000 TST"); + }))); + + BOOST_REQUIRE_EQUAL( + t.wasm_assert_msg("max_payment doesn't match core symbol"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac, powerup_frac, asset::from_string("1.000 TST"))); + BOOST_REQUIRE_EQUAL( + t.wasm_assert_msg("market doesn't have resources available"), // + t.powerup(N(bob111111111), N(alice1111111), 30, 0, powerup_frac, asset::from_string("1.0000 TST"))); + BOOST_REQUIRE_EQUAL( + t.wasm_assert_msg("market doesn't have resources available"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac, 0, asset::from_string("1.0000 TST"))); + + BOOST_REQUIRE_EQUAL("", t.configbw(t.make_default_config([&](auto& config) { + // weight = stake_weight + config.net.current_weight_ratio = powerup_frac/2; + config.net.target_weight_ratio = powerup_frac/2; + + // weight = stake_weight + config.cpu.current_weight_ratio = powerup_frac/2; + config.cpu.target_weight_ratio = powerup_frac/2; + }))); + + auto net_weight = stake_weight; + auto cpu_weight = stake_weight; + + t.start_rex(); + t.create_account_with_resources(N(aaaaaaaaaaaa), config::system_account_name, core_sym::from_string("1.0000"), + false, core_sym::from_string("500.0000"), core_sym::from_string("500.0000")); + + // 10%, 20% + // (.1) * 1000000.0000 = 100000.0000 + // (.2) * 1000000.0000 = 200000.0000 + // total = 300000.0000 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("300000.0000")); + t.check_powerup(N(aaaaaaaaaaaa), N(aaaaaaaaaaaa), 30, powerup_frac * .1, powerup_frac * .2, + asset::from_string("300000.0000 TST"), net_weight * .1, cpu_weight * .2); + + // Start decay + t.produce_block(fc::days(30) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE(near(t.get_state().net.adjusted_utilization, .1 * net_weight, 0)); + BOOST_REQUIRE(near(t.get_state().cpu.adjusted_utilization, .2 * cpu_weight, 0)); + + // 2 days of decay from (10%, 20%) to (1.35%, 2.71%) + t.produce_block(fc::days(2) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE(near(t.get_state().net.adjusted_utilization, int64_t(.1 * net_weight * exp(-2)), + int64_t(.1 * net_weight * exp(-2)) / 1000)); + BOOST_REQUIRE(near(t.get_state().cpu.adjusted_utilization, int64_t(.2 * cpu_weight * exp(-2)), + int64_t(.2 * cpu_weight * exp(-2)) / 1000)); + + // 2%, 2% + // (0.0135 + 0.02 - 0.0135) * 1000000.0000 = 20000.0000 + // (.02) * 1000000.0000 = 20000.0000 + // total = 40000.0000 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("40000.0001")); + t.check_powerup(N(aaaaaaaaaaaa), N(aaaaaaaaaaaa), 30, powerup_frac * .02, powerup_frac * .02, + asset::from_string("40000.0001 TST"), net_weight * .02, cpu_weight * .02); + } + + auto init = [](auto& t, bool rex) { + t.produce_block(); + BOOST_REQUIRE_EQUAL("", t.configbw(t.make_config([&](auto& config) { + // weight = stake_weight * 3 + config.net.current_weight_ratio = powerup_frac / 4; + config.net.target_weight_ratio = powerup_frac / 4; + config.net.assumed_stake_weight = stake_weight; + config.net.exponent = 2; + config.net.max_price = asset::from_string("2000000.0000 TST"); + + // weight = stake_weight * 4 / 2 + config.cpu.current_weight_ratio = powerup_frac / 5; + config.cpu.target_weight_ratio = powerup_frac / 5; + config.cpu.assumed_stake_weight = stake_weight / 2; + config.cpu.exponent = 3; + config.cpu.max_price = asset::from_string("6000000.0000 TST"); + + config.powerup_days = 30; + config.min_powerup_fee = asset::from_string("1.0000 TST"); + }))); + + if (rex) + t.start_rex(); + + t.create_account_with_resources(N(aaaaaaaaaaaa), config::system_account_name, core_sym::from_string("1.0000"), + false, core_sym::from_string("500.0000"), core_sym::from_string("500.0000")); + t.create_account_with_resources(N(bbbbbbbbbbbb), config::system_account_name, core_sym::from_string("1.0000"), + false, core_sym::from_string("500.0000"), core_sym::from_string("500.0000")); + }; + auto net_weight = stake_weight * 3; + auto cpu_weight = stake_weight * 4 / 2; + + { + powerup_tester t; + init(t, false); + BOOST_REQUIRE_EQUAL( + t.wasm_assert_msg("days doesn't match configuration"), // + t.powerup(N(bob111111111), N(alice1111111), 20, powerup_frac, powerup_frac, asset::from_string("1.0000 TST"))); + BOOST_REQUIRE_EQUAL( // + t.wasm_assert_msg("net_frac can't be negative"), // + t.powerup(N(bob111111111), N(alice1111111), 30, -powerup_frac, powerup_frac, + asset::from_string("1.0000 TST"))); + BOOST_REQUIRE_EQUAL( // + t.wasm_assert_msg("cpu_frac can't be negative"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac, -powerup_frac, + asset::from_string("1.0000 TST"))); + BOOST_REQUIRE_EQUAL( // + t.wasm_assert_msg("net can't be more than 100%"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac + 1, powerup_frac, + asset::from_string("1.0000 TST"))); + BOOST_REQUIRE_EQUAL( // + t.wasm_assert_msg("cpu can't be more than 100%"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac, powerup_frac + 1, + asset::from_string("1.0000 TST"))); + BOOST_REQUIRE_EQUAL( + t.wasm_assert_msg("max_payment is less than calculated fee: 3000000.0000 TST"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac, powerup_frac, asset::from_string("1.0000 TST"))); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("can't channel fees to rex"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac, powerup_frac, + asset::from_string("3000000.0000 TST"))); + } + + // net:100%, cpu:100% + { + powerup_tester t; + init(t, true); + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("3000000.0000")); + BOOST_REQUIRE_EQUAL( + t.wasm_assert_msg("calculated fee is below minimum; try powering up with more resources"), + t.powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, 10, 10, asset::from_string("3000000.0000 TST"))); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac, powerup_frac, + asset::from_string("3000000.0000 TST"), net_weight, cpu_weight); + + BOOST_REQUIRE_EQUAL( // + t.wasm_assert_msg("weight can't shrink below utilization"), + t.configbw(t.make_default_config([&](auto& config) { + config.net.current_weight_ratio = powerup_frac / 4 + 1; + config.net.target_weight_ratio = powerup_frac / 4 + 1; + config.cpu.current_weight_ratio = powerup_frac / 5; + config.cpu.target_weight_ratio = powerup_frac / 5; + }))); + BOOST_REQUIRE_EQUAL( // + t.wasm_assert_msg("weight can't shrink below utilization"), + t.configbw(t.make_default_config([&](auto& config) { + config.net.current_weight_ratio = powerup_frac / 4; + config.net.target_weight_ratio = powerup_frac / 4; + config.cpu.current_weight_ratio = powerup_frac / 5 + 1; + config.cpu.target_weight_ratio = powerup_frac / 5 + 1; + }))); + BOOST_REQUIRE_EQUAL( // + "", // + t.configbw(t.make_default_config([&](auto& config) { + config.net.current_weight_ratio = powerup_frac / 4; + config.net.target_weight_ratio = powerup_frac / 4; + config.cpu.current_weight_ratio = powerup_frac / 5; + config.cpu.target_weight_ratio = powerup_frac / 5; + }))); + } + + // net:30%, cpu:40%, then net:5%, cpu:10% + { + powerup_tester t; + init(t, true); + // (.3 ^ 2) * 2000000.0000 / 2 = 90000.0000 + // (.4 ^ 3) * 6000000.0000 / 3 = 128000.0000 + // total = 218000.0000 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("218000.0001")); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac * .3, powerup_frac * .4, + asset::from_string("218000.0001 TST"), net_weight * .3, cpu_weight * .4); + + // (.35 ^ 2) * 2000000.0000 / 2 - 90000.0000 = 32500.0000 + // (.5 ^ 3) * 6000000.0000 / 3 - 128000.0000 = 122000.0000 + // total = 154500.0000 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("154500.0000")); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac * .05, powerup_frac * .10, + asset::from_string("154500.0000 TST"), net_weight * .05, cpu_weight * .10); + } + + // net:50%, cpu:50% (but with non-zero min_price and also an exponent of 2 to simplify the math) + { + powerup_tester t; + init(t, true); + BOOST_REQUIRE_EQUAL("", t.configbw(t.make_default_config([&](auto& config) { + config.cpu.exponent = 2; + config.net.min_price = asset::from_string("1200000.0000 TST"); + config.net.max_price = asset::from_string("2000000.0000 TST"); + + config.cpu.exponent = 2; + config.cpu.min_price = asset::from_string("4000000.0000 TST"); + config.cpu.max_price = asset::from_string("6000000.0000 TST"); + }))); + + // At 0% utilization for both NET and CPU, the cost (in TST) for renting an infinitesimal amount of resources (dr) is + // 1200000.0000 * dr for NET and 4000000.0000 * dr for CPU. + // At 50% utilization for both NET and CPU, the cost (in TST for renting an infinitesimal amount of resources (dr) is + // 1600000.0000 * dr for NET and 5000000.0000 * dr for CPU. + + // The fee for renting 50% of NET (starting from 0% utilization) is expected to be somewhere between + // 1200000.0000 * 0.5 (= 600000.0000) and 1600000.0000 * 0.5 (= 800000.0000). + // In fact, the cost ends up being 700000.0000. + + // The fee for renting 50% of CPU (starting from 0% utilization) is expected to be somewhere between + // 4000000.0000 * 0.5 (= 2000000.0000) and 5000000.0000 * 0.5 (= 2500000.0000). + // In fact, the cost ends up being 2250000.0000. + + + // 1200000.0000 * .5 + (800000.0000 / 2) * (.5 ^ 2) = 700000.0000 + // 4000000.0000 * .5 + (2000000.0000 / 2) * (.5 ^ 2) = 2250000.0000 + // total = 2950000.0000 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("2950000.0000")); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac * .5, powerup_frac * .5, + asset::from_string("2950000.0000 TST"), net_weight * .5, cpu_weight * .5); + } + + { + // net:100%, cpu:100% + powerup_tester t; + init(t, true); + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("3000000.0000")); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac, powerup_frac, + asset::from_string("3000000.0000 TST"), net_weight, cpu_weight); + + // No more available for 30 days + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("market doesn't have enough resources available"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac / 1000, powerup_frac / 1000, + asset::from_string("1.0000 TST"))); + t.produce_block(fc::days(29)); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("market doesn't have enough resources available"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac / 1000, powerup_frac / 1000, + asset::from_string("1.0000 TST"))); + t.produce_block(fc::days(1) - fc::milliseconds(1500)); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("market doesn't have enough resources available"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac / 1000, powerup_frac / 1000, + asset::from_string("1.0000 TST"))); + t.produce_block(fc::milliseconds(500)); + + // immediate renewal: adjusted_utilization doesn't have time to fall + // + // (1.0 ^ 1) * 2000000.0000 = 2000000.0000 + // (1.0 ^ 2) * 6000000.0000 = 6000000.0000 + // total = 8000000.0000 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("8000000.0000")); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac, powerup_frac, + asset::from_string("8000000.0000 TST"), 0, 0); + + // No more available for 30 days + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("market doesn't have enough resources available"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac / 1000, powerup_frac / 1000, + asset::from_string("1.0000 TST"))); + t.produce_block(fc::days(29)); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("market doesn't have enough resources available"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac / 1000, powerup_frac / 1000, + asset::from_string("1.0000 TST"))); + t.produce_block(fc::days(1) - fc::milliseconds(1000)); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("market doesn't have enough resources available"), // + t.powerup(N(bob111111111), N(alice1111111), 30, powerup_frac / 1000, powerup_frac / 1000, + asset::from_string("1.0000 TST"))); + + // Start decay + t.produce_block(fc::milliseconds(1000)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE(near(t.get_state().net.adjusted_utilization, net_weight, net_weight / 1000)); + BOOST_REQUIRE(near(t.get_state().cpu.adjusted_utilization, cpu_weight, cpu_weight / 1000)); + + // 1 day of decay + t.produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE(near(t.get_state().net.adjusted_utilization, int64_t(net_weight * exp(-1)), + int64_t(net_weight * exp(-1)) / 1000)); + BOOST_REQUIRE(near(t.get_state().cpu.adjusted_utilization, int64_t(cpu_weight * exp(-1)), + int64_t(cpu_weight * exp(-1)) / 1000)); + + // 1 day of decay + t.produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE(near(t.get_state().net.adjusted_utilization, int64_t(net_weight * exp(-2)), + int64_t(net_weight * exp(-2)) / 1000)); + BOOST_REQUIRE(near(t.get_state().cpu.adjusted_utilization, int64_t(cpu_weight * exp(-2)), + int64_t(cpu_weight * exp(-2)) / 1000)); + + // 100% after 2 days of decay + // + // [ ((e^-2) ^ 1)*(e^-2 - 0.0) + ((1.0) ^ 2)/2 - ((e^-2) ^ 2)/2 ] * 2000000.0000 = 1018315.6389 + // [ ((e^-2) ^ 2)*(e^-2 - 0.0) + ((1.0) ^ 3)/3 - ((e^-2) ^ 3)/3 ] * 6000000.0000 = 2009915.0087 + // total = 3028230.6476 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("3028229.8795")); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac, powerup_frac, + asset::from_string("3028229.8795 TST"), net_weight, cpu_weight); + } + + { + powerup_tester t; + init(t, true); + + // 10%, 20% + // (.1 ^ 2) * 2000000.0000 / 2 = 10000.0000 + // (.2 ^ 3) * 6000000.0000 / 3 = 16000.0000 + // total = 26000.0000 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("26000.0002")); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac * .1, powerup_frac * .2, + asset::from_string("26000.0002 TST"), net_weight * .1, cpu_weight * .2); + + t.produce_block(fc::days(15) - fc::milliseconds(500)); + + // 20%, 20% + // (.3 ^ 2) * 2000000.0000 / 2 - 10000.0000 = 80000.0000 + // (.4 ^ 3) * 6000000.0000 / 3 - 16000.0000 = 112000.0000 + // total = 192000.0000 + t.transfer(config::system_account_name, N(aaaaaaaaaaaa), core_sym::from_string("192000.0001")); + t.check_powerup(N(aaaaaaaaaaaa), N(bbbbbbbbbbbb), 30, powerup_frac * .2, powerup_frac * .2, + asset::from_string("192000.0001 TST"), net_weight * .2, cpu_weight * .2); + + // Start decay + t.produce_block(fc::days(15) - fc::milliseconds(1000)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE(near(t.get_state().net.adjusted_utilization, .3 * net_weight, 0)); + BOOST_REQUIRE(near(t.get_state().cpu.adjusted_utilization, .4 * cpu_weight, 0)); + + // 1 day of decay from (30%, 40%) to (20%, 20%) + t.produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE( + near(t.get_state().net.adjusted_utilization, int64_t(.1 * net_weight * exp(-1) + .2 * net_weight), 0)); + BOOST_REQUIRE( + near(t.get_state().cpu.adjusted_utilization, int64_t(.2 * cpu_weight * exp(-1) + .2 * cpu_weight), 0)); + + // 2 days of decay from (30%, 40%) to (20%, 20%) + t.produce_block(fc::days(1) - fc::milliseconds(500)); + BOOST_REQUIRE_EQUAL("", t.powerupexec(config::system_account_name, 10)); + BOOST_REQUIRE( + near(t.get_state().net.adjusted_utilization, int64_t(.1 * net_weight * exp(-2) + .2 * net_weight), 0)); + BOOST_REQUIRE( + near(t.get_state().cpu.adjusted_utilization, int64_t(.2 * cpu_weight * exp(-2) + .2 * cpu_weight), 0)); + } + +} // rent_tests +FC_LOG_AND_RETHROW() + +BOOST_AUTO_TEST_SUITE_END() diff --git a/tests/eosio.system_tester.hpp b/tests/eosio.system_tester.hpp index 1d26caef1..3d9c76ebd 100644 --- a/tests/eosio.system_tester.hpp +++ b/tests/eosio.system_tester.hpp @@ -1,11 +1,8 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ #pragma once #include #include +#include #include "contracts.hpp" #include "test_symbol.hpp" @@ -26,9 +23,9 @@ using mvo = fc::mutable_variant_object; #endif #endif - namespace eosio_system { + class eosio_system_tester : public TESTER { public: @@ -36,7 +33,7 @@ class eosio_system_tester : public TESTER { produce_blocks( 2 ); create_accounts({ N(eosio.token), N(eosio.ram), N(eosio.ramfee), N(eosio.stake), - N(eosio.bpay), N(eosio.vpay), N(eosio.saving), N(eosio.names) }); + N(eosio.bpay), N(eosio.vpay), N(eosio.saving), N(eosio.names), N(eosio.rex) }); produce_blocks( 100 ); @@ -46,14 +43,14 @@ class eosio_system_tester : public TESTER { const auto& accnt = control->db().get( N(eosio.token) ); abi_def abi; BOOST_REQUIRE_EQUAL(abi_serializer::to_abi(accnt.abi, abi), true); - token_abi_ser.set_abi(abi, abi_serializer_max_time); + token_abi_ser.set_abi(abi, abi_serializer::create_yield_function(abi_serializer_max_time)); } } void create_core_token( symbol core_symbol = symbol{CORE_SYM} ) { - FC_ASSERT( core_symbol.precision() != 4, "create_core_token assumes precision of core token is 4" ); + FC_ASSERT( core_symbol.decimals() == 4, "create_core_token assumes core token has 4 digits of precision" ); create_currency( N(eosio.token), config::system_account_name, asset(100000000000000, core_symbol) ); - issue(config::system_account_name, asset(10000000000000, core_symbol) ); + issue( asset(10000000000000, core_symbol) ); BOOST_REQUIRE_EQUAL( asset(10000000000000, core_symbol), get_balance( "eosio", core_symbol ) ); } @@ -72,7 +69,7 @@ class eosio_system_tester : public TESTER { const auto& accnt = control->db().get( config::system_account_name ); abi_def abi; BOOST_REQUIRE_EQUAL(abi_serializer::to_abi(accnt.abi, abi), true); - abi_ser.set_abi(abi, abi_serializer_max_time); + abi_ser.set_abi(abi, abi_serializer::create_yield_function(abi_serializer_max_time)); } } @@ -252,13 +249,23 @@ class eosio_system_tester : public TESTER { action_result buyram( const account_name& payer, account_name receiver, const asset& eosin ) { return push_action( payer, N(buyram), mvo()( "payer",payer)("receiver",receiver)("quant",eosin) ); } + action_result buyram( std::string_view payer, std::string_view receiver, const asset& eosin ) { + return buyram( account_name(payer), account_name(receiver), eosin ); + } + action_result buyrambytes( const account_name& payer, account_name receiver, uint32_t numbytes ) { return push_action( payer, N(buyrambytes), mvo()( "payer",payer)("receiver",receiver)("bytes",numbytes) ); } + action_result buyrambytes( std::string_view payer, std::string_view receiver, uint32_t numbytes ) { + return buyrambytes( account_name(payer), account_name(receiver), numbytes ); + } action_result sellram( const account_name& account, uint64_t numbytes ) { return push_action( account, N(sellram), mvo()( "account", account)("bytes",numbytes) ); } + action_result sellram( std::string_view account, uint64_t numbytes ) { + return sellram( account_name(account), numbytes ); + } action_result push_action( const account_name& signer, const action_name &name, const variant_object &data, bool auth = true ) { string action_type_name = abi_ser.get_action_type(name); @@ -266,9 +273,9 @@ class eosio_system_tester : public TESTER { action act; act.account = config::system_account_name; act.name = name; - act.data = abi_ser.variant_to_binary( action_type_name, data, abi_serializer_max_time ); + act.data = abi_ser.variant_to_binary( action_type_name, data, abi_serializer::create_yield_function(abi_serializer_max_time) ); - return base_tester::push_action( std::move(act), auth ? uint64_t(signer) : signer == N(bob111111111) ? N(alice1111111) : N(bob111111111) ); + return base_tester::push_action( std::move(act), (auth ? signer : signer == N(bob111111111) ? N(alice1111111) : N(bob111111111)).to_uint64_t() ); } action_result stake( const account_name& from, const account_name& to, const asset& net, const asset& cpu ) { @@ -280,10 +287,16 @@ class eosio_system_tester : public TESTER { ("transfer", 0 ) ); } + action_result stake( std::string_view from, std::string_view to, const asset& net, const asset& cpu ) { + return stake( account_name(from), account_name(to), net, cpu ); + } action_result stake( const account_name& acnt, const asset& net, const asset& cpu ) { return stake( acnt, acnt, net, cpu ); } + action_result stake( std::string_view acnt, const asset& net, const asset& cpu ) { + return stake( account_name(acnt), net, cpu ); + } action_result stake_with_transfer( const account_name& from, const account_name& to, const asset& net, const asset& cpu ) { return push_action( name(from), N(delegatebw), mvo() @@ -294,10 +307,16 @@ class eosio_system_tester : public TESTER { ("transfer", true ) ); } + action_result stake_with_transfer( std::string_view from, std::string_view to, const asset& net, const asset& cpu ) { + return stake_with_transfer( account_name(from), account_name(to), net, cpu ); + } action_result stake_with_transfer( const account_name& acnt, const asset& net, const asset& cpu ) { return stake_with_transfer( acnt, acnt, net, cpu ); } + action_result stake_with_transfer( std::string_view acnt, const asset& net, const asset& cpu ) { + return stake_with_transfer( account_name(acnt), net, cpu ); + } action_result unstake( const account_name& from, const account_name& to, const asset& net, const asset& cpu ) { return push_action( name(from), N(undelegatebw), mvo() @@ -307,10 +326,411 @@ class eosio_system_tester : public TESTER { ("unstake_cpu_quantity", cpu) ); } + action_result unstake( std::string_view from, std::string_view to, const asset& net, const asset& cpu ) { + return unstake( account_name(from), account_name(to), net, cpu ); + } action_result unstake( const account_name& acnt, const asset& net, const asset& cpu ) { return unstake( acnt, acnt, net, cpu ); } + action_result unstake( std::string_view acnt, const asset& net, const asset& cpu ) { + return unstake( account_name(acnt), net, cpu ); + } + + int64_t bancor_convert( int64_t S, int64_t R, int64_t T ) { return double(R) * T / ( double(S) + T ); }; + + int64_t get_net_limit( account_name a ) { + int64_t ram_bytes = 0, net = 0, cpu = 0; + control->get_resource_limits_manager().get_account_limits( a, ram_bytes, net, cpu ); + return net; + }; + + int64_t get_cpu_limit( account_name a ) { + int64_t ram_bytes = 0, net = 0, cpu = 0; + control->get_resource_limits_manager().get_account_limits( a, ram_bytes, net, cpu ); + return cpu; + }; + + action_result deposit( const account_name& owner, const asset& amount ) { + return push_action( name(owner), N(deposit), mvo() + ("owner", owner) + ("amount", amount) + ); + } + + action_result withdraw( const account_name& owner, const asset& amount ) { + return push_action( name(owner), N(withdraw), mvo() + ("owner", owner) + ("amount", amount) + ); + } + + action_result buyrex( const account_name& from, const asset& amount ) { + return push_action( name(from), N(buyrex), mvo() + ("from", from) + ("amount", amount) + ); + } + + asset get_buyrex_result( const account_name& from, const asset& amount ) { + auto trace = base_tester::push_action( config::system_account_name, N(buyrex), from, mvo()("from", from)("amount", amount) ); + asset rex_received; + for ( size_t i = 0; i < trace->action_traces.size(); ++i ) { + if ( trace->action_traces[i].act.name == N(buyresult) ) { + fc::raw::unpack( trace->action_traces[i].act.data.data(), + trace->action_traces[i].act.data.size(), + rex_received ); + return rex_received; + } + } + return rex_received; + } + + action_result unstaketorex( const account_name& owner, const account_name& receiver, const asset& from_net, const asset& from_cpu ) { + return push_action( name(owner), N(unstaketorex), mvo() + ("owner", owner) + ("receiver", receiver) + ("from_net", from_net) + ("from_cpu", from_cpu) + ); + } + + asset get_unstaketorex_result( const account_name& owner, const account_name& receiver, const asset& from_net, const asset& from_cpu ) { + auto trace = base_tester::push_action( config::system_account_name, N(unstaketorex), owner, mvo() + ("owner", owner) + ("receiver", receiver) + ("from_net", from_net) + ("from_cpu", from_cpu) + ); + asset rex_received; + for ( size_t i = 0; i < trace->action_traces.size(); ++i ) { + if ( trace->action_traces[i].act.name == N(buyresult) ) { + fc::raw::unpack( trace->action_traces[i].act.data.data(), + trace->action_traces[i].act.data.size(), + rex_received ); + return rex_received; + } + } + return rex_received; + } + + action_result sellrex( const account_name& from, const asset& rex ) { + return push_action( name(from), N(sellrex), mvo() + ("from", from) + ("rex", rex) + ); + } + + asset get_sellrex_result( const account_name& from, const asset& rex ) { + auto trace = base_tester::push_action( config::system_account_name, N(sellrex), from, mvo()("from", from)("rex", rex) ); + asset proceeds; + for ( size_t i = 0; i < trace->action_traces.size(); ++i ) { + if ( trace->action_traces[i].act.name == N(sellresult) ) { + fc::raw::unpack( trace->action_traces[i].act.data.data(), + trace->action_traces[i].act.data.size(), + proceeds ); + return proceeds; + } + } + return proceeds; + } + + auto get_rexorder_result( const transaction_trace_ptr& trace ) { + std::vector> output; + for ( size_t i = 0; i < trace->action_traces.size(); ++i ) { + if ( trace->action_traces[i].act.name == N(orderresult) ) { + fc::datastream ds( trace->action_traces[i].act.data.data(), + trace->action_traces[i].act.data.size() ); + account_name owner; fc::raw::unpack( ds, owner ); + asset proceeds; fc::raw::unpack( ds, proceeds ); + output.emplace_back( owner, proceeds ); + } + } + return output; + } + + action_result cancelrexorder( const account_name& owner ) { + return push_action( name(owner), N(cnclrexorder), mvo()("owner", owner) ); + } + + action_result rentcpu( const account_name& from, const account_name& receiver, const asset& payment, const asset& fund = core_sym::from_string("0.0000") ) { + return push_action( name(from), N(rentcpu), mvo() + ("from", from) + ("receiver", receiver) + ("loan_payment", payment) + ("loan_fund", fund) + ); + } + + action_result rentnet( const account_name& from, const account_name& receiver, const asset& payment, const asset& fund = core_sym::from_string("0.0000") ) { + return push_action( name(from), N(rentnet), mvo() + ("from", from) + ("receiver", receiver) + ("loan_payment", payment) + ("loan_fund", fund) + ); + } + + asset _get_rentrex_result( const account_name& from, const account_name& receiver, const asset& payment, bool cpu ) { + const name act = cpu ? N(rentcpu) : N(rentnet); + auto trace = base_tester::push_action( config::system_account_name, act, from, mvo() + ("from", from) + ("receiver", receiver) + ("loan_payment", payment) + ("loan_fund", core_sym::from_string("0.0000") ) + ); + + asset rented_tokens = core_sym::from_string("0.0000"); + for ( size_t i = 0; i < trace->action_traces.size(); ++i ) { + if ( trace->action_traces[i].act.name == N(rentresult) ) { + fc::raw::unpack( trace->action_traces[i].act.data.data(), + trace->action_traces[i].act.data.size(), + rented_tokens ); + return rented_tokens; + } + } + return rented_tokens; + } + + asset get_rentcpu_result( const account_name& from, const account_name& receiver, const asset& payment ) { + return _get_rentrex_result( from, receiver, payment, true ); + } + + asset get_rentnet_result( const account_name& from, const account_name& receiver, const asset& payment ) { + return _get_rentrex_result( from, receiver, payment, false ); + } + + action_result fundcpuloan( const account_name& from, const uint64_t loan_num, const asset& payment ) { + return push_action( name(from), N(fundcpuloan), mvo() + ("from", from) + ("loan_num", loan_num) + ("payment", payment) + ); + } + + action_result fundnetloan( const account_name& from, const uint64_t loan_num, const asset& payment ) { + return push_action( name(from), N(fundnetloan), mvo() + ("from", from) + ("loan_num", loan_num) + ("payment", payment) + ); + } + + + action_result defundcpuloan( const account_name& from, const uint64_t loan_num, const asset& amount ) { + return push_action( name(from), N(defcpuloan), mvo() + ("from", from) + ("loan_num", loan_num) + ("amount", amount) + ); + } + + action_result defundnetloan( const account_name& from, const uint64_t loan_num, const asset& amount ) { + return push_action( name(from), N(defnetloan), mvo() + ("from", from) + ("loan_num", loan_num) + ("amount", amount) + ); + } + + action_result updaterex( const account_name& owner ) { + return push_action( name(owner), N(updaterex), mvo()("owner", owner) ); + } + + action_result rexexec( const account_name& user, uint16_t max ) { + return push_action( name(user), N(rexexec), mvo()("user", user)("max", max) ); + } + + action_result consolidate( const account_name& owner ) { + return push_action( name(owner), N(consolidate), mvo()("owner", owner) ); + } + + action_result mvtosavings( const account_name& owner, const asset& rex ) { + return push_action( name(owner), N(mvtosavings), mvo()("owner", owner)("rex", rex) ); + } + + action_result mvfrsavings( const account_name& owner, const asset& rex ) { + return push_action( name(owner), N(mvfrsavings), mvo()("owner", owner)("rex", rex) ); + } + + action_result closerex( const account_name& owner ) { + return push_action( name(owner), N(closerex), mvo()("owner", owner) ); + } + + fc::variant get_last_loan(bool cpu) { + vector data; + const auto& db = control->db(); + namespace chain = eosio::chain; + auto table = cpu ? N(cpuloan) : N(netloan); + const auto* t_id = db.find( boost::make_tuple( config::system_account_name, config::system_account_name, table ) ); + if ( !t_id ) { + return fc::variant(); + } + + const auto& idx = db.get_index(); + + auto itr = idx.upper_bound( boost::make_tuple( t_id->id, std::numeric_limits::max() )); + if ( itr == idx.begin() ) { + return fc::variant(); + } + --itr; + if ( itr->t_id != t_id->id ) { + return fc::variant(); + } + + data.resize( itr->value.size() ); + memcpy( data.data(), itr->value.data(), data.size() ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "rex_loan", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + + fc::variant get_last_cpu_loan() { + return get_last_loan( true ); + } + + fc::variant get_last_net_loan() { + return get_last_loan( false ); + } + + fc::variant get_loan_info( const uint64_t& loan_num, bool cpu ) const { + name table_name = cpu ? N(cpuloan) : N(netloan); + vector data = get_row_by_account( config::system_account_name, config::system_account_name, table_name, account_name(loan_num) ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "rex_loan", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + + fc::variant get_cpu_loan( const uint64_t loan_num ) const { + return get_loan_info( loan_num, true ); + } + + fc::variant get_net_loan( const uint64_t loan_num ) const { + return get_loan_info( loan_num, false ); + } + + fc::variant get_dbw_obj( const account_name& from, const account_name& receiver ) const { + vector data = get_row_by_account( config::system_account_name, from, N(delband), receiver ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant("delegated_bandwidth", data, abi_serializer::create_yield_function(abi_serializer_max_time)); + } + + asset get_rex_balance( const account_name& act ) const { + vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(rexbal), act ); + return data.empty() ? asset(0, symbol(SY(4, REX))) : abi_ser.binary_to_variant("rex_balance", data, abi_serializer::create_yield_function(abi_serializer_max_time))["rex_balance"].as(); + } + + fc::variant get_rex_balance_obj( const account_name& act ) const { + vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(rexbal), act ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant("rex_balance", data, abi_serializer::create_yield_function(abi_serializer_max_time)); + } + + asset get_rex_fund( const account_name& act ) const { + vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(rexfund), act ); + return data.empty() ? asset(0, symbol{CORE_SYM}) : abi_ser.binary_to_variant("rex_fund", data, abi_serializer::create_yield_function(abi_serializer_max_time))["balance"].as(); + } + + fc::variant get_rex_fund_obj( const account_name& act ) const { + vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(rexfund), act ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "rex_fund", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + + asset get_rex_vote_stake( const account_name& act ) const { + vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(rexbal), act ); + return data.empty() ? core_sym::from_string("0.0000") : abi_ser.binary_to_variant("rex_balance", data, abi_serializer::create_yield_function(abi_serializer_max_time))["vote_stake"].as(); + } + + fc::variant get_rex_order( const account_name& act ) { + vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(rexqueue), act ); + return abi_ser.binary_to_variant( "rex_order", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + + fc::variant get_rex_order_obj( const account_name& act ) { + vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(rexqueue), act ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "rex_order", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + + fc::variant get_rex_pool() const { + vector data; + const auto& db = control->db(); + namespace chain = eosio::chain; + const auto* t_id = db.find( boost::make_tuple( config::system_account_name, config::system_account_name, N(rexpool) ) ); + if ( !t_id ) { + return fc::variant(); + } + + const auto& idx = db.get_index(); + + auto itr = idx.lower_bound( boost::make_tuple( t_id->id, 0 ) ); + if ( itr == idx.end() || itr->t_id != t_id->id || 0 != itr->primary_key ) { + return fc::variant(); + } + + data.resize( itr->value.size() ); + memcpy( data.data(), itr->value.data(), data.size() ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "rex_pool", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + + fc::variant get_rex_return_pool() const { + vector data; + const auto& db = control->db(); + namespace chain = eosio::chain; + const auto* t_id = db.find( boost::make_tuple( config::system_account_name, config::system_account_name, N(rexretpool) ) ); + if ( !t_id ) { + return fc::variant(); + } + + const auto& idx = db.get_index(); + + auto itr = idx.lower_bound( boost::make_tuple( t_id->id, 0 ) ); + if ( itr == idx.end() || itr->t_id != t_id->id || 0 != itr->primary_key ) { + return fc::variant(); + } + + data.resize( itr->value.size() ); + memcpy( data.data(), itr->value.data(), data.size() ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "rex_return_pool", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + + fc::variant get_rex_return_buckets() const { + vector data; + const auto& db = control->db(); + namespace chain = eosio::chain; + const auto* t_id = db.find( boost::make_tuple( config::system_account_name, config::system_account_name, N(retbuckets) ) ); + if ( !t_id ) { + return fc::variant(); + } + + const auto& idx = db.get_index(); + + auto itr = idx.lower_bound( boost::make_tuple( t_id->id, 0 ) ); + if ( itr == idx.end() || itr->t_id != t_id->id || 0 != itr->primary_key ) { + return fc::variant(); + } + + data.resize( itr->value.size() ); + memcpy( data.data(), itr->value.data(), data.size() ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "rex_return_buckets", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + + void setup_rex_accounts( const std::vector& accounts, + const asset& init_balance, + const asset& net = core_sym::from_string("80.0000"), + const asset& cpu = core_sym::from_string("80.0000"), + bool deposit_into_rex_fund = true ) { + const asset nstake = core_sym::from_string("10.0000"); + const asset cstake = core_sym::from_string("10.0000"); + create_account_with_resources( N(proxyaccount), config::system_account_name, core_sym::from_string("1.0000"), false, net, cpu ); + BOOST_REQUIRE_EQUAL( success(), push_action( N(proxyaccount), N(regproxy), mvo()("proxy", "proxyaccount")("isproxy", true) ) ); + for (const auto& a: accounts) { + create_account_with_resources( a, config::system_account_name, core_sym::from_string("1.0000"), false, net, cpu ); + transfer( config::system_account_name, a, init_balance + nstake + cstake, config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( a, a, nstake, cstake) ); + BOOST_REQUIRE_EQUAL( success(), vote( a, { }, N(proxyaccount) ) ); + BOOST_REQUIRE_EQUAL( init_balance, get_balance(a) ); + BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 REX"), get_rex_balance(a) ); + if (deposit_into_rex_fund) { + BOOST_REQUIRE_EQUAL( success(), deposit( a, init_balance ) ); + BOOST_REQUIRE_EQUAL( init_balance, get_rex_fund( a ) ); + BOOST_REQUIRE_EQUAL( 0, get_balance( a ).get_amount() ); + } + } + } action_result bidname( const account_name& bidder, const account_name& newname, const asset& bid ) { return push_action( name(bidder), N(bidname), mvo() @@ -319,6 +739,9 @@ class eosio_system_tester : public TESTER { ("bid", bid) ); } + action_result bidname( std::string_view bidder, std::string_view newname, const asset& bid ) { + return bidname( account_name(bidder), account_name(newname), bid ); + } static fc::variant_object producer_parameters_example( int n ) { return mutable_variant_object() @@ -360,34 +783,53 @@ class eosio_system_tester : public TESTER { ("proxy", proxy) ("producers", producers)); } + action_result vote( const account_name& voter, const std::vector& producers, std::string_view proxy ) { + return vote( voter, producers, account_name(proxy) ); + } uint32_t last_block_time() const { return time_point_sec( control->head_block_time() ).sec_since_epoch(); } asset get_balance( const account_name& act, symbol balance_symbol = symbol{CORE_SYM} ) { - vector data = get_row_by_account( N(eosio.token), act, N(accounts), balance_symbol.to_symbol_code().value ); - return data.empty() ? asset(0, balance_symbol) : token_abi_ser.binary_to_variant("account", data, abi_serializer_max_time)["balance"].as(); + vector data = get_row_by_account( N(eosio.token), act, N(accounts), account_name(balance_symbol.to_symbol_code().value) ); + return data.empty() ? asset(0, balance_symbol) : token_abi_ser.binary_to_variant("account", data, abi_serializer::create_yield_function(abi_serializer_max_time))["balance"].as(); + } + + asset get_balance( std::string_view act, symbol balance_symbol = symbol{CORE_SYM} ) { + return get_balance( account_name(act), balance_symbol ); } fc::variant get_total_stake( const account_name& act ) { vector data = get_row_by_account( config::system_account_name, act, N(userres), act ); - return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "user_resources", data, abi_serializer_max_time ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "user_resources", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + fc::variant get_total_stake( std::string_view act ) { + return get_total_stake( account_name(act) ); } fc::variant get_voter_info( const account_name& act ) { vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(voters), act ); - return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "voter_info", data, abi_serializer_max_time ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "voter_info", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + fc::variant get_voter_info( std::string_view act ) { + return get_voter_info( account_name(act) ); } fc::variant get_producer_info( const account_name& act ) { vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(producers), act ); - return abi_ser.binary_to_variant( "producer_info", data, abi_serializer_max_time ); + return abi_ser.binary_to_variant( "producer_info", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + fc::variant get_producer_info( std::string_view act ) { + return get_producer_info( account_name(act) ); } fc::variant get_producer_info2( const account_name& act ) { vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(producers2), act ); - return abi_ser.binary_to_variant( "producer_info2", data, abi_serializer_max_time ); + return abi_ser.binary_to_variant( "producer_info2", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); + } + fc::variant get_producer_info2( std::string_view act ) { + return get_producer_info2( account_name(act) ); } void create_currency( name contract, name manager, asset maxsupply ) { @@ -398,14 +840,15 @@ class eosio_system_tester : public TESTER { base_tester::push_action(contract, N(create), contract, act ); } - void issue( name to, const asset& amount, name manager = config::system_account_name ) { + void issue( const asset& amount, const name& manager = config::system_account_name ) { base_tester::push_action( N(eosio.token), N(issue), manager, mutable_variant_object() - ("to", to ) + ("to", manager ) ("quantity", amount ) - ("memo", "") + ("memo", "") ); } - void transfer( name from, name to, const asset& amount, name manager = config::system_account_name ) { + + void transfer( const name& from, const name& to, const asset& amount, const name& manager = config::system_account_name ) { base_tester::push_action( N(eosio.token), N(transfer), manager, mutable_variant_object() ("from", from) ("to", to ) @@ -414,6 +857,56 @@ class eosio_system_tester : public TESTER { ); } + void transfer( const name& from, std::string_view to, const asset& amount, const name& manager = config::system_account_name ) { + transfer( from, name(to), amount, manager ); + } + + void transfer( std::string_view from, std::string_view to, const asset& amount, std::string_view manager ) { + transfer( name(from), name(to), amount, name(manager) ); + } + + void transfer( std::string_view from, std::string_view to, const asset& amount ) { + transfer( name(from), name(to), amount ); + } + + void issue_and_transfer( const name& to, const asset& amount, const name& manager = config::system_account_name ) { + signed_transaction trx; + trx.actions.emplace_back( get_action( N(eosio.token), N(issue), + vector{{manager, config::active_name}}, + mutable_variant_object() + ("to", manager ) + ("quantity", amount ) + ("memo", "") + ) + ); + if ( to != manager ) { + trx.actions.emplace_back( get_action( N(eosio.token), N(transfer), + vector{{manager, config::active_name}}, + mutable_variant_object() + ("from", manager) + ("to", to ) + ("quantity", amount ) + ("memo", "") + ) + ); + } + set_transaction_headers( trx ); + trx.sign( get_private_key( manager, "active" ), control->get_chain_id() ); + push_transaction( trx ); + } + + void issue_and_transfer( std::string_view to, const asset& amount, std::string_view manager ) { + issue_and_transfer( name(to), amount, name(manager) ); + } + + void issue_and_transfer( std::string_view to, const asset& amount, const name& manager ) { + issue_and_transfer( name(to), amount, manager); + } + + void issue_and_transfer( std::string_view to, const asset& amount ) { + issue_and_transfer( name(to), amount ); + } + double stake2votes( asset stake ) { auto now = control->pending_block_time().time_since_epoch().count() / 1000000; return stake.get_amount() * pow(2, int64_t((now - (config::block_timestamp_epoch / 1000)) / (86400 * 7))/ double(52) ); // 52 week periods (i.e. ~years) @@ -426,8 +919,8 @@ class eosio_system_tester : public TESTER { fc::variant get_stats( const string& symbolname ) { auto symb = eosio::chain::symbol::from_string(symbolname); auto symbol_code = symb.to_symbol_code().value; - vector data = get_row_by_account( N(eosio.token), symbol_code, N(stat), symbol_code ); - return data.empty() ? fc::variant() : token_abi_ser.binary_to_variant( "currency_stats", data, abi_serializer_max_time ); + vector data = get_row_by_account( N(eosio.token), name(symbol_code), N(stat), account_name(symbol_code) ); + return data.empty() ? fc::variant() : token_abi_ser.binary_to_variant( "currency_stats", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); } asset get_token_supply() { @@ -441,29 +934,29 @@ class eosio_system_tester : public TESTER { fc::variant get_global_state() { vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(global), N(global) ); if (data.empty()) std::cout << "\nData is empty\n" << std::endl; - return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "eosio_global_state", data, abi_serializer_max_time ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "eosio_global_state", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); } fc::variant get_global_state2() { vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(global2), N(global2) ); - return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "eosio_global_state2", data, abi_serializer_max_time ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "eosio_global_state2", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); } fc::variant get_global_state3() { vector data = get_row_by_account( config::system_account_name, config::system_account_name, N(global3), N(global3) ); - return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "eosio_global_state3", data, abi_serializer_max_time ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "eosio_global_state3", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); } fc::variant get_refund_request( name account ) { vector data = get_row_by_account( config::system_account_name, account, N(refunds), account ); - return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "refund_request", data, abi_serializer_max_time ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "refund_request", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); } abi_serializer initialize_multisig() { abi_serializer msig_abi_ser; { create_account_with_resources( N(eosio.msig), config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), buyram( "eosio", "eosio.msig", core_sym::from_string("5000.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( N(eosio), N(eosio.msig), core_sym::from_string("5000.0000") ) ); produce_block(); auto trace = base_tester::push_action(config::system_account_name, N(setpriv), @@ -479,15 +972,15 @@ class eosio_system_tester : public TESTER { const auto& accnt = control->db().get( N(eosio.msig) ); abi_def msig_abi; BOOST_REQUIRE_EQUAL(abi_serializer::to_abi(accnt.abi, msig_abi), true); - msig_abi_ser.set_abi(msig_abi, abi_serializer_max_time); + msig_abi_ser.set_abi(msig_abi, abi_serializer::create_yield_function(abi_serializer_max_time)); } return msig_abi_ser; } vector active_and_vote_producers() { //stake more than 15% of total EOS supply to activate chain - transfer( "eosio", "alice1111111", core_sym::from_string("650000000.0000"), "eosio" ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", core_sym::from_string("300000000.0000"), core_sym::from_string("300000000.0000") ) ); + transfer( N(eosio), N(alice1111111), core_sym::from_string("650000000.0000"), config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( N(alice1111111), N(alice1111111), core_sym::from_string("300000000.0000"), core_sym::from_string("300000000.0000") ) ); // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers std::vector producer_names; @@ -519,9 +1012,9 @@ class eosio_system_tester : public TESTER { //vote for producers { - transfer( config::system_account_name, "alice1111111", core_sym::from_string("100000000.0000"), config::system_account_name ); - BOOST_REQUIRE_EQUAL(success(), stake( "alice1111111", core_sym::from_string("30000000.0000"), core_sym::from_string("30000000.0000") ) ); - BOOST_REQUIRE_EQUAL(success(), buyram( "alice1111111", "alice1111111", core_sym::from_string("30000000.0000") ) ); + transfer( config::system_account_name, N(alice1111111), core_sym::from_string("100000000.0000"), config::system_account_name ); + BOOST_REQUIRE_EQUAL(success(), stake( N(alice1111111), core_sym::from_string("30000000.0000"), core_sym::from_string("30000000.0000") ) ); + BOOST_REQUIRE_EQUAL(success(), buyram( N(alice1111111), N(alice1111111), core_sym::from_string("30000000.0000") ) ); BOOST_REQUIRE_EQUAL(success(), push_action(N(alice1111111), N(voteproducer), mvo() ("voter", "alice1111111") ("proxy", name(0).to_string()) @@ -581,6 +1074,14 @@ class eosio_system_tester : public TESTER { } } + action_result setinflation( int64_t annual_rate, int64_t inflation_pay_factor, int64_t votepay_factor ) { + return push_action( N(eosio), N(setinflation), mvo() + ("annual_rate", annual_rate) + ("inflation_pay_factor", inflation_pay_factor) + ("votepay_factor", votepay_factor) + ); + } + abi_serializer abi_ser; abi_serializer token_abi_ser; }; @@ -596,14 +1097,23 @@ inline fc::mutable_variant_object voter( account_name acct ) { ("is_proxy", 0) ; } +inline fc::mutable_variant_object voter( std::string_view acct ) { + return voter( account_name(acct) ); +} inline fc::mutable_variant_object voter( account_name acct, const asset& vote_stake ) { return voter( acct )( "staked", vote_stake.get_amount() ); } +inline fc::mutable_variant_object voter( std::string_view acct, const asset& vote_stake ) { + return voter( account_name(acct), vote_stake ); +} inline fc::mutable_variant_object voter( account_name acct, int64_t vote_stake ) { return voter( acct )( "staked", vote_stake ); } +inline fc::mutable_variant_object voter( std::string_view acct, int64_t vote_stake ) { + return voter( account_name(acct), vote_stake ); +} inline fc::mutable_variant_object proxy( account_name acct ) { return voter( acct )( "is_proxy", 1 ); diff --git a/tests/eosio.system_tests.cpp b/tests/eosio.system_tests.cpp index c29742e3a..dbbf46d49 100644 --- a/tests/eosio.system_tests.cpp +++ b/tests/eosio.system_tests.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -16,10 +17,19 @@ struct _abi_hash { }; FC_REFLECT( _abi_hash, (owner)(hash) ); +struct connector { + asset balance; + double weight = .5; +}; +FC_REFLECT( connector, (balance)(weight) ); + using namespace eosio_system; BOOST_AUTO_TEST_SUITE(eosio_system_tests) +bool within_error(int64_t a, int64_t b, int64_t err) { return std::abs(a - b) <= err; }; +bool within_one(int64_t a, int64_t b) { return within_error(a, b, 1); } + BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), get_balance( "alice1111111" ) ); @@ -116,7 +126,51 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( success(), sellram( "alice1111111", bought_bytes ) ); - BOOST_REQUIRE_EQUAL( core_sym::from_string("99396507.4158"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( false, get_row_by_account( config::system_account_name, config::system_account_name, + N(rammarket), account_name(symbol{SY(4,RAMCORE)}.value()) ).empty() ); + + auto get_ram_market = [this]() -> fc::variant { + vector data = get_row_by_account( config::system_account_name, config::system_account_name, + N(rammarket), account_name(symbol{SY(4,RAMCORE)}.value()) ); + BOOST_REQUIRE( !data.empty() ); + return abi_ser.binary_to_variant("exchange_state", data, abi_serializer::create_yield_function(abi_serializer_max_time)); + }; + + { + transfer( config::system_account_name, N(alice1111111), core_sym::from_string("10000000.0000"), config::system_account_name ); + uint64_t bytes0 = get_total_stake( "alice1111111" )["ram_bytes"].as_uint64(); + + auto market = get_ram_market(); + const asset r0 = market["base"].as().balance; + const asset e0 = market["quote"].as().balance; + BOOST_REQUIRE_EQUAL( asset::from_string("0 RAM").get_symbol(), r0.get_symbol() ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000").get_symbol(), e0.get_symbol() ); + + const asset payment = core_sym::from_string("10000000.0000"); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", payment ) ); + uint64_t bytes1 = get_total_stake( "alice1111111" )["ram_bytes"].as_uint64(); + + const int64_t fee = (payment.get_amount() + 199) / 200; + const double net_payment = payment.get_amount() - fee; + const int64_t expected_delta = net_payment * r0.get_amount() / ( net_payment + e0.get_amount() ); + + BOOST_REQUIRE_EQUAL( expected_delta, bytes1 - bytes0 ); + } + + { + transfer( config::system_account_name, N(bob111111111), core_sym::from_string("100000.0000"), config::system_account_name ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must reserve a positive amount"), + buyrambytes( "bob111111111", "bob111111111", 1 ) ); + + uint64_t bytes0 = get_total_stake( "bob111111111" )["ram_bytes"].as_uint64(); + BOOST_REQUIRE_EQUAL( success(), buyrambytes( "bob111111111", "bob111111111", 1024 ) ); + uint64_t bytes1 = get_total_stake( "bob111111111" )["ram_bytes"].as_uint64(); + BOOST_REQUIRE( within_one( 1024, bytes1 - bytes0 ) ); + + BOOST_REQUIRE_EQUAL( success(), buyrambytes( "bob111111111", "bob111111111", 1024 * 1024) ); + uint64_t bytes2 = get_total_stake( "bob111111111" )["ram_bytes"].as_uint64(); + BOOST_REQUIRE( within_one( 1024 * 1024, bytes2 - bytes1 ) ); + } } FC_LOG_AND_RETHROW() @@ -188,14 +242,12 @@ BOOST_FIXTURE_TEST_CASE( stake_unstake, eosio_system_tester ) try { BOOST_FIXTURE_TEST_CASE( stake_unstake_with_transfer, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "eosio", core_sym::from_string("1000.0000"), config::system_account_name ); - issue( "eosio.stake", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), get_balance( "alice1111111" ) ); //eosio stakes for alice with transfer flag transfer( "eosio", "bob111111111", core_sym::from_string("1000.0000"), "eosio" ); - BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( "bob111111111", "alice1111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( N(bob111111111), N(alice1111111), core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); //check that alice has both bandwidth and voting power auto total = get_total_stake("alice1111111"); @@ -236,7 +288,7 @@ BOOST_FIXTURE_TEST_CASE( stake_unstake_with_transfer, eosio_system_tester ) try REQUIRE_MATCHING_OBJECT( voter( "alice1111111", core_sym::from_string("0.0000")), get_voter_info( "alice1111111" ) ); // Now alice stakes to bob with transfer flag - BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( "alice1111111", "bob111111111", core_sym::from_string("100.0000"), core_sym::from_string("100.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( N(alice1111111), N(bob111111111), core_sym::from_string("100.0000"), core_sym::from_string("100.0000") ) ); } FC_LOG_AND_RETHROW() @@ -247,7 +299,7 @@ BOOST_FIXTURE_TEST_CASE( stake_to_self_with_transfer, eosio_system_tester ) try transfer( "eosio", "alice1111111", core_sym::from_string("1000.0000"), "eosio" ); BOOST_REQUIRE_EQUAL( wasm_assert_msg("cannot use transfer flag if delegating to self"), - stake_with_transfer( "alice1111111", "alice1111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) + stake_with_transfer( N(alice1111111), N(alice1111111), core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); } FC_LOG_AND_RETHROW() @@ -255,14 +307,11 @@ BOOST_FIXTURE_TEST_CASE( stake_to_self_with_transfer, eosio_system_tester ) try BOOST_FIXTURE_TEST_CASE( stake_while_pending_refund, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "eosio", core_sym::from_string("1000.0000"), config::system_account_name ); - issue( "eosio.stake", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), get_balance( "alice1111111" ) ); //eosio stakes for alice with transfer flag - transfer( "eosio", "bob111111111", core_sym::from_string("1000.0000"), "eosio" ); - BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( "bob111111111", "alice1111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( N(bob111111111), N(alice1111111), core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); //check that alice has both bandwidth and voting power auto total = get_total_stake("alice1111111"); @@ -303,14 +352,14 @@ BOOST_FIXTURE_TEST_CASE( stake_while_pending_refund, eosio_system_tester ) try { REQUIRE_MATCHING_OBJECT( voter( "alice1111111", core_sym::from_string("0.0000")), get_voter_info( "alice1111111" ) ); // Now alice stakes to bob with transfer flag - BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( "alice1111111", "bob111111111", core_sym::from_string("100.0000"), core_sym::from_string("100.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( N(alice1111111), N(bob111111111), core_sym::from_string("100.0000"), core_sym::from_string("100.0000") ) ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( fail_without_auth, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "eosio", "alice1111111", core_sym::from_string("2000.0000"), core_sym::from_string("1000.0000") ) ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", core_sym::from_string("10.0000"), core_sym::from_string("10.0000") ) ); @@ -341,7 +390,7 @@ BOOST_FIXTURE_TEST_CASE( fail_without_auth, eosio_system_tester ) try { BOOST_FIXTURE_TEST_CASE( stake_negative, eosio_system_tester ) try { - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( wasm_assert_msg("must stake a positive amount"), stake( "alice1111111", core_sym::from_string("-0.0001"), core_sym::from_string("0.0000") ) @@ -365,7 +414,7 @@ BOOST_FIXTURE_TEST_CASE( stake_negative, eosio_system_tester ) try { BOOST_FIXTURE_TEST_CASE( unstake_negative, eosio_system_tester ) try { - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", core_sym::from_string("200.0001"), core_sym::from_string("100.0001") ) ); @@ -396,7 +445,7 @@ BOOST_FIXTURE_TEST_CASE( unstake_negative, eosio_system_tester ) try { BOOST_FIXTURE_TEST_CASE( unstake_more_than_at_stake, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); auto total = get_total_stake( "alice1111111" ); @@ -428,7 +477,7 @@ BOOST_FIXTURE_TEST_CASE( unstake_more_than_at_stake, eosio_system_tester ) try { BOOST_FIXTURE_TEST_CASE( delegate_to_another_user, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake ( "alice1111111", "bob111111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); @@ -450,7 +499,7 @@ BOOST_FIXTURE_TEST_CASE( delegate_to_another_user, eosio_system_tester ) try { unstake( "bob111111111", core_sym::from_string("10.0000"), core_sym::from_string("0.0000") ) ); - issue( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "bob111111111", core_sym::from_string("20.0000"), core_sym::from_string("10.0000") ) ); total = get_total_stake( "bob111111111" ); BOOST_REQUIRE_EQUAL( core_sym::from_string("230.0000"), total["net_weight"].as()); @@ -484,7 +533,7 @@ BOOST_FIXTURE_TEST_CASE( delegate_to_another_user, eosio_system_tester ) try { BOOST_FIXTURE_TEST_CASE( stake_unstake_separate, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( core_sym::from_string("1000.0000"), get_balance( "alice1111111" ) ); //everything at once @@ -522,7 +571,7 @@ BOOST_FIXTURE_TEST_CASE( stake_unstake_separate, eosio_system_tester ) try { BOOST_FIXTURE_TEST_CASE( adding_stake_partial_unstake, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); REQUIRE_MATCHING_OBJECT( voter( "alice1111111", core_sym::from_string("300.0000") ), get_voter_info( "alice1111111" ) ); @@ -563,7 +612,7 @@ BOOST_FIXTURE_TEST_CASE( adding_stake_partial_unstake, eosio_system_tester ) try BOOST_FIXTURE_TEST_CASE( stake_from_refund, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); auto total = get_total_stake( "alice1111111" ); @@ -586,7 +635,7 @@ BOOST_FIXTURE_TEST_CASE( stake_from_refund, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( core_sym::from_string("60.0000"), total["cpu_weight"].as()); REQUIRE_MATCHING_OBJECT( voter( "alice1111111", core_sym::from_string("250.0000") ), get_voter_info( "alice1111111" ) ); BOOST_REQUIRE_EQUAL( core_sym::from_string("600.0000"), get_balance( "alice1111111" ) ); - auto refund = get_refund_request( "alice1111111" ); + auto refund = get_refund_request( N(alice1111111) ); BOOST_REQUIRE_EQUAL( core_sym::from_string("100.0000"), refund["net_amount"].as() ); BOOST_REQUIRE_EQUAL( core_sym::from_string( "50.0000"), refund["cpu_amount"].as() ); //XXX auto request_time = refund["request_time"].as_int64(); @@ -598,7 +647,7 @@ BOOST_FIXTURE_TEST_CASE( stake_from_refund, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( core_sym::from_string("60.0000"), total["cpu_weight"].as()); REQUIRE_MATCHING_OBJECT( voter( "alice1111111", core_sym::from_string("350.0000") ), get_voter_info( "alice1111111" ) ); BOOST_REQUIRE_EQUAL( core_sym::from_string("500.0000"), get_balance( "alice1111111" ) ); - refund = get_refund_request( "alice1111111" ); + refund = get_refund_request( N(alice1111111) ); BOOST_REQUIRE_EQUAL( core_sym::from_string("100.0000"), refund["net_amount"].as() ); BOOST_REQUIRE_EQUAL( core_sym::from_string( "50.0000"), refund["cpu_amount"].as() ); @@ -607,7 +656,7 @@ BOOST_FIXTURE_TEST_CASE( stake_from_refund, eosio_system_tester ) try { total = get_total_stake( "alice1111111" ); BOOST_REQUIRE_EQUAL( core_sym::from_string("160.0000"), total["net_weight"].as()); BOOST_REQUIRE_EQUAL( core_sym::from_string("85.0000"), total["cpu_weight"].as()); - refund = get_refund_request( "alice1111111" ); + refund = get_refund_request( N(alice1111111) ); BOOST_REQUIRE_EQUAL( core_sym::from_string("50.0000"), refund["net_amount"].as() ); BOOST_REQUIRE_EQUAL( core_sym::from_string("25.0000"), refund["cpu_amount"].as() ); //request time should stay the same @@ -621,7 +670,7 @@ BOOST_FIXTURE_TEST_CASE( stake_from_refund, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( core_sym::from_string("210.0000"), total["net_weight"].as()); BOOST_REQUIRE_EQUAL( core_sym::from_string("110.0000"), total["cpu_weight"].as()); //pending refund should be removed - refund = get_refund_request( "alice1111111" ); + refund = get_refund_request( N(alice1111111) ); BOOST_TEST_REQUIRE( refund.is_null() ); //balance should stay the same BOOST_REQUIRE_EQUAL( core_sym::from_string("500.0000"), get_balance( "alice1111111" ) ); @@ -632,7 +681,7 @@ BOOST_FIXTURE_TEST_CASE( stake_from_refund, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( core_sym::from_string("10.0000"), total["net_weight"].as()); BOOST_REQUIRE_EQUAL( core_sym::from_string("10.0000"), total["cpu_weight"].as()); BOOST_REQUIRE_EQUAL( core_sym::from_string("500.0000"), get_balance( "alice1111111" ) ); - refund = get_refund_request( "alice1111111" ); + refund = get_refund_request( N(alice1111111) ); BOOST_REQUIRE_EQUAL( core_sym::from_string("200.0000"), refund["net_amount"].as() ); BOOST_REQUIRE_EQUAL( core_sym::from_string("100.0000"), refund["cpu_amount"].as() ); @@ -642,7 +691,7 @@ BOOST_FIXTURE_TEST_CASE( stake_from_refund, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( core_sym::from_string("310.0000"), total["net_weight"].as()); BOOST_REQUIRE_EQUAL( core_sym::from_string("210.0000"), total["cpu_weight"].as()); REQUIRE_MATCHING_OBJECT( voter( "alice1111111", core_sym::from_string("700.0000") ), get_voter_info( "alice1111111" ) ); - refund = get_refund_request( "alice1111111" ); + refund = get_refund_request( N(alice1111111) ); BOOST_TEST_REQUIRE( refund.is_null() ); //200 core tokens should be taken from alice's account BOOST_REQUIRE_EQUAL( core_sym::from_string("300.0000"), get_balance( "alice1111111" ) ); @@ -652,7 +701,7 @@ BOOST_FIXTURE_TEST_CASE( stake_from_refund, eosio_system_tester ) try { BOOST_FIXTURE_TEST_CASE( stake_to_another_user_not_from_refund, eosio_system_tester ) try { cross_15_percent_threshold(); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); auto total = get_total_stake( "alice1111111" ); @@ -665,7 +714,7 @@ BOOST_FIXTURE_TEST_CASE( stake_to_another_user_not_from_refund, eosio_system_tes //unstake BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", core_sym::from_string("200.0000"), core_sym::from_string("100.0000") ) ); - auto refund = get_refund_request( "alice1111111" ); + auto refund = get_refund_request( N(alice1111111) ); BOOST_REQUIRE_EQUAL( core_sym::from_string("200.0000"), refund["net_amount"].as() ); BOOST_REQUIRE_EQUAL( core_sym::from_string("100.0000"), refund["cpu_amount"].as() ); //auto orig_request_time = refund["request_time"].as_int64(); @@ -677,7 +726,7 @@ BOOST_FIXTURE_TEST_CASE( stake_to_another_user_not_from_refund, eosio_system_tes BOOST_REQUIRE_EQUAL( core_sym::from_string("110.0000"), total["cpu_weight"].as()); //stake should be taken from alices' balance, and refund request should stay the same BOOST_REQUIRE_EQUAL( core_sym::from_string("400.0000"), get_balance( "alice1111111" ) ); - refund = get_refund_request( "alice1111111" ); + refund = get_refund_request( N(alice1111111) ); BOOST_REQUIRE_EQUAL( core_sym::from_string("200.0000"), refund["net_amount"].as() ); BOOST_REQUIRE_EQUAL( core_sym::from_string("100.0000"), refund["cpu_amount"].as() ); //BOOST_REQUIRE_EQUAL( orig_request_time, refund["request_time"].as_int64() ); @@ -686,7 +735,7 @@ BOOST_FIXTURE_TEST_CASE( stake_to_another_user_not_from_refund, eosio_system_tes // Tests for voting BOOST_FIXTURE_TEST_CASE( producer_register_unregister, eosio_system_tester ) try { - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); //fc::variant params = producer_parameters_example(1); auto key = fc::crypto::public_key( std::string("EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV") ); @@ -755,10 +804,202 @@ BOOST_FIXTURE_TEST_CASE( producer_register_unregister, eosio_system_tester ) try } FC_LOG_AND_RETHROW() +BOOST_FIXTURE_TEST_CASE( producer_wtmsig, eosio_system_tester ) try { + cross_15_percent_threshold(); + + BOOST_REQUIRE_EQUAL( control->active_producers().version, 0u ); + + issue_and_transfer( N(alice1111111), core_sym::from_string("200000000.0000"), config::system_account_name ); + block_signing_authority_v0 alice_signing_authority; + alice_signing_authority.threshold = 1; + alice_signing_authority.keys.push_back( {.key = get_public_key( N(alice1111111), "bs1"), .weight = 1} ); + alice_signing_authority.keys.push_back( {.key = get_public_key( N(alice1111111), "bs2"), .weight = 1} ); + producer_authority alice_producer_authority = {.producer_name = N(alice1111111), .authority = alice_signing_authority}; + BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer2), mvo() + ("producer", "alice1111111") + ("producer_authority", alice_producer_authority.get_abi_variant()["authority"]) + ("url", "http://block.one") + ("location", 0 ) + ) + ); + BOOST_REQUIRE_EQUAL( success(), stake( N(alice1111111), core_sym::from_string("100000000.0000"), core_sym::from_string("100000000.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), vote( N(alice1111111), { N(alice1111111) } ) ); + + block_signing_private_keys.emplace(get_public_key(N(alice1111111), "bs1"), get_private_key(N(alice1111111), "bs1")); + + auto alice_prod_info = get_producer_info( N(alice1111111) ); + wdump((alice_prod_info)); + BOOST_REQUIRE_EQUAL( alice_prod_info["is_active"], true ); + + produce_block(); + produce_block( fc::minutes(2) ); + produce_blocks(2); + BOOST_REQUIRE_EQUAL( control->active_producers().version, 1u ); + produce_block(); + BOOST_REQUIRE_EQUAL( control->pending_block_producer(), N(alice1111111) ); + produce_block(); + + alice_signing_authority.threshold = 0; + alice_producer_authority.authority = alice_signing_authority; + + // Ensure an authority with a threshold of 0 is rejected. + BOOST_REQUIRE_EQUAL( error("assertion failure with message: invalid producer authority"), + push_action( N(alice1111111), N(regproducer2), mvo() + ("producer", "alice1111111") + ("producer_authority", alice_producer_authority.get_abi_variant()["authority"]) + ("url", "http://block.one") + ("location", 0 ) + ) + ); + + // Ensure an authority that is not satisfiable is rejected. + alice_signing_authority.threshold = 3; + alice_producer_authority.authority = alice_signing_authority; + BOOST_REQUIRE_EQUAL( error("assertion failure with message: invalid producer authority"), + push_action( N(alice1111111), N(regproducer2), mvo() + ("producer", "alice1111111") + ("producer_authority", alice_producer_authority.get_abi_variant()["authority"]) + ("url", "http://block.one") + ("location", 0 ) + ) + ); + + // Ensure an authority with duplicate keys is rejected. + alice_signing_authority.threshold = 1; + alice_signing_authority.keys[1] = alice_signing_authority.keys[0]; + alice_producer_authority.authority = alice_signing_authority; + BOOST_REQUIRE_EQUAL( error("assertion failure with message: invalid producer authority"), + push_action( N(alice1111111), N(regproducer2), mvo() + ("producer", "alice1111111") + ("producer_authority", alice_producer_authority.get_abi_variant()["authority"]) + ("url", "http://block.one") + ("location", 0 ) + ) + ); + + // However, an authority with an invalid key is okay. + alice_signing_authority.keys[1] = {}; + alice_producer_authority.authority = alice_signing_authority; + BOOST_REQUIRE_EQUAL( success(), + push_action( N(alice1111111), N(regproducer2), mvo() + ("producer", "alice1111111") + ("producer_authority", alice_producer_authority.get_abi_variant()["authority"]) + ("url", "http://block.one") + ("location", 0 ) + ) + ); + + produce_block(); + produce_block( fc::minutes(2) ); + produce_blocks(2); + BOOST_REQUIRE_EQUAL( control->active_producers().version, 2u ); + produce_block(); + BOOST_REQUIRE_EQUAL( control->pending_block_producer(), N(alice1111111) ); + produce_block(); + +} FC_LOG_AND_RETHROW() + +BOOST_FIXTURE_TEST_CASE( producer_wtmsig_transition, eosio_system_tester ) try { + cross_15_percent_threshold(); + + BOOST_REQUIRE_EQUAL( control->active_producers().version, 0u ); + + set_code( config::system_account_name, contracts::util::system_wasm_v1_8() ); + set_abi( config::system_account_name, contracts::util::system_abi_v1_8().data() ); + + issue_and_transfer( N(alice1111111), core_sym::from_string("200000000.0000"), config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() + ("producer", "alice1111111") + ("producer_key", get_public_key( N(alice1111111), "active") ) + ("url","") + ("location", 0) + ) + ); + BOOST_REQUIRE_EQUAL( success(), stake( N(alice1111111), core_sym::from_string("100000000.0000"), core_sym::from_string("100000000.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), vote( N(alice1111111), { N(alice1111111) } ) ); + + //auto alice_prod_info1 = get_producer_info( N(alice1111111) ); + //wdump((alice_prod_info1)); + + produce_block(); + produce_block( fc::minutes(2) ); + produce_blocks(2); + BOOST_REQUIRE_EQUAL( control->active_producers().version, 1u ); + + const auto schedule_update1 = get_global_state()["last_producer_schedule_update"]; + + const auto& rlm = control->get_resource_limits_manager(); + + auto alice_initial_ram_usage = rlm.get_account_ram_usage(N(alice1111111)); + + set_code( config::system_account_name, contracts::system_wasm() ); + set_abi( config::system_account_name, contracts::system_abi().data() ); + produce_block(); + BOOST_REQUIRE_EQUAL( control->pending_block_producer(), N(alice1111111) ); + + auto alice_prod_info2 = get_producer_info( N(alice1111111) ); + BOOST_REQUIRE_EQUAL( alice_prod_info2["is_active"], true ); + + produce_block( fc::minutes(2) ); + const auto schedule_update2 = get_global_state()["last_producer_schedule_update"]; + BOOST_REQUIRE( schedule_update1 < schedule_update2 ); // Ensure last_producer_schedule_update is increasing. + + // Producing the above block would trigger the bug in v1.9.0 that sets the default block_signing_authority + // in the producer object of the currently active producer alice1111111. + // However, starting in v1.9.1, the producer object does not have a default block_signing_authority added to the + // serialization of the producer object if it was not already present in the binary extension field + // producer_authority to begin with. This is verified below by ensuring the RAM usage of alice (who pays for the + // producer object) does not increase. + + auto alice_ram_usage = rlm.get_account_ram_usage(N(alice1111111)); + BOOST_CHECK_EQUAL( alice_initial_ram_usage, alice_ram_usage ); + + auto alice_prod_info3 = get_producer_info( N(alice1111111) ); + if( alice_prod_info3.get_object().contains("producer_authority") ) { + BOOST_CHECK_EQUAL( alice_prod_info3["producer_authority"][1]["threshold"], 0 ); + } + + produce_block( fc::minutes(2) ); + const auto schedule_update3 = get_global_state()["last_producer_schedule_update"]; + + // The bug in v1.9.0 would cause alice to have an invalid producer authority (the default block_signing_authority). + // The v1.9.0 system contract would have attempted to set a proposed producer schedule including this invalid + // authority which would be rejected by the EOSIO native system and cause the onblock transaction to continue to fail. + // This could be observed by noticing that last_producer_schedule_update was not being updated even though it should. + // However, starting in v1.9.1, update_elected_producers is smarter about the producer schedule it constructs to + // propose to the system. It will recognize the default constructed authority (which shouldn't be created by the + // v1.9.1 system contract but may still exist in the tables if it was constructed by the buggy v1.9.0 system contract) + // and instead resort to constructing the block signing authority from the single producer key in the table. + // So newer system contracts should see onblock continue to function, which is verified by the check below. + + BOOST_CHECK( schedule_update2 < schedule_update3 ); // Ensure last_producer_schedule_update is increasing. + + // But even if the buggy v1.9.0 system contract was running, it should always still be possible to recover + // by having the producer with the invalid authority simply call regproducer or regproducer2 to correct their + // block signing authority. + + BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() + ("producer", "alice1111111") + ("producer_key", get_public_key( N(alice1111111), "active") ) + ("url","") + ("location", 0) + ) + ); + + produce_block(); + produce_block( fc::minutes(2) ); + + auto alice_prod_info4 = get_producer_info( N(alice1111111) ); + BOOST_REQUIRE_EQUAL( alice_prod_info4["is_active"], true ); + const auto schedule_update4 = get_global_state()["last_producer_schedule_update"]; + BOOST_REQUIRE( schedule_update2 < schedule_update4 ); + +} FC_LOG_AND_RETHROW() + BOOST_FIXTURE_TEST_CASE( vote_for_producer, eosio_system_tester, * boost::unit_test::tolerance(1e+5) ) try { cross_15_percent_threshold(); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); fc::variant params = producer_parameters_example(1); BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() ("producer", "alice1111111") @@ -772,8 +1013,8 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, eosio_system_tester, * boost::unit_t BOOST_REQUIRE_EQUAL( 0, prod["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( "http://block.one", prod["url"].as_string() ); - issue( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); - issue( "carol1111111", core_sym::from_string("3000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); + issue_and_transfer( "carol1111111", core_sym::from_string("3000.0000"), config::system_account_name ); //bob111111111 makes stake BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("11.0000"), core_sym::from_string("0.1111") ) ); @@ -803,7 +1044,7 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, eosio_system_tester, * boost::unit_t //bob111111111 increases his stake BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("33.0000"), core_sym::from_string("0.3333") ) ); //alice1111111 stake with transfer to bob111111111 - BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( "alice1111111", "bob111111111", core_sym::from_string("22.0000"), core_sym::from_string("0.2222") ) ); + BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( N(alice1111111), N(bob111111111), core_sym::from_string("22.0000"), core_sym::from_string("0.2222") ) ); //should increase alice1111111's total_votes prod = get_producer_info( "alice1111111" ); BOOST_TEST_REQUIRE( stake2votes(core_sym::from_string("88.8888")) == prod["total_votes"].as_double() ); @@ -840,16 +1081,16 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, eosio_system_tester, * boost::unit_t BOOST_FIXTURE_TEST_CASE( unregistered_producer_voting, eosio_system_tester, * boost::unit_test::tolerance(1e+5) ) try { - issue( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("13.0000"), core_sym::from_string("0.5791") ) ); REQUIRE_MATCHING_OBJECT( voter( "bob111111111", core_sym::from_string("13.5791") ), get_voter_info( "bob111111111" ) ); //bob111111111 should not be able to vote for alice1111111 who is not a producer - BOOST_REQUIRE_EQUAL( wasm_assert_msg( "producer is not registered" ), + BOOST_REQUIRE_EQUAL( wasm_assert_msg( "producer alice1111111 is not registered" ), vote( N(bob111111111), { N(alice1111111) } ) ); //alice1111111 registers as a producer - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); fc::variant params = producer_parameters_example(1); BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() ("producer", "alice1111111") @@ -868,14 +1109,14 @@ BOOST_FIXTURE_TEST_CASE( unregistered_producer_voting, eosio_system_tester, * bo BOOST_REQUIRE_EQUAL( fc::crypto::public_key(), fc::crypto::public_key(prod["producer_key"].as_string()) ); //bob111111111 should not be able to vote for alice1111111 who is an unregistered producer - BOOST_REQUIRE_EQUAL( wasm_assert_msg( "producer is not currently registered" ), + BOOST_REQUIRE_EQUAL( wasm_assert_msg( "producer alice1111111 is not currently registered" ), vote( N(bob111111111), { N(alice1111111) } ) ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( more_than_30_producer_voting, eosio_system_tester ) try { - issue( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("13.0000"), core_sym::from_string("0.5791") ) ); REQUIRE_MATCHING_OBJECT( voter( "bob111111111", core_sym::from_string("13.5791") ), get_voter_info( "bob111111111" ) ); @@ -887,12 +1128,12 @@ BOOST_FIXTURE_TEST_CASE( more_than_30_producer_voting, eosio_system_tester ) try BOOST_FIXTURE_TEST_CASE( vote_same_producer_30_times, eosio_system_tester ) try { - issue( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("50.0000"), core_sym::from_string("50.0000") ) ); REQUIRE_MATCHING_OBJECT( voter( "bob111111111", core_sym::from_string("100.0000") ), get_voter_info( "bob111111111" ) ); //alice1111111 becomes a producer - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); fc::variant params = producer_parameters_example(1); BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() ("producer", "alice1111111") @@ -913,7 +1154,7 @@ BOOST_FIXTURE_TEST_CASE( vote_same_producer_30_times, eosio_system_tester ) try BOOST_FIXTURE_TEST_CASE( producer_keep_votes, eosio_system_tester, * boost::unit_test::tolerance(1e+5) ) try { - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); fc::variant params = producer_parameters_example(1); vector key = fc::raw::pack( get_public_key( N(alice1111111), "active" ) ); BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() @@ -925,7 +1166,7 @@ BOOST_FIXTURE_TEST_CASE( producer_keep_votes, eosio_system_tester, * boost::unit ); //bob111111111 makes stake - issue( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("2000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("13.0000"), core_sym::from_string("0.5791") ) ); REQUIRE_MATCHING_OBJECT( voter( "bob111111111", core_sym::from_string("13.5791") ), get_voter_info( "bob111111111" ) ); @@ -1002,7 +1243,7 @@ BOOST_FIXTURE_TEST_CASE( vote_for_two_producers, eosio_system_tester, * boost::u ); //carol1111111 votes for alice1111111 and bob111111111 - issue( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", core_sym::from_string("15.0005"), core_sym::from_string("5.0000") ) ); BOOST_REQUIRE_EQUAL( success(), vote( N(carol1111111), { N(alice1111111), N(bob111111111) } ) ); @@ -1020,7 +1261,7 @@ BOOST_FIXTURE_TEST_CASE( vote_for_two_producers, eosio_system_tester, * boost::u BOOST_TEST_REQUIRE( 0 == bob_info["total_votes"].as_double() ); //alice1111111 votes for herself and bob111111111 - issue( "alice1111111", core_sym::from_string("2.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("2.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", core_sym::from_string("1.0000"), core_sym::from_string("1.0000") ) ); BOOST_REQUIRE_EQUAL( success(), vote(N(alice1111111), { N(alice1111111), N(bob111111111) } ) ); @@ -1040,7 +1281,7 @@ BOOST_FIXTURE_TEST_CASE( proxy_register_unregister_keeps_stake, eosio_system_tes ("isproxy", true ) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) ), get_voter_info( "alice1111111" ) ); //unregister proxy BOOST_REQUIRE_EQUAL( success(), push_action(N(alice1111111), N(regproxy), mvo() @@ -1051,14 +1292,14 @@ BOOST_FIXTURE_TEST_CASE( proxy_register_unregister_keeps_stake, eosio_system_tes REQUIRE_MATCHING_OBJECT( voter( "alice1111111" ), get_voter_info( "alice1111111" ) ); //stake and then register as a proxy - issue( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("200.0002"), core_sym::from_string("100.0001") ) ); BOOST_REQUIRE_EQUAL( success(), push_action( N(bob111111111), N(regproxy), mvo() ("proxy", "bob111111111") ("isproxy", true) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "bob111111111" )( "staked", 3000003 ), get_voter_info( "bob111111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(bob111111111) )( "staked", 3000003 ), get_voter_info( "bob111111111" ) ); //unrgister and check that stake is still in place BOOST_REQUIRE_EQUAL( success(), push_action( N(bob111111111), N(regproxy), mvo() ("proxy", "bob111111111") @@ -1073,10 +1314,10 @@ BOOST_FIXTURE_TEST_CASE( proxy_register_unregister_keeps_stake, eosio_system_tes ("isproxy", true) ) ); - issue( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", core_sym::from_string("246.0002"), core_sym::from_string("531.0001") ) ); //check that both proxy flag and stake a correct - REQUIRE_MATCHING_OBJECT( proxy( "carol1111111" )( "staked", 7770003 ), get_voter_info( "carol1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(carol1111111) )( "staked", 7770003 ), get_voter_info( "carol1111111" ) ); //unregister BOOST_REQUIRE_EQUAL( success(), push_action( N(carol1111111), N(regproxy), mvo() @@ -1097,26 +1338,26 @@ BOOST_FIXTURE_TEST_CASE( proxy_stake_unstake_keeps_proxy_flag, eosio_system_test ("isproxy", true) ) ); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" ), get_voter_info( "alice1111111" ) ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) ), get_voter_info( "alice1111111" ) ); //stake BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", core_sym::from_string("100.0000"), core_sym::from_string("50.0000") ) ); //check that account is still a proxy - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "staked", 1500000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) )( "staked", 1500000 ), get_voter_info( "alice1111111" ) ); //stake more BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", core_sym::from_string("30.0000"), core_sym::from_string("20.0000") ) ); //check that account is still a proxy - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )("staked", 2000000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) )("staked", 2000000 ), get_voter_info( "alice1111111" ) ); //unstake more BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", core_sym::from_string("65.0000"), core_sym::from_string("35.0000") ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )("staked", 1000000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) )("staked", 1000000 ), get_voter_info( "alice1111111" ) ); //unstake the rest BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", core_sym::from_string("65.0000"), core_sym::from_string("35.0000") ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "staked", 0 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) )( "staked", 0 ), get_voter_info( "alice1111111" ) ); } FC_LOG_AND_RETHROW() @@ -1125,9 +1366,9 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, eosio_system_tester, * cross_15_percent_threshold(); create_accounts_with_resources( { N(defproducer1), N(defproducer2), N(defproducer3) } ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer1", 1) ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer2", 2) ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer3", 3) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer1), 1) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer2), 2) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer3), 3) ); //register as a proxy BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproxy), mvo() @@ -1137,10 +1378,10 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, eosio_system_tester, * ); //accumulate proxied votes - issue( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("100.0002"), core_sym::from_string("50.0001") ) ); BOOST_REQUIRE_EQUAL( success(), vote(N(bob111111111), vector(), N(alice1111111) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes(core_sym::from_string("150.0003")) ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) )( "proxied_vote_weight", stake2votes(core_sym::from_string("150.0003")) ), get_voter_info( "alice1111111" ) ); //vote for producers BOOST_REQUIRE_EQUAL( success(), vote(N(alice1111111), { N(defproducer1), N(defproducer2) } ) ); @@ -1176,7 +1417,7 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, eosio_system_tester, * BOOST_TEST_REQUIRE( stake2votes(core_sym::from_string("150.0003")) == get_producer_info( "defproducer3" )["total_votes"].as_double() ); //stake increase by proxy itself affects producers - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", core_sym::from_string("30.0001"), core_sym::from_string("20.0001") ) ); BOOST_REQUIRE_EQUAL( stake2votes(core_sym::from_string("200.0005")), get_producer_info( "defproducer1" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer2" )["total_votes"].as_double() ); @@ -1192,7 +1433,7 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, eosio_system_tester, * BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::tolerance(1e-10)) try { - const double continuous_rate = 4.879 / 100.; + const double continuous_rate = std::log1p(double(0.05)); const double usecs_per_year = 52 * 7 * 24 * 3600 * 1000000ll; const double secs_per_year = 52 * 7 * 24 * 3600; @@ -1261,10 +1502,10 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t BOOST_REQUIRE_EQUAL(int64_t( ( initial_supply.get_amount() * double(secs_between_fills) * continuous_rate ) / secs_per_year ), supply.get_amount() - initial_supply.get_amount()); - BOOST_REQUIRE_EQUAL(int64_t( ( initial_supply.get_amount() * double(secs_between_fills) * (4. * continuous_rate/ 5.) / secs_per_year ) ), - savings - initial_savings); - BOOST_REQUIRE_EQUAL(int64_t( ( initial_supply.get_amount() * double(secs_between_fills) * (0.25 * continuous_rate/ 5.) / secs_per_year ) ), - balance.get_amount() - initial_balance.get_amount()); + BOOST_REQUIRE(within_one(int64_t( ( initial_supply.get_amount() * double(secs_between_fills) * (4. * continuous_rate/ 5.) / secs_per_year ) ), + savings - initial_savings)); + BOOST_REQUIRE(within_one(int64_t( ( initial_supply.get_amount() * double(secs_between_fills) * (0.25 * continuous_rate/ 5.) / secs_per_year ) ), + balance.get_amount() - initial_balance.get_amount())); int64_t from_perblock_bucket = int64_t( initial_supply.get_amount() * double(secs_between_fills) * (0.25 * continuous_rate/ 5.) / secs_per_year ) ; int64_t from_pervote_bucket = int64_t( initial_supply.get_amount() * double(secs_between_fills) * (0.75 * continuous_rate/ 5.) / secs_per_year ) ; @@ -1334,12 +1575,12 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t BOOST_REQUIRE_EQUAL(claim_time, microseconds_since_epoch_of_iso_string( prod["last_claim_time"] )); auto usecs_between_fills = claim_time - initial_claim_time; - BOOST_REQUIRE_EQUAL(int64_t( ( double(initial_supply.get_amount()) * double(usecs_between_fills) * continuous_rate / usecs_per_year ) ), - supply.get_amount() - initial_supply.get_amount()); + BOOST_REQUIRE_EQUAL( int64_t( initial_supply.get_amount() * double(usecs_between_fills) * continuous_rate / usecs_per_year ), + supply.get_amount() - initial_supply.get_amount() ); BOOST_REQUIRE_EQUAL( (supply.get_amount() - initial_supply.get_amount()) - (supply.get_amount() - initial_supply.get_amount()) / 5, - savings - initial_savings); + savings - initial_savings ); - int64_t to_producer = int64_t( (double(initial_supply.get_amount()) * double(usecs_between_fills) * continuous_rate) / usecs_per_year ) / 5; + int64_t to_producer = int64_t( initial_supply.get_amount() * double(usecs_between_fills) * continuous_rate / usecs_per_year ) / 5; int64_t to_perblock_bucket = to_producer / 4; int64_t to_pervote_bucket = to_producer - to_perblock_bucket; @@ -1382,14 +1623,144 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t } } FC_LOG_AND_RETHROW() +BOOST_FIXTURE_TEST_CASE(change_inflation, eosio_system_tester) try { -BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::unit_test::tolerance(1e-10)) try { + { + BOOST_REQUIRE_EQUAL( success(), + setinflation(0, 10000, 10000) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("annual_rate can't be negative"), + setinflation(-1, 10000, 10000) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("inflation_pay_factor must not be less than 10000"), + setinflation(1, 9999, 10000) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("votepay_factor must not be less than 10000"), + setinflation(1, 10000, 9999) ); + } + + { + const asset large_asset = core_sym::from_string("80.0000"); + create_account_with_resources( N(defproducera), config::system_account_name, core_sym::from_string("1.0000"), false, large_asset, large_asset ); + create_account_with_resources( N(defproducerb), config::system_account_name, core_sym::from_string("1.0000"), false, large_asset, large_asset ); + create_account_with_resources( N(defproducerc), config::system_account_name, core_sym::from_string("1.0000"), false, large_asset, large_asset ); + + create_account_with_resources( N(producvotera), config::system_account_name, core_sym::from_string("1.0000"), false, large_asset, large_asset ); + create_account_with_resources( N(producvoterb), config::system_account_name, core_sym::from_string("1.0000"), false, large_asset, large_asset ); + + BOOST_REQUIRE_EQUAL(success(), regproducer(N(defproducera))); + BOOST_REQUIRE_EQUAL(success(), regproducer(N(defproducerb))); + BOOST_REQUIRE_EQUAL(success(), regproducer(N(defproducerc))); + + produce_block(fc::hours(24)); + + transfer( config::system_account_name, "producvotera", core_sym::from_string("400000000.0000"), config::system_account_name); + BOOST_REQUIRE_EQUAL(success(), stake("producvotera", core_sym::from_string("100000000.0000"), core_sym::from_string("100000000.0000"))); + BOOST_REQUIRE_EQUAL(success(), vote( N(producvotera), { N(defproducera),N(defproducerb),N(defproducerc) })); + + auto run_for_1year = [this](int64_t annual_rate, int64_t inflation_pay_factor, int64_t votepay_factor) { + + double inflation = double(annual_rate)/double(10000); + + BOOST_REQUIRE_EQUAL(success(), setinflation( + annual_rate, + inflation_pay_factor, + votepay_factor + )); + + produce_block(fc::hours(24)); + const asset initial_supply = get_token_supply(); + const int64_t initial_savings = get_balance(N(eosio.saving)).get_amount(); + for (uint32_t i = 0; i < 7 * 52; ++i) { + produce_block(fc::seconds(8 * 3600)); + BOOST_REQUIRE_EQUAL(success(), push_action(N(defproducerc), N(claimrewards), mvo()("owner", "defproducerc"))); + produce_block(fc::seconds(8 * 3600)); + BOOST_REQUIRE_EQUAL(success(), push_action(N(defproducerb), N(claimrewards), mvo()("owner", "defproducerb"))); + produce_block(fc::seconds(8 * 3600)); + BOOST_REQUIRE_EQUAL(success(), push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera"))); + } + const asset final_supply = get_token_supply(); + const int64_t final_savings = get_balance(N(eosio.saving)).get_amount(); + + double computed_new_tokens = double(final_supply.get_amount() - initial_supply.get_amount()); + double theoretical_new_tokens = double(initial_supply.get_amount())*inflation; + double diff_new_tokens = std::abs(theoretical_new_tokens-computed_new_tokens); + + if( annual_rate > 0 ) { + //Error should be less than 0.3% + BOOST_REQUIRE( diff_new_tokens/theoretical_new_tokens < double(0.003) ); + } else { + BOOST_REQUIRE_EQUAL( computed_new_tokens, 0 ); + BOOST_REQUIRE_EQUAL( theoretical_new_tokens, 0 ); + } + + double savings_inflation = inflation - inflation * 10000 / inflation_pay_factor; + + double computed_savings_tokens = double(final_savings-initial_savings); + double theoretical_savings_tokens = double(initial_supply.get_amount())*savings_inflation; + double diff_savings_tokens = std::abs(theoretical_savings_tokens-computed_savings_tokens); + + if( annual_rate > 0 ) { + //Error should be less than 0.3% + BOOST_REQUIRE( diff_savings_tokens/theoretical_savings_tokens < double(0.003) ); + } else { + BOOST_REQUIRE_EQUAL( computed_savings_tokens, 0 ); + BOOST_REQUIRE_EQUAL( theoretical_savings_tokens, 0 ); + } + }; + + // 1% inflation for 1 year. 50% savings / 50% bp reward. 10000 / 50000 = 0.2 => 20% blockpay, 80% votepay + run_for_1year(100, 20000, 50000); + + // 3% inflation for 1 year. 66.6% savings / 33.33% bp reward. 10000/13333 = 0.75 => 75% blockpay, 25% votepay + run_for_1year(300, 30000, 13333); + + // 0% inflation for 1 year + run_for_1year(0, 30000, 50000); + } + +} FC_LOG_AND_RETHROW() + +BOOST_AUTO_TEST_CASE(extreme_inflation) try { + eosio_system_tester t(eosio_system_tester::setup_level::minimal); + symbol core_symbol{CORE_SYM}; + t.create_currency( N(eosio.token), config::system_account_name, asset((1ll << 62) - 1, core_symbol) ); + t.issue( asset(10000000000000, core_symbol) ); + t.deploy_contract(); + t.produce_block(); + t.create_account_with_resources(N(defproducera), config::system_account_name, core_sym::from_string("1.0000"), false); + BOOST_REQUIRE_EQUAL(t.success(), t.regproducer(N(defproducera))); + t.transfer( config::system_account_name, "defproducera", core_sym::from_string("200000000.0000"), config::system_account_name); + BOOST_REQUIRE_EQUAL(t.success(), t.stake("defproducera", core_sym::from_string("100000000.0000"), core_sym::from_string("100000000.0000"))); + BOOST_REQUIRE_EQUAL(t.success(), t.vote( N(defproducera), { N(defproducera) })); + t.produce_blocks(4); + t.produce_block(fc::hours(24)); + + BOOST_REQUIRE_EQUAL(t.success(), t.push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera"))); + t.produce_block(); + asset current_supply; + { + vector data = t.get_row_by_account( N(eosio.token), name(core_symbol.to_symbol_code().value), N(stat), account_name(core_symbol.to_symbol_code().value) ); + current_supply = t.token_abi_ser.binary_to_variant("currency_stats", data, abi_serializer::create_yield_function(eosio_system_tester::abi_serializer_max_time))["supply"].template as(); + } + t.issue( asset((1ll << 62) - 1, core_symbol) - current_supply ); + BOOST_REQUIRE_EQUAL(t.success(), t.setinflation(std::numeric_limits::max(), 50000, 40000)); + t.produce_block(); + + t.produce_block(fc::hours(10*24)); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("quantity exceeds available supply"), t.push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera"))); + + t.produce_block(fc::hours(11*24)); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("magnitude of asset amount must be less than 2^62"), t.push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera"))); - auto within_one = [](int64_t a, int64_t b) -> bool { return std::abs( a - b ) <= 1; }; + t.produce_block(fc::hours(24)); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("overflow in calculating new tokens to be issued; inflation rate is too high"), t.push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera"))); + BOOST_REQUIRE_EQUAL(t.success(), t.setinflation(500, 50000, 40000)); + BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("quantity exceeds available supply"), t.push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera"))); +} FC_LOG_AND_RETHROW() + +BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::unit_test::tolerance(1e-10)) try { const int64_t secs_per_year = 52 * 7 * 24 * 3600; const double usecs_per_year = secs_per_year * 1000000; - const double cont_rate = 4.879/100.; + const double cont_rate = std::log1p(double(0.05)); const asset net = core_sym::from_string("80.0000"); const asset cpu = core_sym::from_string("80.0000"); @@ -1529,11 +1900,11 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni BOOST_REQUIRE_EQUAL( int64_t(expected_supply_growth) - int64_t(expected_supply_growth)/5, savings - initial_savings ); - const int64_t expected_perblock_bucket = int64_t( double(initial_supply.get_amount()) * double(usecs_between_fills) * (0.25 * cont_rate/ 5.) / usecs_per_year ); - const int64_t expected_pervote_bucket = int64_t( double(initial_supply.get_amount()) * double(usecs_between_fills) * (0.75 * cont_rate/ 5.) / usecs_per_year ); + const int64_t expected_perblock_bucket = initial_supply.get_amount() * double(usecs_between_fills) * (0.25 * cont_rate/ 5.) / usecs_per_year; + const int64_t expected_pervote_bucket = initial_supply.get_amount() * double(usecs_between_fills) * (0.75 * cont_rate/ 5.) / usecs_per_year; const int64_t from_perblock_bucket = initial_unpaid_blocks * expected_perblock_bucket / initial_tot_unpaid_blocks ; - const int64_t from_pervote_bucket = int64_t( vote_shares[prod_index] * expected_pervote_bucket); + const int64_t from_pervote_bucket = vote_shares[prod_index] * expected_pervote_bucket; BOOST_REQUIRE( 1 >= abs(int32_t(initial_tot_unpaid_blocks - tot_unpaid_blocks) - int32_t(initial_unpaid_blocks - unpaid_blocks)) ); @@ -2287,7 +2658,7 @@ BOOST_AUTO_TEST_CASE(votepay_transition2, * boost::unit_test::tolerance(1e-10)) const auto& accnt = t.control->db().get( config::system_account_name ); abi_def abi; BOOST_REQUIRE_EQUAL(abi_serializer::to_abi(accnt.abi, abi), true); - t.abi_ser.set_abi(abi, eosio_system_tester::abi_serializer_max_time); + t.abi_ser.set_abi(abi, abi_serializer::create_yield_function(eosio_system_tester::abi_serializer_max_time)); } const asset net = old_core_from_string("80.0000"); const asset cpu = old_core_from_string("80.0000"); @@ -2361,9 +2732,9 @@ BOOST_FIXTURE_TEST_CASE(producers_upgrade_system_contract, eosio_system_tester) action act; act.account = N(eosio.msig); act.name = name; - act.data = msig_abi_ser.variant_to_binary( action_type_name, data, abi_serializer_max_time ); + act.data = msig_abi_ser.variant_to_binary( action_type_name, data, abi_serializer::create_yield_function(abi_serializer_max_time) ); - return base_tester::push_action( std::move(act), auth ? uint64_t(signer) : signer == N(bob111111111) ? N(alice1111111) : N(bob111111111) ); + return base_tester::push_action( std::move(act), (auth ? signer : signer == N(bob111111111) ? N(alice1111111) : N(bob111111111)).to_uint64_t() ); }; // test begins vector prod_perms; @@ -2400,7 +2771,7 @@ BOOST_FIXTURE_TEST_CASE(producers_upgrade_system_contract, eosio_system_tester) ) }) ); - abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer_max_time); + abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer::create_yield_function(abi_serializer_max_time)); } BOOST_REQUIRE_EQUAL(success(), push_action_msig( N(alice1111111), N(propose), mvo() @@ -2439,7 +2810,12 @@ BOOST_FIXTURE_TEST_CASE(producers_upgrade_system_contract, eosio_system_tester) ); transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); + BOOST_REQUIRE_EQUAL(success(), push_action_msig( N(alice1111111), N(exec), mvo() ("proposer", "alice1111111") ("proposal_name", "upgrade1") @@ -2555,9 +2931,9 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, eosio_system cross_15_percent_threshold(); create_accounts_with_resources( { N(donald111111), N(defproducer1), N(defproducer2), N(defproducer3) } ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer1", 1) ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer2", 2) ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer3", 3) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer1), 1) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer2), 2) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer3), 3) ); //alice1111111 becomes a producer BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproxy), mvo() @@ -2565,10 +2941,10 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, eosio_system ("isproxy", true) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) ), get_voter_info( "alice1111111" ) ); //alice1111111 makes stake and votes - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", core_sym::from_string("30.0001"), core_sym::from_string("20.0001") ) ); BOOST_REQUIRE_EQUAL( success(), vote( N(alice1111111), { N(defproducer1), N(defproducer2) } ) ); BOOST_TEST_REQUIRE( stake2votes(core_sym::from_string("50.0002")) == get_producer_info( "defproducer1" )["total_votes"].as_double() ); @@ -2580,10 +2956,10 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, eosio_system ("isproxy", true) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "donald111111" ), get_voter_info( "donald111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(donald111111) ), get_voter_info( "donald111111" ) ); //bob111111111 chooses alice1111111 as a proxy - issue( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("100.0002"), core_sym::from_string("50.0001") ) ); BOOST_REQUIRE_EQUAL( success(), vote( N(bob111111111), vector(), "alice1111111" ) ); BOOST_TEST_REQUIRE( stake2votes(core_sym::from_string("150.0003")) == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); @@ -2592,7 +2968,7 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, eosio_system BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer3" )["total_votes"].as_double() ); //carol1111111 chooses alice1111111 as a proxy - issue( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", core_sym::from_string("30.0001"), core_sym::from_string("20.0001") ) ); BOOST_REQUIRE_EQUAL( success(), vote( N(carol1111111), vector(), "alice1111111" ) ); BOOST_TEST_REQUIRE( stake2votes(core_sym::from_string("200.0005")) == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); @@ -2639,14 +3015,14 @@ BOOST_FIXTURE_TEST_CASE( vote_both_proxy_and_producers, eosio_system_tester ) tr ("isproxy", true) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) ), get_voter_info( "alice1111111" ) ); //carol1111111 becomes a producer - BOOST_REQUIRE_EQUAL( success(), regproducer( "carol1111111", 1) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(carol1111111), 1) ); //bob111111111 chooses alice1111111 as a proxy - issue( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("100.0002"), core_sym::from_string("50.0001") ) ); BOOST_REQUIRE_EQUAL( wasm_assert_msg("cannot vote for producers and proxy at same time"), vote( N(bob111111111), { N(carol1111111) }, "alice1111111" ) ); @@ -2656,7 +3032,7 @@ BOOST_FIXTURE_TEST_CASE( vote_both_proxy_and_producers, eosio_system_tester ) tr BOOST_FIXTURE_TEST_CASE( select_invalid_proxy, eosio_system_tester ) try { //accumulate proxied votes - issue( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("100.0002"), core_sym::from_string("50.0001") ) ); //selecting account not registered as a proxy @@ -2677,16 +3053,16 @@ BOOST_FIXTURE_TEST_CASE( double_register_unregister_proxy_keeps_votes, eosio_sys ("isproxy", 1) ) ); - issue( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "alice1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", core_sym::from_string("5.0000"), core_sym::from_string("5.0000") ) ); edump((get_voter_info("alice1111111"))); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); //bob111111111 stakes and selects alice1111111 as a proxy - issue( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("100.0002"), core_sym::from_string("50.0001") ) ); BOOST_REQUIRE_EQUAL( success(), vote( N(bob111111111), vector(), "alice1111111" ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes( core_sym::from_string("150.0003") ))( "staked", 100000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) )( "proxied_vote_weight", stake2votes( core_sym::from_string("150.0003") ))( "staked", 100000 ), get_voter_info( "alice1111111" ) ); //double regestering should fail without affecting total votes and stake BOOST_REQUIRE_EQUAL( wasm_assert_msg( "action has no effect" ), @@ -2695,7 +3071,7 @@ BOOST_FIXTURE_TEST_CASE( double_register_unregister_proxy_keeps_votes, eosio_sys ("isproxy", 1) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes(core_sym::from_string("150.0003")) )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( N(alice1111111) )( "proxied_vote_weight", stake2votes(core_sym::from_string("150.0003")) )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); //uregister BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproxy), mvo() @@ -2733,13 +3109,13 @@ BOOST_FIXTURE_TEST_CASE( proxy_cannot_use_another_proxy, eosio_system_tester ) t ); //proxy should not be able to use a proxy - issue( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("100.0002"), core_sym::from_string("50.0001") ) ); BOOST_REQUIRE_EQUAL( wasm_assert_msg( "account registered as a proxy is not allowed to use a proxy" ), vote( N(bob111111111), vector(), "alice1111111" ) ); //voter that uses a proxy should not be allowed to become a proxy - issue( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); + issue_and_transfer( "carol1111111", core_sym::from_string("1000.0000"), config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", core_sym::from_string("100.0002"), core_sym::from_string("50.0001") ) ); BOOST_REQUIRE_EQUAL( success(), vote( N(carol1111111), vector(), "alice1111111" ) ); BOOST_REQUIRE_EQUAL( wasm_assert_msg( "account that uses a proxy is not allowed to become a proxy" ), @@ -2777,9 +3153,9 @@ fc::mutable_variant_object config_to_variant( const eosio::chain::chain_config& BOOST_FIXTURE_TEST_CASE( elect_producers /*_and_parameters*/, eosio_system_tester ) try { create_accounts_with_resources( { N(defproducer1), N(defproducer2), N(defproducer3) } ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer1", 1) ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer2", 2) ); - BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer3", 3) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer1), 1) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer2), 2) ); + BOOST_REQUIRE_EQUAL( success(), regproducer( N(defproducer3), 3) ); //stake more than 15% of total EOS supply to activate chain transfer( "eosio", "alice1111111", core_sym::from_string("600000000.0000"), "eosio" ); @@ -2796,7 +3172,7 @@ BOOST_FIXTURE_TEST_CASE( elect_producers /*_and_parameters*/, eosio_system_teste //REQUIRE_EQUAL_OBJECTS(prod1_config, config); // elect 2 producers - issue( "bob111111111", core_sym::from_string("80000.0000"), config::system_account_name ); + issue_and_transfer( "bob111111111", core_sym::from_string("80000.0000"), config::system_account_name ); ilog("stake"); BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", core_sym::from_string("40000.0000"), core_sym::from_string("40000.0000") ) ); ilog("start vote"); @@ -2846,8 +3222,8 @@ BOOST_FIXTURE_TEST_CASE( buyname, eosio_system_tester ) try { create_accounts_with_resources( { N(dan), N(sam) } ); transfer( config::system_account_name, "dan", core_sym::from_string( "10000.0000" ) ); transfer( config::system_account_name, "sam", core_sym::from_string( "10000.0000" ) ); - stake_with_transfer( config::system_account_name, "sam", core_sym::from_string( "80000000.0000" ), core_sym::from_string( "80000000.0000" ) ); - stake_with_transfer( config::system_account_name, "dan", core_sym::from_string( "80000000.0000" ), core_sym::from_string( "80000000.0000" ) ); + stake_with_transfer( config::system_account_name, N(sam), core_sym::from_string( "80000000.0000" ), core_sym::from_string( "80000000.0000" ) ); + stake_with_transfer( config::system_account_name, N(dan), core_sym::from_string( "80000000.0000" ), core_sym::from_string( "80000000.0000" ) ); regproducer( config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), vote( N(sam), { config::system_account_name } ) ); @@ -2911,8 +3287,8 @@ BOOST_FIXTURE_TEST_CASE( multiple_namebids, eosio_system_tester ) try { produce_block(); // stake but but not enough to go live - stake_with_transfer( config::system_account_name, "bob", core_sym::from_string( "35000000.0000" ), core_sym::from_string( "35000000.0000" ) ); - stake_with_transfer( config::system_account_name, "carl", core_sym::from_string( "35000000.0000" ), core_sym::from_string( "35000000.0000" ) ); + stake_with_transfer( config::system_account_name, N(bob), core_sym::from_string( "35000000.0000" ), core_sym::from_string( "35000000.0000" ) ); + stake_with_transfer( config::system_account_name, N(carl), core_sym::from_string( "35000000.0000" ), core_sym::from_string( "35000000.0000" ) ); BOOST_REQUIRE_EQUAL( success(), vote( N(bob), { N(producer) } ) ); BOOST_REQUIRE_EQUAL( success(), vote( N(carl), { N(producer) } ) ); @@ -2968,7 +3344,7 @@ BOOST_FIXTURE_TEST_CASE( multiple_namebids, eosio_system_tester ) try { fc::exception, fc_assert_exception_message_is( not_closed_message ) ); // stake enough to go above the 15% threshold - stake_with_transfer( config::system_account_name, "alice", core_sym::from_string( "10000000.0000" ), core_sym::from_string( "10000000.0000" ) ); + stake_with_transfer( config::system_account_name, N(alice), core_sym::from_string( "10000000.0000" ), core_sym::from_string( "10000000.0000" ) ); BOOST_REQUIRE_EQUAL(0, get_producer_info("producer")["unpaid_blocks"].as()); BOOST_REQUIRE_EQUAL( success(), vote( N(alice), { N(producer) } ) ); @@ -3138,9 +3514,9 @@ BOOST_FIXTURE_TEST_CASE( setparams, eosio_system_tester ) try { action act; act.account = N(eosio.msig); act.name = name; - act.data = msig_abi_ser.variant_to_binary( action_type_name, data, abi_serializer_max_time ); + act.data = msig_abi_ser.variant_to_binary( action_type_name, data, abi_serializer::create_yield_function(abi_serializer_max_time) ); - return base_tester::push_action( std::move(act), auth ? uint64_t(signer) : signer == N(bob111111111) ? N(alice1111111) : N(bob111111111) ); + return base_tester::push_action( std::move(act), (auth ? signer : signer == N(bob111111111) ? N(alice1111111) : N(bob111111111)).to_uint64_t() ); }; // test begins @@ -3174,7 +3550,7 @@ BOOST_FIXTURE_TEST_CASE( setparams, eosio_system_tester ) try { ) }) ); - abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer_max_time); + abi_serializer::from_variant(pretty_trx, trx, get_resolver(), abi_serializer::create_yield_function(abi_serializer_max_time)); } BOOST_REQUIRE_EQUAL(success(), push_action_msig( N(alice1111111), N(propose), mvo() @@ -3196,7 +3572,12 @@ BOOST_FIXTURE_TEST_CASE( setparams, eosio_system_tester ) try { } transaction_trace_ptr trace; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); + BOOST_REQUIRE_EQUAL(success(), push_action_msig( N(alice1111111), N(exec), mvo() ("proposer", "alice1111111") ("proposal_name", "setparams1") @@ -3299,7 +3680,7 @@ BOOST_FIXTURE_TEST_CASE( ram_inflation, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( cur_ram_size + 2 * rate, get_global_state()["max_ram_size"].as_uint64() ); BOOST_REQUIRE_EQUAL( error("missing authority of eosio"), - push_action( "alice1111111", N(setramrate), mvo()("bytes_per_block", rate) ) ); + push_action( N(alice1111111), N(setramrate), mvo()("bytes_per_block", rate) ) ); cur_ram_size = get_global_state()["max_ram_size"].as_uint64(); produce_blocks(10); @@ -3322,14 +3703,14 @@ BOOST_FIXTURE_TEST_CASE( eosioram_ramusage, eosio_system_tester ) try { const asset initial_ramfee_balance = get_balance(N(eosio.ramfee)); BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", core_sym::from_string("1000.0000") ) ); - BOOST_REQUIRE_EQUAL( false, get_row_by_account( N(eosio.token), N(alice1111111), N(accounts), symbol{CORE_SYM}.to_symbol_code() ).empty() ); + BOOST_REQUIRE_EQUAL( false, get_row_by_account( N(eosio.token), N(alice1111111), N(accounts), account_name(symbol{CORE_SYM}.to_symbol_code()) ).empty() ); //remove row base_tester::push_action( N(eosio.token), N(close), N(alice1111111), mvo() ( "owner", "alice1111111" ) ( "symbol", symbol{CORE_SYM} ) ); - BOOST_REQUIRE_EQUAL( true, get_row_by_account( N(eosio.token), N(alice1111111), N(accounts), symbol{CORE_SYM}.to_symbol_code() ).empty() ); + BOOST_REQUIRE_EQUAL( true, get_row_by_account( N(eosio.token), N(alice1111111), N(accounts), account_name(symbol{CORE_SYM}.to_symbol_code()) ).empty() ); auto rlm = control->get_resource_limits_manager(); auto eosioram_ram_usage = rlm.get_account_ram_usage(N(eosio.ram)); @@ -3388,60 +3769,1944 @@ BOOST_FIXTURE_TEST_CASE( ram_gift, eosio_system_tester ) try { } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( setabi_bios, TESTER ) try { - abi_serializer abi_ser(fc::json::from_string( (const char*)contracts::system_abi().data()).template as(), abi_serializer_max_time); - set_code( config::system_account_name, contracts::bios_wasm() ); - set_abi( config::system_account_name, contracts::bios_abi().data() ); - create_account(N(eosio.token)); - set_abi( N(eosio.token), contracts::token_abi().data() ); + +BOOST_FIXTURE_TEST_CASE( rex_auth, eosio_system_tester ) try { + + const std::vector accounts = { N(aliceaccount), N(bobbyaccount) }; + const account_name alice = accounts[0], bob = accounts[1]; + const asset init_balance = core_sym::from_string("1000.0000"); + const asset one_eos = core_sym::from_string("1.0000"); + const asset one_rex = asset::from_string("1.0000 REX"); + setup_rex_accounts( accounts, init_balance ); + + const std::string error_msg("missing authority of aliceaccount"); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(deposit), mvo()("owner", alice)("amount", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(withdraw), mvo()("owner", alice)("amount", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(buyrex), mvo()("from", alice)("amount", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), + push_action( bob, N(unstaketorex), mvo()("owner", alice)("receiver", alice)("from_net", one_eos)("from_cpu", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(sellrex), mvo()("from", alice)("rex", one_rex) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(cnclrexorder), mvo()("owner", alice) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), + push_action( bob, N(rentcpu), mvo()("from", alice)("receiver", alice)("loan_payment", one_eos)("loan_fund", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), + push_action( bob, N(rentnet), mvo()("from", alice)("receiver", alice)("loan_payment", one_eos)("loan_fund", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(fundcpuloan), mvo()("from", alice)("loan_num", 1)("payment", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(fundnetloan), mvo()("from", alice)("loan_num", 1)("payment", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(defcpuloan), mvo()("from", alice)("loan_num", 1)("amount", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(defnetloan), mvo()("from", alice)("loan_num", 1)("amount", one_eos) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(updaterex), mvo()("owner", alice) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(rexexec), mvo()("user", alice)("max", 1) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(consolidate), mvo()("owner", alice) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(mvtosavings), mvo()("owner", alice)("rex", one_rex) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(mvfrsavings), mvo()("owner", alice)("rex", one_rex) ) ); + BOOST_REQUIRE_EQUAL( error(error_msg), push_action( bob, N(closerex), mvo()("owner", alice) ) ); + + BOOST_REQUIRE_EQUAL( error("missing authority of eosio"), push_action( alice, N(setrex), mvo()("balance", one_eos) ) ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( buy_sell_rex, eosio_system_tester ) try { + + const int64_t ratio = 10000; + const asset init_rent = core_sym::from_string("20000.0000"); + const asset init_balance = core_sym::from_string("1000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount), N(frankaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3], frank = accounts[4]; + setup_rex_accounts( accounts, init_balance ); + + const asset one_unit = core_sym::from_string("0.0001"); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient funds"), buyrex( alice, init_balance + one_unit ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("25000.0000 REX"), get_buyrex_result( alice, core_sym::from_string("2.5000") ) ); + produce_blocks(2); + produce_block(fc::days(5)); + BOOST_REQUIRE_EQUAL( core_sym::from_string("2.5000"), get_sellrex_result( alice, asset::from_string("25000.0000 REX") ) ); + + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("13.0000") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("13.0000"), get_rex_vote_stake( alice ) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("17.0000") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("30.0000"), get_rex_vote_stake( alice ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("970.0000"), get_rex_fund(alice) ); + BOOST_REQUIRE_EQUAL( get_rex_balance(alice).get_amount(), ratio * asset::from_string("30.0000 REX").get_amount() ); + auto rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( core_sym::from_string("30.0000"), rex_pool["total_lendable"].as() ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("30.0000"), rex_pool["total_unlent"].as() ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), rex_pool["total_lent"].as() ); + BOOST_REQUIRE_EQUAL( init_rent, rex_pool["total_rent"].as() ); + BOOST_REQUIRE_EQUAL( get_rex_balance(alice), rex_pool["total_rex"].as() ); + + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, core_sym::from_string("75.0000") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("925.0000"), get_rex_fund(bob) ); + BOOST_REQUIRE_EQUAL( ratio * asset::from_string("75.0000 REX").get_amount(), get_rex_balance(bob).get_amount() ); + rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( core_sym::from_string("105.0000"), rex_pool["total_lendable"].as() ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("105.0000"), rex_pool["total_unlent"].as() ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), rex_pool["total_lent"].as() ); + BOOST_REQUIRE_EQUAL( init_rent, rex_pool["total_rent"].as() ); + BOOST_REQUIRE_EQUAL( get_rex_balance(alice) + get_rex_balance(bob), rex_pool["total_rex"].as() ); + + produce_block( fc::days(6) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("user must first buyrex"), sellrex( carol, asset::from_string("5.0000 REX") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("asset must be a positive amount of (REX, 4)"), + sellrex( bob, core_sym::from_string("55.0000") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("asset must be a positive amount of (REX, 4)"), + sellrex( bob, asset::from_string("-75.0030 REX") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), sellrex( bob, asset::from_string("750000.0030 REX") ) ); + + auto init_total_rex = rex_pool["total_rex"].as().get_amount(); + auto init_total_lendable = rex_pool["total_lendable"].as().get_amount(); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, asset::from_string("550001.0000 REX") ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("199999.0000 REX"), get_rex_balance(bob) ); + rex_pool = get_rex_pool(); + auto total_rex = rex_pool["total_rex"].as().get_amount(); + auto total_lendable = rex_pool["total_lendable"].as().get_amount(); + BOOST_REQUIRE_EQUAL( init_total_rex / init_total_lendable, total_rex / total_lendable ); + BOOST_REQUIRE_EQUAL( total_lendable, rex_pool["total_unlent"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), rex_pool["total_lent"].as() ); + BOOST_REQUIRE_EQUAL( init_rent, rex_pool["total_rent"].as() ); + BOOST_REQUIRE_EQUAL( get_rex_balance(alice) + get_rex_balance(bob), rex_pool["total_rex"].as() ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( buy_sell_small_rex, eosio_system_tester ) try { + + const int64_t ratio = 10000; + const asset init_balance = core_sym::from_string("50000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2]; + setup_rex_accounts( accounts, init_balance ); + + const asset payment = core_sym::from_string("40000.0000"); + BOOST_REQUIRE_EQUAL( ratio * payment.get_amount(), get_buyrex_result( alice, payment ).get_amount() ); + + produce_blocks(2); + produce_block( fc::days(5) ); + produce_blocks(2); + + asset init_rex_stake = get_rex_vote_stake( alice ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("proceeds are negligible"), sellrex( alice, asset::from_string("0.0001 REX") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("proceeds are negligible"), sellrex( alice, asset::from_string("0.9999 REX") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0001"), get_sellrex_result( alice, asset::from_string("1.0000 REX") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0001"), get_sellrex_result( alice, asset::from_string("1.9999 REX") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0002"), get_sellrex_result( alice, asset::from_string("2.0000 REX") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0002"), get_sellrex_result( alice, asset::from_string("2.9999 REX") ) ); + BOOST_REQUIRE_EQUAL( get_rex_vote_stake( alice ), init_rex_stake - core_sym::from_string("0.0006") ); + + BOOST_REQUIRE_EQUAL( success(), rentcpu( carol, bob, core_sym::from_string("10.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset::from_string("1.0000 REX") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("proceeds are negligible"), sellrex( alice, asset::from_string("0.4000 REX") ) ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( unstake_buy_rex, eosio_system_tester, * boost::unit_test::tolerance(1e-10) ) try { + + const int64_t ratio = 10000; + const asset zero_asset = core_sym::from_string("0.0000"); + const asset neg_asset = core_sym::from_string("-0.0001"); + const asset one_token = core_sym::from_string("1.0000"); + const asset init_balance = core_sym::from_string("10000.0000"); + const asset init_net = core_sym::from_string("70.0000"); + const asset init_cpu = core_sym::from_string("90.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount), N(frankaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3], frank = accounts[4]; + setup_rex_accounts( accounts, init_balance, init_net, init_cpu, false ); + + // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers + std::vector producer_names; { - auto res = get_row_by_account( config::system_account_name, config::system_account_name, N(abihash), N(eosio.token) ); - _abi_hash abi_hash; - auto abi_hash_var = abi_ser.binary_to_variant( "abi_hash", res, abi_serializer_max_time ); - abi_serializer::from_variant( abi_hash_var, abi_hash, get_resolver(), abi_serializer_max_time); - auto abi = fc::raw::pack(fc::json::from_string( (const char*)contracts::token_abi().data()).template as()); - auto result = fc::sha256::hash( (const char*)abi.data(), abi.size() ); + producer_names.reserve('z' - 'a' + 1); + const std::string root("defproducer"); + for ( char c = 'a'; c <= 'z'; ++c ) { + producer_names.emplace_back(root + std::string(1, c)); + } - BOOST_REQUIRE( abi_hash.hash == result ); + setup_producer_accounts(producer_names); + for ( const auto& p: producer_names ) { + BOOST_REQUIRE_EQUAL( success(), regproducer(p) ); + BOOST_TEST_REQUIRE( 0 == get_producer_info(p)["total_votes"].as() ); + } } - set_abi( N(eosio.token), contracts::system_abi().data() ); + const int64_t init_cpu_limit = get_cpu_limit( alice ); + const int64_t init_net_limit = get_net_limit( alice ); + { - auto res = get_row_by_account( config::system_account_name, config::system_account_name, N(abihash), N(eosio.token) ); - _abi_hash abi_hash; - auto abi_hash_var = abi_ser.binary_to_variant( "abi_hash", res, abi_serializer_max_time ); - abi_serializer::from_variant( abi_hash_var, abi_hash, get_resolver(), abi_serializer_max_time); - auto abi = fc::raw::pack(fc::json::from_string( (const char*)contracts::system_abi().data()).template as()); - auto result = fc::sha256::hash( (const char*)abi.data(), abi.size() ); + const asset net_stake = core_sym::from_string("25.5000"); + const asset cpu_stake = core_sym::from_string("12.4000"); + const asset tot_stake = net_stake + cpu_stake; + BOOST_REQUIRE_EQUAL( init_balance, get_balance( alice ) ); + BOOST_REQUIRE_EQUAL( success(), stake( alice, alice, net_stake, cpu_stake ) ); + BOOST_REQUIRE_EQUAL( get_cpu_limit( alice ), init_cpu_limit + cpu_stake.get_amount() ); + BOOST_REQUIRE_EQUAL( get_net_limit( alice ), init_net_limit + net_stake.get_amount() ); + BOOST_REQUIRE_EQUAL( success(), + vote( alice, std::vector(producer_names.begin(), producer_names.begin() + 20) ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must vote for at least 21 producers or for a proxy before buying REX"), + unstaketorex( alice, alice, net_stake, cpu_stake ) ); + BOOST_REQUIRE_EQUAL( success(), + vote( alice, std::vector(producer_names.begin(), producer_names.begin() + 21) ) ); + const asset init_eosio_stake_balance = get_balance( N(eosio.stake) ); + const auto init_voter_info = get_voter_info( alice ); + const auto init_prod_info = get_producer_info( producer_names[0] ); + BOOST_TEST_REQUIRE( init_prod_info["total_votes"].as_double() == + stake2votes( asset( init_voter_info["staked"].as(), symbol{CORE_SYM} ) ) ); + produce_block( fc::days(4) ); + BOOST_REQUIRE_EQUAL( ratio * tot_stake.get_amount(), get_unstaketorex_result( alice, alice, net_stake, cpu_stake ).get_amount() ); + BOOST_REQUIRE_EQUAL( get_cpu_limit( alice ), init_cpu_limit ); + BOOST_REQUIRE_EQUAL( get_net_limit( alice ), init_net_limit ); + BOOST_REQUIRE_EQUAL( ratio * tot_stake.get_amount(), get_rex_balance( alice ).get_amount() ); + BOOST_REQUIRE_EQUAL( tot_stake, get_rex_balance_obj( alice )["vote_stake"].as() ); + BOOST_REQUIRE_EQUAL( tot_stake, get_balance( N(eosio.rex) ) ); + BOOST_REQUIRE_EQUAL( tot_stake, init_eosio_stake_balance - get_balance( N(eosio.stake) ) ); + auto current_voter_info = get_voter_info( alice ); + auto current_prod_info = get_producer_info( producer_names[0] ); + BOOST_REQUIRE_EQUAL( init_voter_info["staked"].as(), current_voter_info["staked"].as() ); + BOOST_TEST_REQUIRE( current_prod_info["total_votes"].as_double() == + stake2votes( asset( current_voter_info["staked"].as(), symbol{CORE_SYM} ) ) ); + BOOST_TEST_REQUIRE( init_prod_info["total_votes"].as_double() < current_prod_info["total_votes"].as_double() ); + } - BOOST_REQUIRE( abi_hash.hash == result ); + { + const asset net_stake = core_sym::from_string("200.5000"); + const asset cpu_stake = core_sym::from_string("120.0000"); + const asset tot_stake = net_stake + cpu_stake; + BOOST_REQUIRE_EQUAL( success(), stake( bob, carol, net_stake, cpu_stake ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("amount exceeds tokens staked for net"), + unstaketorex( bob, carol, net_stake + one_token, zero_asset ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("amount exceeds tokens staked for cpu"), + unstaketorex( bob, carol, zero_asset, cpu_stake + one_token ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("delegated bandwidth record does not exist"), + unstaketorex( bob, emily, zero_asset, one_token ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must unstake a positive amount to buy rex"), + unstaketorex( bob, carol, zero_asset, zero_asset ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must unstake a positive amount to buy rex"), + unstaketorex( bob, carol, neg_asset, one_token ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must unstake a positive amount to buy rex"), + unstaketorex( bob, carol, one_token, neg_asset ) ); + BOOST_REQUIRE_EQUAL( init_net_limit + net_stake.get_amount(), get_net_limit( carol ) ); + BOOST_REQUIRE_EQUAL( init_cpu_limit + cpu_stake.get_amount(), get_cpu_limit( carol ) ); + BOOST_REQUIRE_EQUAL( false, get_dbw_obj( bob, carol ).is_null() ); + BOOST_REQUIRE_EQUAL( success(), unstaketorex( bob, carol, net_stake, zero_asset ) ); + BOOST_REQUIRE_EQUAL( false, get_dbw_obj( bob, carol ).is_null() ); + BOOST_REQUIRE_EQUAL( success(), unstaketorex( bob, carol, zero_asset, cpu_stake ) ); + BOOST_REQUIRE_EQUAL( true, get_dbw_obj( bob, carol ).is_null() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance( carol ).get_amount() ); + BOOST_REQUIRE_EQUAL( ratio * tot_stake.get_amount(), get_rex_balance( bob ).get_amount() ); + BOOST_REQUIRE_EQUAL( init_cpu_limit, get_cpu_limit( bob ) ); + BOOST_REQUIRE_EQUAL( init_net_limit, get_net_limit( bob ) ); + BOOST_REQUIRE_EQUAL( init_cpu_limit, get_cpu_limit( carol ) ); + BOOST_REQUIRE_EQUAL( init_net_limit, get_net_limit( carol ) ); + } + + { + const asset net_stake = core_sym::from_string("130.5000"); + const asset cpu_stake = core_sym::from_string("220.0800"); + const asset tot_stake = net_stake + cpu_stake; + BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( emily, frank, net_stake, cpu_stake ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("delegated bandwidth record does not exist"), + unstaketorex( emily, frank, net_stake, cpu_stake ) ); + BOOST_REQUIRE_EQUAL( success(), unstaketorex( frank, frank, net_stake, cpu_stake ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( frank, asset::from_string("1.0000 REX") ) ); + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( frank, asset::from_string("1.0000 REX") ) ); } + } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( setabi, eosio_system_tester ) try { - set_abi( N(eosio.token), contracts::token_abi().data() ); + +BOOST_FIXTURE_TEST_CASE( buy_rent_rex, eosio_system_tester ) try { + + const int64_t ratio = 10000; + const asset init_balance = core_sym::from_string("60000.0000"); + const asset init_net = core_sym::from_string("70.0000"); + const asset init_cpu = core_sym::from_string("90.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount), N(frankaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3], frank = accounts[4]; + setup_rex_accounts( accounts, init_balance, init_net, init_cpu ); + + const int64_t init_cpu_limit = get_cpu_limit( alice ); + const int64_t init_net_limit = get_net_limit( alice ); + + // bob tries to rent rex + BOOST_REQUIRE_EQUAL( wasm_assert_msg("rex system not initialized yet"), rentcpu( bob, carol, core_sym::from_string("5.0000") ) ); + // alice lends rex + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("50265.0000") ) ); + BOOST_REQUIRE_EQUAL( init_balance - core_sym::from_string("50265.0000"), get_rex_fund(alice) ); + auto rex_pool = get_rex_pool(); + const asset init_tot_unlent = rex_pool["total_unlent"].as(); + const asset init_tot_lendable = rex_pool["total_lendable"].as(); + const asset init_tot_rent = rex_pool["total_rent"].as(); + const int64_t init_stake = get_voter_info(alice)["staked"].as(); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), rex_pool["total_lent"].as() ); + BOOST_REQUIRE_EQUAL( ratio * init_tot_lendable.get_amount(), rex_pool["total_rex"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( rex_pool["total_rex"].as(), get_rex_balance(alice) ); + + BOOST_REQUIRE( get_rex_return_pool().is_null() ); + { - auto res = get_row_by_account( config::system_account_name, config::system_account_name, N(abihash), N(eosio.token) ); - _abi_hash abi_hash; - auto abi_hash_var = abi_ser.binary_to_variant( "abi_hash", res, abi_serializer_max_time ); - abi_serializer::from_variant( abi_hash_var, abi_hash, get_resolver(), abi_serializer_max_time); - auto abi = fc::raw::pack(fc::json::from_string( (const char*)contracts::token_abi().data()).template as()); - auto result = fc::sha256::hash( (const char*)abi.data(), abi.size() ); + // bob rents cpu for carol + const asset fee = core_sym::from_string("17.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, carol, fee ) ); + BOOST_REQUIRE_EQUAL( init_balance - fee, get_rex_fund(bob) ); + rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( init_tot_lendable, rex_pool["total_lendable"].as() ); // 65 + BOOST_REQUIRE_EQUAL( init_tot_rent + fee, rex_pool["total_rent"].as() ); // 100 + 17 + int64_t expected_total_lent = bancor_convert( init_tot_rent.get_amount(), init_tot_unlent.get_amount(), fee.get_amount() ); + BOOST_REQUIRE_EQUAL( expected_total_lent, + rex_pool["total_lent"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( rex_pool["total_lent"].as() + rex_pool["total_unlent"].as(), + rex_pool["total_lendable"].as() ); + + auto rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE( !rex_return_pool.is_null() ); + BOOST_REQUIRE_EQUAL( 0, rex_return_pool["current_rate_of_increase"].as() ); + + // test that carol's resource limits have been updated properly + BOOST_REQUIRE_EQUAL( expected_total_lent, get_cpu_limit( carol ) - init_cpu_limit ); + BOOST_REQUIRE_EQUAL( 0, get_net_limit( carol ) - init_net_limit ); + + // alice tries to sellrex, order gets scheduled then she cancels order + BOOST_REQUIRE_EQUAL( cancelrexorder( alice ), wasm_assert_msg("no sellrex order is scheduled") ); + produce_block( fc::days(6) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, get_rex_balance(alice) ) ); + BOOST_REQUIRE_EQUAL( success(), cancelrexorder( alice ) ); + BOOST_REQUIRE_EQUAL( rex_pool["total_rex"].as(), get_rex_balance(alice) ); + + produce_block( fc::days(20) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, get_rex_balance(alice) ) ); + BOOST_REQUIRE_EQUAL( success(), cancelrexorder( alice ) ); + + rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE( !rex_return_pool.is_null() ); + int64_t rate = fee.get_amount() / (30 * 144); + BOOST_REQUIRE_EQUAL( rate, rex_return_pool["current_rate_of_increase"].as() ); + + produce_block( fc::days(10) ); + // alice is finally able to sellrex, she gains the fee paid by bob + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, get_rex_balance(alice) ) ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance(alice).get_amount() ); + auto expected_rex_fund = (init_balance + fee).get_amount(); + auto actual_rex_fund = get_rex_fund(alice).get_amount(); + BOOST_REQUIRE_EQUAL( expected_rex_fund, actual_rex_fund ); + // test that carol's resource limits have been updated properly when loan expires + BOOST_REQUIRE_EQUAL( init_cpu_limit, get_cpu_limit( carol ) ); + BOOST_REQUIRE_EQUAL( init_net_limit, get_net_limit( carol ) ); + + rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( 0, rex_pool["total_lendable"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 0, rex_pool["total_unlent"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 0, rex_pool["total_rex"].as().get_amount() ); + } - BOOST_REQUIRE( abi_hash.hash == result ); + { + const int64_t init_net_limit = get_net_limit( emily ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance(alice).get_amount() ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("20050.0000") ) ); + rex_pool = get_rex_pool(); + const asset fee = core_sym::from_string("0.4560"); + int64_t expected_net = bancor_convert( rex_pool["total_rent"].as().get_amount(), + rex_pool["total_unlent"].as().get_amount(), + fee.get_amount() ); + BOOST_REQUIRE_EQUAL( success(), rentnet( emily, emily, fee ) ); + BOOST_REQUIRE_EQUAL( expected_net, get_net_limit( emily ) - init_net_limit ); } - set_abi( N(eosio.token), contracts::system_abi().data() ); +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( buy_sell_sell_rex, eosio_system_tester ) try { + + const int64_t ratio = 10000; + const asset init_balance = core_sym::from_string("40000.0000"); + const asset init_net = core_sym::from_string("70.0000"); + const asset init_cpu = core_sym::from_string("90.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2]; + setup_rex_accounts( accounts, init_balance, init_net, init_cpu ); + + const int64_t init_cpu_limit = get_cpu_limit( alice ); + const int64_t init_net_limit = get_net_limit( alice ); + + // alice lends rex + const asset payment = core_sym::from_string("30250.0000"); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment ) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, core_sym::from_string("0.0005") ) ); + BOOST_REQUIRE_EQUAL( init_balance - payment, get_rex_fund(alice) ); + auto rex_pool = get_rex_pool(); + const asset init_tot_unlent = rex_pool["total_unlent"].as(); + const asset init_tot_lendable = rex_pool["total_lendable"].as(); + const asset init_tot_rent = rex_pool["total_rent"].as(); + const int64_t init_stake = get_voter_info(alice)["staked"].as(); + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), rex_pool["total_lent"].as() ); + BOOST_REQUIRE_EQUAL( ratio * init_tot_lendable.get_amount(), rex_pool["total_rex"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( rex_pool["total_rex"].as(), get_rex_balance(alice) + get_rex_balance(bob) ); + + // bob rents cpu for carol + const asset fee = core_sym::from_string("7.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, carol, fee ) ); + rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( init_tot_lendable, rex_pool["total_lendable"].as() ); + BOOST_REQUIRE_EQUAL( init_tot_rent + fee, rex_pool["total_rent"].as() ); + + produce_block( fc::days(5) ); + produce_blocks(2); + const asset rex_tok = asset::from_string("1.0000 REX"); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, get_rex_balance(alice) - rex_tok ) ); + BOOST_REQUIRE_EQUAL( false, get_rex_order_obj( alice ).is_null() ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, rex_tok ) ); + BOOST_REQUIRE_EQUAL( sellrex( alice, rex_tok ), wasm_assert_msg("insufficient funds for current and scheduled orders") ); + BOOST_REQUIRE_EQUAL( ratio * payment.get_amount() - rex_tok.get_amount(), get_rex_order( alice )["rex_requested"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( success(), consolidate( alice ) ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance_obj( alice )["rex_maturities"].get_array().size() ); + + produce_block( fc::days(26) ); + produce_blocks(2); + + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 2 ) ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance( alice ).get_amount() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance_obj( alice )["matured_rex"].as() ); + const asset init_fund = get_rex_fund( alice ); + BOOST_REQUIRE_EQUAL( success(), updaterex( alice ) ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance( alice ).get_amount() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance_obj( alice )["matured_rex"].as() ); + BOOST_REQUIRE ( init_fund < get_rex_fund( alice ) ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( buy_sell_claim_rex, eosio_system_tester ) try { + + const asset init_balance = core_sym::from_string("3000000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount), N(frankaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3], frank = accounts[4]; + setup_rex_accounts( accounts, init_balance ); + + const auto purchase1 = core_sym::from_string("50000.0000"); + const auto purchase2 = core_sym::from_string("105500.0000"); + const auto purchase3 = core_sym::from_string("104500.0000"); + const auto init_stake = get_voter_info(alice)["staked"].as(); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, purchase1) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, purchase2) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( carol, purchase3) ); + + BOOST_REQUIRE_EQUAL( init_balance - purchase1, get_rex_fund(alice) ); + BOOST_REQUIRE_EQUAL( purchase1.get_amount(), get_voter_info(alice)["staked"].as() - init_stake ); + + BOOST_REQUIRE_EQUAL( init_balance - purchase2, get_rex_fund(bob) ); + BOOST_REQUIRE_EQUAL( init_balance - purchase3, get_rex_fund(carol) ); + + auto init_alice_rex = get_rex_balance(alice); + auto init_bob_rex = get_rex_balance(bob); + auto init_carol_rex = get_rex_balance(carol); + + BOOST_REQUIRE_EQUAL( core_sym::from_string("20000.0000"), get_rex_pool()["total_rent"].as() ); + + for (uint8_t i = 0; i < 4; ++i) { + BOOST_REQUIRE_EQUAL( success(), rentcpu( emily, emily, core_sym::from_string("12000.0000") ) ); + } + + produce_block( fc::days(25) ); + + const asset rent_payment = core_sym::from_string("46000.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( frank, frank, rent_payment, rent_payment ) ); + + produce_block( fc::days(4) ); + + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 1 ) ); + + const auto init_rex_pool = get_rex_pool(); + const int64_t total_lendable = init_rex_pool["total_lendable"].as().get_amount(); + const int64_t total_rex = init_rex_pool["total_rex"].as().get_amount(); + const int64_t init_alice_rex_stake = ( eosio::chain::uint128_t(init_alice_rex.get_amount()) * total_lendable ) / total_rex; + + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset( 3 * get_rex_balance(alice).get_amount() / 4, symbol{SY(4,REX)} ) ) ); + + BOOST_TEST_REQUIRE( within_one( init_alice_rex.get_amount() / 4, get_rex_balance(alice).get_amount() ) ); + + init_alice_rex = get_rex_balance(alice); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, get_rex_balance(bob) ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( carol, get_rex_balance(carol) ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, get_rex_balance(alice) ) ); + + BOOST_REQUIRE_EQUAL( init_bob_rex, get_rex_balance(bob) ); + BOOST_REQUIRE_EQUAL( init_carol_rex, get_rex_balance(carol) ); + BOOST_REQUIRE_EQUAL( init_alice_rex, get_rex_balance(alice) ); + + // now bob's, carol's and alice's sellrex orders have been queued + BOOST_REQUIRE_EQUAL( true, get_rex_order(alice)["is_open"].as() ); + BOOST_REQUIRE_EQUAL( init_alice_rex, get_rex_order(alice)["rex_requested"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_order(alice)["proceeds"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( true, get_rex_order(bob)["is_open"].as() ); + BOOST_REQUIRE_EQUAL( init_bob_rex, get_rex_order(bob)["rex_requested"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_order(bob)["proceeds"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( true, get_rex_order(carol)["is_open"].as() ); + BOOST_REQUIRE_EQUAL( init_carol_rex, get_rex_order(carol)["rex_requested"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_order(carol)["proceeds"].as().get_amount() ); + + // wait for a total of 30 days minus 1 hour + produce_block( fc::hours(23) ); + BOOST_REQUIRE_EQUAL( success(), updaterex( alice ) ); + BOOST_REQUIRE_EQUAL( true, get_rex_order(alice)["is_open"].as() ); + BOOST_REQUIRE_EQUAL( true, get_rex_order(bob)["is_open"].as() ); + BOOST_REQUIRE_EQUAL( true, get_rex_order(carol)["is_open"].as() ); + + // wait for 2 more hours, by now frank's loan has expired and there is enough balance in + // total_unlent to close some sellrex orders. only two are processed, bob's and carol's. + // alices's order is still open. + // an action is needed to trigger queue processing + produce_block( fc::hours(2) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("rex loans are currently not available"), + rentcpu( frank, frank, core_sym::from_string("0.0001") ) ); { - auto res = get_row_by_account( config::system_account_name, config::system_account_name, N(abihash), N(eosio.token) ); - _abi_hash abi_hash; - auto abi_hash_var = abi_ser.binary_to_variant( "abi_hash", res, abi_serializer_max_time ); - abi_serializer::from_variant( abi_hash_var, abi_hash, get_resolver(), abi_serializer_max_time); - auto abi = fc::raw::pack(fc::json::from_string( (const char*)contracts::system_abi().data()).template as()); - auto result = fc::sha256::hash( (const char*)abi.data(), abi.size() ); + auto trace = base_tester::push_action( config::system_account_name, N(rexexec), frank, + mvo()("user", frank)("max", 2) ); + auto output = get_rexorder_result( trace ); + BOOST_REQUIRE_EQUAL( output.size(), 1 ); + BOOST_REQUIRE_EQUAL( output[0].first, bob ); + BOOST_REQUIRE_EQUAL( output[0].second, get_rex_order(bob)["proceeds"].as() ); + } - BOOST_REQUIRE( abi_hash.hash == result ); + { + BOOST_REQUIRE_EQUAL( false, get_rex_order(bob)["is_open"].as() ); + BOOST_REQUIRE_EQUAL( init_bob_rex, get_rex_order(bob)["rex_requested"].as() ); + BOOST_TEST_REQUIRE ( 0 < get_rex_order(bob)["proceeds"].as().get_amount() ); + + BOOST_REQUIRE_EQUAL( true, get_rex_order(alice)["is_open"].as() ); + BOOST_REQUIRE_EQUAL( init_alice_rex, get_rex_order(alice)["rex_requested"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_order(alice)["proceeds"].as().get_amount() ); + + BOOST_REQUIRE_EQUAL( true, get_rex_order(carol)["is_open"].as() ); + BOOST_REQUIRE_EQUAL( init_carol_rex, get_rex_order(carol)["rex_requested"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_order(carol)["proceeds"].as().get_amount() ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("rex loans are currently not available"), + rentcpu( frank, frank, core_sym::from_string("1.0000") ) ); + } + + produce_blocks(2); + produce_block( fc::hours(13) ); + produce_blocks(2); + produce_block( fc::days(30) ); + produce_blocks(2); + + { + auto trace1 = base_tester::push_action( config::system_account_name, N(updaterex), bob, mvo()("owner", bob) ); + auto trace2 = base_tester::push_action( config::system_account_name, N(updaterex), carol, mvo()("owner", carol) ); + BOOST_REQUIRE_EQUAL( 0, get_rex_vote_stake( bob ).get_amount() ); + BOOST_REQUIRE_EQUAL( init_stake, get_voter_info( bob )["staked"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_vote_stake( carol ).get_amount() ); + BOOST_REQUIRE_EQUAL( init_stake, get_voter_info( carol )["staked"].as() ); + auto output1 = get_rexorder_result( trace1 ); + auto output2 = get_rexorder_result( trace2 ); + BOOST_REQUIRE_EQUAL( 2, output1.size() + output2.size() ); + + BOOST_REQUIRE_EQUAL( false, get_rex_order_obj(alice).is_null() ); + BOOST_REQUIRE_EQUAL( true, get_rex_order_obj(bob).is_null() ); + BOOST_REQUIRE_EQUAL( true, get_rex_order_obj(carol).is_null() ); + BOOST_REQUIRE_EQUAL( false, get_rex_order(alice)["is_open"].as() ); + + const auto& rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( 0, rex_pool["total_lendable"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 0, rex_pool["total_rex"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("rex loans are currently not available"), + rentcpu( frank, frank, core_sym::from_string("1.0000") ) ); + + BOOST_REQUIRE_EQUAL( success(), buyrex( emily, core_sym::from_string("22000.0000") ) ); + BOOST_REQUIRE_EQUAL( false, get_rex_order_obj(alice).is_null() ); + BOOST_REQUIRE_EQUAL( false, get_rex_order(alice)["is_open"].as() ); + + BOOST_REQUIRE_EQUAL( success(), rentcpu( frank, frank, core_sym::from_string("1.0000") ) ); } + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( rex_loans, eosio_system_tester ) try { + + const int64_t ratio = 10000; + const asset init_balance = core_sym::from_string("40000.0000"); + const asset one_unit = core_sym::from_string("0.0001"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount), N(frankaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3], frank = accounts[4]; + setup_rex_accounts( accounts, init_balance ); + + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("25000.0000") ) ); + + auto rex_pool = get_rex_pool(); + const asset payment = core_sym::from_string("30.0000"); + const asset zero_asset = core_sym::from_string("0.0000"); + const asset neg_asset = core_sym::from_string("-1.0000"); + BOOST_TEST_REQUIRE( 0 > neg_asset.get_amount() ); + asset cur_frank_balance = get_rex_fund( frank ); + int64_t expected_stake = bancor_convert( rex_pool["total_rent"].as().get_amount(), + rex_pool["total_unlent"].as().get_amount(), + payment.get_amount() ); + const int64_t init_stake = get_cpu_limit( frank ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must use core token"), + rentcpu( frank, bob, asset::from_string("10.0000 RND") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must use core token"), + rentcpu( frank, bob, payment, asset::from_string("10.0000 RND") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must use positive asset amount"), + rentcpu( frank, bob, zero_asset ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must use positive asset amount"), + rentcpu( frank, bob, payment, neg_asset ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must use positive asset amount"), + rentcpu( frank, bob, neg_asset, payment ) ); + // create 2 cpu and 3 net loans + const asset rented_tokens{ expected_stake, symbol{CORE_SYM} }; + BOOST_REQUIRE_EQUAL( rented_tokens, get_rentcpu_result( frank, bob, payment ) ); // loan_num = 1 + BOOST_REQUIRE_EQUAL( success(), rentcpu( alice, emily, payment ) ); // loan_num = 2 + BOOST_REQUIRE_EQUAL( 2, get_last_cpu_loan()["loan_num"].as_uint64() ); + + asset expected_rented_net; + { + const auto& pool = get_rex_pool(); + const int64_t r = bancor_convert( pool["total_rent"].as().get_amount(), + pool["total_unlent"].as().get_amount(), + payment.get_amount() ); + expected_rented_net = asset{ r, symbol{CORE_SYM} }; + } + BOOST_REQUIRE_EQUAL( expected_rented_net, get_rentnet_result( alice, emily, payment ) ); // loan_num = 3 + BOOST_REQUIRE_EQUAL( success(), rentnet( alice, alice, payment ) ); // loan_num = 4 + BOOST_REQUIRE_EQUAL( success(), rentnet( alice, frank, payment ) ); // loan_num = 5 + BOOST_REQUIRE_EQUAL( 5, get_last_net_loan()["loan_num"].as_uint64() ); + + auto loan_info = get_cpu_loan(1); + auto old_frank_balance = cur_frank_balance; + cur_frank_balance = get_rex_fund( frank ); + BOOST_REQUIRE_EQUAL( old_frank_balance, payment + cur_frank_balance ); + BOOST_REQUIRE_EQUAL( 1, loan_info["loan_num"].as_uint64() ); + BOOST_REQUIRE_EQUAL( payment, loan_info["payment"].as() ); + BOOST_REQUIRE_EQUAL( 0, loan_info["balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( expected_stake, loan_info["total_staked"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( expected_stake + init_stake, get_cpu_limit( bob ) ); + + // frank funds his loan enough to be renewed once + const asset fund = core_sym::from_string("35.0000"); + BOOST_REQUIRE_EQUAL( fundcpuloan( frank, 1, cur_frank_balance + one_unit), wasm_assert_msg("insufficient funds") ); + BOOST_REQUIRE_EQUAL( fundnetloan( frank, 1, fund ), wasm_assert_msg("loan not found") ); + BOOST_REQUIRE_EQUAL( fundcpuloan( alice, 1, fund ), wasm_assert_msg("user must be loan creator") ); + BOOST_REQUIRE_EQUAL( success(), fundcpuloan( frank, 1, fund ) ); + old_frank_balance = cur_frank_balance; + cur_frank_balance = get_rex_fund( frank ); + loan_info = get_cpu_loan(1); + BOOST_REQUIRE_EQUAL( old_frank_balance, fund + cur_frank_balance ); + BOOST_REQUIRE_EQUAL( fund, loan_info["balance"].as() ); + BOOST_REQUIRE_EQUAL( payment, loan_info["payment"].as() ); + + // in the meantime, defund then fund the same amount and test the balances + { + const asset amount = core_sym::from_string("7.5000"); + BOOST_REQUIRE_EQUAL( defundnetloan( frank, 1, fund ), wasm_assert_msg("loan not found") ); + BOOST_REQUIRE_EQUAL( defundcpuloan( alice, 1, fund ), wasm_assert_msg("user must be loan creator") ); + BOOST_REQUIRE_EQUAL( defundcpuloan( frank, 1, core_sym::from_string("75.0000") ), wasm_assert_msg("insufficent loan balance") ); + old_frank_balance = cur_frank_balance; + asset old_loan_balance = get_cpu_loan(1)["balance"].as(); + BOOST_REQUIRE_EQUAL( defundcpuloan( frank, 1, amount ), success() ); + BOOST_REQUIRE_EQUAL( old_loan_balance, get_cpu_loan(1)["balance"].as() + amount ); + cur_frank_balance = get_rex_fund( frank ); + old_loan_balance = get_cpu_loan(1)["balance"].as(); + BOOST_REQUIRE_EQUAL( old_frank_balance + amount, cur_frank_balance ); + old_frank_balance = cur_frank_balance; + BOOST_REQUIRE_EQUAL( fundcpuloan( frank, 1, amount ), success() ); + BOOST_REQUIRE_EQUAL( old_loan_balance + amount, get_cpu_loan(1)["balance"].as() ); + cur_frank_balance = get_rex_fund( frank ); + BOOST_REQUIRE_EQUAL( old_frank_balance - amount, cur_frank_balance ); + } + + // wait for 30 days, frank's loan will be renewed at the current price + produce_block( fc::minutes(30*24*60 - 1) ); + BOOST_REQUIRE_EQUAL( success(), updaterex( alice ) ); + rex_pool = get_rex_pool(); + { + int64_t unlent_tokens = bancor_convert( rex_pool["total_unlent"].as().get_amount(), + rex_pool["total_rent"].as().get_amount(), + expected_stake ); + + expected_stake = bancor_convert( rex_pool["total_rent"].as().get_amount() - unlent_tokens, + rex_pool["total_unlent"].as().get_amount() + expected_stake, + payment.get_amount() ); + } + + produce_block( fc::minutes(2) ); + + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset::from_string("1.0000 REX") ) ); + + loan_info = get_cpu_loan(1); + BOOST_REQUIRE_EQUAL( payment, loan_info["payment"].as() ); + BOOST_REQUIRE_EQUAL( fund - payment, loan_info["balance"].as() ); + BOOST_REQUIRE_EQUAL( expected_stake, loan_info["total_staked"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( expected_stake + init_stake, get_cpu_limit( bob ) ); + + // check that loans have been processed in order + BOOST_REQUIRE_EQUAL( false, get_cpu_loan(1).is_null() ); + BOOST_REQUIRE_EQUAL( true, get_cpu_loan(2).is_null() ); + BOOST_REQUIRE_EQUAL( true, get_net_loan(3).is_null() ); + BOOST_REQUIRE_EQUAL( true, get_net_loan(4).is_null() ); + BOOST_REQUIRE_EQUAL( false, get_net_loan(5).is_null() ); + BOOST_REQUIRE_EQUAL( 1, get_last_cpu_loan()["loan_num"].as_uint64() ); + BOOST_REQUIRE_EQUAL( 5, get_last_net_loan()["loan_num"].as_uint64() ); + + // wait for another month, frank's loan doesn't have enough funds and will be closed + produce_block( fc::hours(30*24) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("10.0000") ) ); + BOOST_REQUIRE_EQUAL( true, get_cpu_loan(1).is_null() ); + BOOST_REQUIRE_EQUAL( init_stake, get_cpu_limit( bob ) ); + old_frank_balance = cur_frank_balance; + cur_frank_balance = get_rex_fund( frank ); + BOOST_REQUIRE_EQUAL( fund - payment, cur_frank_balance - old_frank_balance ); + BOOST_REQUIRE ( old_frank_balance < cur_frank_balance ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( rex_loan_checks, eosio_system_tester ) try { + + const int64_t ratio = 10000; + const asset init_balance = core_sym::from_string("40000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount) }; + account_name alice = accounts[0], bob = accounts[1]; + setup_rex_accounts( accounts, init_balance ); + + const asset payment1 = core_sym::from_string("20000.0000"); + const asset payment2 = core_sym::from_string("4.0000"); + const asset fee = core_sym::from_string("1.0000"); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment1 ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("loan price does not favor renting"), + rentcpu( bob, bob, fee ) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment2 ) ); + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, fee, fee + fee + fee ) ); + BOOST_REQUIRE_EQUAL( true, !get_cpu_loan(1).is_null() ); + BOOST_REQUIRE_EQUAL( 3 * fee.get_amount(), get_last_cpu_loan()["balance"].as().get_amount() ); + + produce_block( fc::days(31) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 3) ); + BOOST_REQUIRE_EQUAL( 2 * fee.get_amount(), get_last_cpu_loan()["balance"].as().get_amount() ); + + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset::from_string("1000000.0000 REX") ) ); + produce_block( fc::days(31) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 3) ); + BOOST_REQUIRE_EQUAL( true, get_cpu_loan(1).is_null() ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( ramfee_namebid_to_rex, eosio_system_tester ) try { + + const int64_t ratio = 10000; + const asset init_balance = core_sym::from_string("10000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount), N(frankaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3], frank = accounts[4]; + setup_rex_accounts( accounts, init_balance, core_sym::from_string("80.0000"), core_sym::from_string("80.0000"), false ); + + asset cur_ramfee_balance = get_balance( N(eosio.ramfee) ); + BOOST_REQUIRE_EQUAL( success(), buyram( alice, alice, core_sym::from_string("20.0000") ) ); + BOOST_REQUIRE_EQUAL( get_balance( N(eosio.ramfee) ), core_sym::from_string("0.1000") + cur_ramfee_balance ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must deposit to REX fund first"), + buyrex( alice, core_sym::from_string("350.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), deposit( alice, core_sym::from_string("350.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("350.0000") ) ); + cur_ramfee_balance = get_balance( N(eosio.ramfee) ); + asset cur_rex_balance = get_balance( N(eosio.rex) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("350.0000"), cur_rex_balance ); + BOOST_REQUIRE_EQUAL( success(), buyram( bob, carol, core_sym::from_string("70.0000") ) ); + BOOST_REQUIRE_EQUAL( cur_ramfee_balance, get_balance( N(eosio.ramfee) ) ); + BOOST_REQUIRE_EQUAL( get_balance( N(eosio.rex) ), cur_rex_balance + core_sym::from_string("0.3500") ); + + cur_rex_balance = get_balance( N(eosio.rex) ); + + produce_blocks( 1 ); + produce_block( fc::hours(30*24 + 12) ); + produce_blocks( 1 ); + + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 1 ) ); + auto cur_rex_pool = get_rex_pool(); + + BOOST_TEST_REQUIRE( within_one( cur_rex_balance.get_amount(), cur_rex_pool["total_unlent"].as().get_amount() ) ); + BOOST_TEST_REQUIRE( cur_rex_balance >= cur_rex_pool["total_unlent"].as() ); + BOOST_REQUIRE_EQUAL( 0, cur_rex_pool["total_lent"].as().get_amount() ); + BOOST_TEST_REQUIRE( within_one( cur_rex_balance.get_amount(), cur_rex_pool["total_lendable"].as().get_amount() ) ); + BOOST_TEST_REQUIRE( cur_rex_balance >= cur_rex_pool["total_lendable"].as() ); + BOOST_REQUIRE_EQUAL( 0, cur_rex_pool["namebid_proceeds"].as().get_amount() ); + + // required for closing namebids + cross_15_percent_threshold(); + produce_block( fc::days(14) ); + + cur_rex_balance = get_balance( N(eosio.rex) ); + BOOST_REQUIRE_EQUAL( success(), bidname( carol, N(rndmbid), core_sym::from_string("23.7000") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("23.7000"), get_balance( N(eosio.names) ) ); + BOOST_REQUIRE_EQUAL( success(), bidname( alice, N(rndmbid), core_sym::from_string("29.3500") ) ); + BOOST_REQUIRE_EQUAL( core_sym::from_string("29.3500"), get_balance( N(eosio.names) )); + + produce_block( fc::hours(24) ); + produce_blocks( 2 ); + + BOOST_REQUIRE_EQUAL( core_sym::from_string("29.3500"), get_rex_pool()["namebid_proceeds"].as() ); + BOOST_REQUIRE_EQUAL( success(), deposit( frank, core_sym::from_string("5.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( frank, core_sym::from_string("5.0000") ) ); + BOOST_REQUIRE_EQUAL( get_balance( N(eosio.rex) ), cur_rex_balance + core_sym::from_string("34.3500") ); + BOOST_REQUIRE_EQUAL( 0, get_balance( N(eosio.names) ).get_amount() ); + + cur_rex_balance = get_balance( N(eosio.rex) ); + produce_block( fc::hours(30*24 + 13) ); + produce_blocks( 1 ); + + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 1 ) ); + BOOST_REQUIRE_EQUAL( cur_rex_balance, get_rex_pool()["total_lendable"].as() ); + BOOST_REQUIRE_EQUAL( get_rex_pool()["total_lendable"].as(), + get_rex_pool()["total_unlent"].as() ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( rex_maturity, eosio_system_tester ) try { + + const asset init_balance = core_sym::from_string("1000000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount) }; + account_name alice = accounts[0], bob = accounts[1]; + setup_rex_accounts( accounts, init_balance ); + + const int64_t rex_ratio = 10000; + const symbol rex_sym( SY(4, REX) ); + + { + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("11.5000") ) ); + produce_block( fc::hours(3) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("18.5000") ) ); + produce_block( fc::hours(25) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, core_sym::from_string("25.0000") ) ); + + auto rex_balance = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( 550000 * rex_ratio, rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( 2, rex_balance["rex_maturities"].get_array().size() ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( alice, asset::from_string("115000.0000 REX") ) ); + produce_block( fc::hours( 3*24 + 20) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset::from_string("300000.0000 REX") ) ); + rex_balance = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( 250000 * rex_ratio, rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + produce_block( fc::hours(23) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( alice, asset::from_string("250000.0000 REX") ) ); + produce_block( fc::days(1) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset::from_string("130000.0000 REX") ) ); + rex_balance = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( 1200000000, rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 1200000000, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( alice, asset::from_string("130000.0000 REX") ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset::from_string("120000.0000 REX") ) ); + rex_balance = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["rex_maturities"].get_array().size() ); + } + + { + const asset payment1 = core_sym::from_string("14.8000"); + const asset payment2 = core_sym::from_string("15.2000"); + const asset payment = payment1 + payment2; + const asset rex_bucket( rex_ratio * payment.get_amount(), rex_sym ); + for ( uint8_t i = 0; i < 8; ++i ) { + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, payment1 ) ); + produce_block( fc::hours(2) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, payment2 ) ); + produce_block( fc::hours(24) ); + } + + auto rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 8 * rex_bucket.get_amount(), rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 5, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 3 * rex_bucket.get_amount(), rex_balance["matured_rex"].as() ); + + BOOST_REQUIRE_EQUAL( success(), updaterex( bob ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 4, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 4 * rex_bucket.get_amount(), rex_balance["matured_rex"].as() ); + + produce_block( fc::hours(2) ); + BOOST_REQUIRE_EQUAL( success(), updaterex( bob ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 4, rex_balance["rex_maturities"].get_array().size() ); + + produce_block( fc::hours(1) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, asset( 3 * rex_bucket.get_amount(), rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 4, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( rex_bucket.get_amount(), rex_balance["matured_rex"].as() ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( bob, asset( 2 * rex_bucket.get_amount(), rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, asset( rex_bucket.get_amount(), rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 4 * rex_bucket.get_amount(), rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 4, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + + produce_block( fc::hours(23) ); + BOOST_REQUIRE_EQUAL( success(), updaterex( bob ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 3, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( rex_bucket.get_amount(), rex_balance["matured_rex"].as() ); + + BOOST_REQUIRE_EQUAL( success(), consolidate( bob ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + + produce_block( fc::days(3) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( bob, asset( 4 * rex_bucket.get_amount(), rex_sym ) ) ); + produce_block( fc::hours(24 + 20) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, asset( 4 * rex_bucket.get_amount(), rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + } + + { + const asset payment1 = core_sym::from_string("250000.0000"); + const asset payment2 = core_sym::from_string("10000.0000"); + const asset rex_bucket1( rex_ratio * payment1.get_amount(), rex_sym ); + const asset rex_bucket2( rex_ratio * payment2.get_amount(), rex_sym ); + const asset tot_rex = rex_bucket1 + rex_bucket2; + + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, payment1 ) ); + produce_block( fc::days(3) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, payment2 ) ); + produce_block( fc::days(2) ); + BOOST_REQUIRE_EQUAL( success(), updaterex( bob ) ); + + auto rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( tot_rex, rex_balance["rex_balance"].as() ); + BOOST_REQUIRE_EQUAL( rex_bucket1.get_amount(), rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( success(), rentcpu( alice, alice, core_sym::from_string("8000.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, asset( rex_bucket1.get_amount() - 20, rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( rex_bucket1.get_amount(), get_rex_order( bob )["rex_requested"].as().get_amount() + 20 ); + BOOST_REQUIRE_EQUAL( tot_rex, rex_balance["rex_balance"].as() ); + BOOST_REQUIRE_EQUAL( rex_bucket1.get_amount(), rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( success(), consolidate( bob ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( rex_bucket1.get_amount(), rex_balance["matured_rex"].as() + 20 ); + BOOST_REQUIRE_EQUAL( success(), cancelrexorder( bob ) ); + BOOST_REQUIRE_EQUAL( success(), consolidate( bob ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + } + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( rex_savings, eosio_system_tester ) try { + + const asset init_balance = core_sym::from_string("100000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount), N(frankaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3], frank = accounts[4]; + setup_rex_accounts( accounts, init_balance ); + + const int64_t rex_ratio = 10000; + const symbol rex_sym( SY(4, REX) ); + + { + const asset payment1 = core_sym::from_string("14.8000"); + const asset payment2 = core_sym::from_string("15.2000"); + const asset payment = payment1 + payment2; + const asset rex_bucket( rex_ratio * payment.get_amount(), rex_sym ); + for ( uint8_t i = 0; i < 8; ++i ) { + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment1 ) ); + produce_block( fc::hours(12) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment2 ) ); + produce_block( fc::hours(14) ); + } + + auto rex_balance = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( 8 * rex_bucket.get_amount(), rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 5, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 4 * rex_bucket.get_amount(), rex_balance["matured_rex"].as() ); + + BOOST_REQUIRE_EQUAL( success(), mvtosavings( alice, asset( 8 * rex_bucket.get_amount(), rex_sym ) ) ); + rex_balance = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + produce_block( fc::days(1000) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( alice, asset::from_string( "1.0000 REX" ) ) ); + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( alice, asset::from_string( "10.0000 REX" ) ) ); + rex_balance = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( 2, rex_balance["rex_maturities"].get_array().size() ); + produce_block( fc::days(3) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( alice, asset::from_string( "1.0000 REX" ) ) ); + produce_blocks( 2 ); + produce_block( fc::days(2) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( alice, asset::from_string( "10.0001 REX" ) ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset::from_string( "10.0000 REX" ) ) ); + rex_balance = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + produce_block( fc::days(100) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( alice, asset::from_string( "0.0001 REX" ) ) ); + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( alice, get_rex_balance( alice ) ) ); + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, get_rex_balance( alice ) ) ); + } + + { + const asset payment = core_sym::from_string("20.0000"); + const asset rex_bucket( rex_ratio * payment.get_amount(), rex_sym ); + for ( uint8_t i = 0; i < 5; ++i ) { + produce_block( fc::hours(24) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, payment ) ); + } + + auto rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 5 * rex_bucket.get_amount(), rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 5, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( success(), mvtosavings( bob, asset( rex_bucket.get_amount() / 2, rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 6, rex_balance["rex_maturities"].get_array().size() ); + + BOOST_REQUIRE_EQUAL( success(), mvtosavings( bob, asset( rex_bucket.get_amount() / 2, rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 5, rex_balance["rex_maturities"].get_array().size() ); + produce_block( fc::days(1) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, rex_bucket ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 4, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( 4 * rex_bucket.get_amount(), rex_balance["rex_balance"].as().get_amount() ); + + BOOST_REQUIRE_EQUAL( success(), mvtosavings( bob, asset( 3 * rex_bucket.get_amount() / 2, rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 3, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( bob, rex_bucket ) ); + + produce_block( fc::days(1) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, rex_bucket ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 2, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( 3 * rex_bucket.get_amount(), rex_balance["rex_balance"].as().get_amount() ); + + produce_block( fc::days(1) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( bob, rex_bucket ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, asset( rex_bucket.get_amount() / 2, rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( 5 * rex_bucket.get_amount(), 2 * rex_balance["rex_balance"].as().get_amount() ); + + produce_block( fc::days(20) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( bob, rex_bucket ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient REX in savings"), + mvfrsavings( bob, asset( 3 * rex_bucket.get_amount(), rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( bob, rex_bucket ) ); + BOOST_REQUIRE_EQUAL( 2, get_rex_balance_obj( bob )["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient REX balance"), + mvtosavings( bob, asset( 3 * rex_bucket.get_amount() / 2, rex_sym ) ) ); + produce_block( fc::days(1) ); + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( bob, rex_bucket ) ); + BOOST_REQUIRE_EQUAL( 3, get_rex_balance_obj( bob )["rex_maturities"].get_array().size() ); + produce_block( fc::days(4) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, rex_bucket ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( bob, rex_bucket ) ); + produce_block( fc::days(1) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, rex_bucket ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( rex_bucket.get_amount() / 2, rex_balance["rex_balance"].as().get_amount() ); + + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( bob, asset( rex_bucket.get_amount() / 4, rex_sym ) ) ); + produce_block( fc::days(2) ); + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( bob, asset( rex_bucket.get_amount() / 8, rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( 3, get_rex_balance_obj( bob )["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( success(), consolidate( bob ) ); + BOOST_REQUIRE_EQUAL( 2, get_rex_balance_obj( bob )["rex_maturities"].get_array().size() ); + + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient available rex"), + sellrex( bob, asset( rex_bucket.get_amount() / 2, rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, asset( 3 * rex_bucket.get_amount() / 8, rex_sym ) ) ); + rex_balance = get_rex_balance_obj( bob ); + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + BOOST_REQUIRE_EQUAL( rex_bucket.get_amount() / 8, rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( bob, get_rex_balance( bob ) ) ); + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, get_rex_balance( bob ) ) ); + } + + { + const asset payment = core_sym::from_string("40000.0000"); + const int64_t rex_bucket_amount = rex_ratio * payment.get_amount(); + const asset rex_bucket( rex_bucket_amount, rex_sym ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment ) ); + BOOST_REQUIRE_EQUAL( rex_bucket, get_rex_balance( alice ) ); + BOOST_REQUIRE_EQUAL( rex_bucket, get_rex_pool()["total_rex"].as() ); + + produce_block( fc::days(5) ); + + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, core_sym::from_string("3000.0000") ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset( 9 * rex_bucket_amount / 10, rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( rex_bucket, get_rex_balance( alice ) ); + BOOST_REQUIRE_EQUAL( success(), mvtosavings( alice, asset( rex_bucket_amount / 10, rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient REX balance"), + mvtosavings( alice, asset( rex_bucket_amount / 10, rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( success(), cancelrexorder( alice ) ); + BOOST_REQUIRE_EQUAL( success(), mvtosavings( alice, asset( rex_bucket_amount / 10, rex_sym ) ) ); + auto rb = get_rex_balance_obj( alice ); + BOOST_REQUIRE_EQUAL( rb["matured_rex"].as(), 8 * rex_bucket_amount / 10 ); + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( alice, asset( 2 * rex_bucket_amount / 10, rex_sym ) ) ); + produce_block( fc::days(31) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, get_rex_balance( alice ) ) ); + } + + { + const asset payment = core_sym::from_string("250.0000"); + const asset half_payment = core_sym::from_string("125.0000"); + const int64_t rex_bucket_amount = rex_ratio * payment.get_amount(); + const int64_t half_rex_bucket_amount = rex_bucket_amount / 2; + const asset rex_bucket( rex_bucket_amount, rex_sym ); + const asset half_rex_bucket( half_rex_bucket_amount, rex_sym ); + + BOOST_REQUIRE_EQUAL( success(), buyrex( carol, payment ) ); + BOOST_REQUIRE_EQUAL( rex_bucket, get_rex_balance( carol ) ); + auto rex_balance = get_rex_balance_obj( carol ); + + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + produce_block( fc::days(1) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( carol, payment ) ); + rex_balance = get_rex_balance_obj( carol ); + BOOST_REQUIRE_EQUAL( 2, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, rex_balance["matured_rex"].as() ); + + BOOST_REQUIRE_EQUAL( success(), mvtosavings( carol, half_rex_bucket ) ); + rex_balance = get_rex_balance_obj( carol ); + BOOST_REQUIRE_EQUAL( 3, rex_balance["rex_maturities"].get_array().size() ); + + BOOST_REQUIRE_EQUAL( success(), buyrex( carol, half_payment ) ); + rex_balance = get_rex_balance_obj( carol ); + BOOST_REQUIRE_EQUAL( 3, rex_balance["rex_maturities"].get_array().size() ); + + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("asset must be a positive amount of (REX, 4)"), + mvfrsavings( carol, asset::from_string("0.0000 REX") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("asset must be a positive amount of (REX, 4)"), + mvfrsavings( carol, asset::from_string("1.0000 RND") ) ); + BOOST_REQUIRE_EQUAL( success(), mvfrsavings( carol, half_rex_bucket ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient REX in savings"), + mvfrsavings( carol, asset::from_string("0.0001 REX") ) ); + rex_balance = get_rex_balance_obj( carol ); + BOOST_REQUIRE_EQUAL( 1, rex_balance["rex_maturities"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 5 * half_rex_bucket_amount, rex_balance["rex_balance"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 2 * rex_bucket_amount, rex_balance["matured_rex"].as() ); + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( carol, get_rex_balance( carol) ) ); + } + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( update_rex, eosio_system_tester, * boost::unit_test::tolerance(1e-10) ) try { + + const asset init_balance = core_sym::from_string("30000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3]; + setup_rex_accounts( accounts, init_balance ); + + const int64_t init_stake = get_voter_info( alice )["staked"].as(); + + // alice buys rex + const asset payment = core_sym::from_string("25000.0000"); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment ) ); + BOOST_REQUIRE_EQUAL( payment, get_rex_vote_stake(alice) ); + BOOST_REQUIRE_EQUAL( get_rex_vote_stake(alice).get_amount(), get_voter_info(alice)["staked"].as() - init_stake ); + + // emily rents cpu + const asset fee = core_sym::from_string("50.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( emily, bob, fee ) ); + BOOST_REQUIRE_EQUAL( success(), updaterex( alice ) ); + BOOST_REQUIRE_EQUAL( payment, get_rex_vote_stake(alice) ); + BOOST_REQUIRE_EQUAL( get_rex_vote_stake(alice).get_amount(), get_voter_info( alice )["staked"].as() - init_stake ); + + // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers + std::vector producer_names; + { + producer_names.reserve('z' - 'a' + 1); + const std::string root("defproducer"); + for ( char c = 'a'; c <= 'z'; ++c ) { + producer_names.emplace_back(root + std::string(1, c)); + } + + setup_producer_accounts(producer_names); + for ( const auto& p: producer_names ) { + BOOST_REQUIRE_EQUAL( success(), regproducer(p) ); + BOOST_TEST_REQUIRE( 0 == get_producer_info(p)["total_votes"].as() ); + } + } + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("voter holding REX tokens must vote for at least 21 producers or for a proxy"), + vote( alice, std::vector(producer_names.begin(), producer_names.begin() + 20) ) ); + BOOST_REQUIRE_EQUAL( success(), + vote( alice, std::vector(producer_names.begin(), producer_names.begin() + 21) ) ); + + BOOST_TEST_REQUIRE( stake2votes( asset( get_voter_info( alice )["staked"].as(), symbol{CORE_SYM} ) ) + == get_producer_info(producer_names[0])["total_votes"].as() ); + BOOST_TEST_REQUIRE( stake2votes( asset( get_voter_info( alice )["staked"].as(), symbol{CORE_SYM} ) ) + == get_producer_info(producer_names[20])["total_votes"].as() ); + + BOOST_REQUIRE_EQUAL( success(), updaterex( alice ) ); + produce_block( fc::days(10) ); + BOOST_TEST_REQUIRE( get_producer_info(producer_names[20])["total_votes"].as() + < stake2votes( asset( get_voter_info( alice )["staked"].as(), symbol{CORE_SYM} ) ) ); + + BOOST_REQUIRE_EQUAL( success(), updaterex( alice ) ); + BOOST_TEST_REQUIRE( stake2votes( asset( get_voter_info( alice )["staked"].as(), symbol{CORE_SYM} ) ) + == get_producer_info(producer_names[20])["total_votes"].as() ); + + produce_block( fc::hours(19 * 24 + 23) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 1 ) ); + const asset init_rex = get_rex_balance( alice ); + const auto current_rex_pool = get_rex_pool(); + const int64_t total_lendable = current_rex_pool["total_lendable"].as().get_amount(); + const int64_t total_rex = current_rex_pool["total_rex"].as().get_amount(); + const int64_t init_alice_rex_stake = ( eosio::chain::uint128_t(init_rex.get_amount()) * total_lendable ) / total_rex; + const asset rex_sell_amount( get_rex_balance(alice).get_amount() / 4, symbol( SY(4,REX) ) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, rex_sell_amount ) ); + BOOST_REQUIRE_EQUAL( init_rex, get_rex_balance(alice) + rex_sell_amount ); + BOOST_REQUIRE_EQUAL( 3 * init_alice_rex_stake, 4 * get_rex_vote_stake(alice).get_amount() ); + BOOST_REQUIRE_EQUAL( get_voter_info( alice )["staked"].as(), init_stake + get_rex_vote_stake(alice).get_amount() ); + BOOST_TEST_REQUIRE( stake2votes( asset( get_voter_info( alice )["staked"].as(), symbol{CORE_SYM} ) ) + == get_producer_info(producer_names[0])["total_votes"].as() ); + produce_block( fc::days(31) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, get_rex_balance( alice ) ) ); + BOOST_REQUIRE_EQUAL( 0, get_rex_balance( alice ).get_amount() ); + BOOST_REQUIRE_EQUAL( success(), vote( alice, { producer_names[0], producer_names[4] } ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must vote for at least 21 producers or for a proxy before buying REX"), + buyrex( alice, core_sym::from_string("1.0000") ) ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( update_rex_vote, eosio_system_tester, * boost::unit_test::tolerance(1e-8) ) try { + + cross_15_percent_threshold(); + + // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers + std::vector producer_names; + { + producer_names.reserve('z' - 'a' + 1); + const std::string root("defproducer"); + for ( char c = 'a'; c <= 'z'; ++c ) { + producer_names.emplace_back(root + std::string(1, c)); + } + + setup_producer_accounts(producer_names); + for ( const auto& p: producer_names ) { + BOOST_REQUIRE_EQUAL( success(), regproducer(p) ); + BOOST_TEST_REQUIRE( 0 == get_producer_info(p)["total_votes"].as() ); + } + } + + const asset init_balance = core_sym::from_string("30000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3]; + setup_rex_accounts( accounts, init_balance ); + + const int64_t init_stake_amount = get_voter_info( alice )["staked"].as(); + const asset init_stake( init_stake_amount, symbol{CORE_SYM} ); + + const asset purchase = core_sym::from_string("25000.0000"); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, purchase ) ); + BOOST_REQUIRE_EQUAL( purchase, get_rex_pool()["total_lendable"].as() ); + BOOST_REQUIRE_EQUAL( purchase, get_rex_vote_stake(alice) ); + BOOST_REQUIRE_EQUAL( get_rex_vote_stake(alice).get_amount(), get_voter_info(alice)["staked"].as() - init_stake_amount ); + BOOST_REQUIRE_EQUAL( purchase, get_rex_pool()["total_lendable"].as() ); + + BOOST_REQUIRE_EQUAL( success(), vote( alice, std::vector(producer_names.begin(), producer_names.begin() + 21) ) ); + BOOST_REQUIRE_EQUAL( purchase, get_rex_vote_stake(alice) ); + BOOST_REQUIRE_EQUAL( purchase.get_amount(), get_voter_info(alice)["staked"].as() - init_stake_amount ); + + const auto init_rex_pool = get_rex_pool(); + const asset rent = core_sym::from_string("25.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( emily, bob, rent ) ); + + produce_block( fc::days(31) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 1 ) ); + const auto curr_rex_pool = get_rex_pool(); + BOOST_TEST_REQUIRE( within_one( curr_rex_pool["total_lendable"].as().get_amount(), + init_rex_pool["total_lendable"].as().get_amount() + rent.get_amount() ) ); + + BOOST_REQUIRE_EQUAL( success(), vote( alice, std::vector(producer_names.begin(), producer_names.begin() + 21) ) ); + BOOST_TEST_REQUIRE( within_one( (purchase + rent).get_amount(), get_voter_info(alice)["staked"].as() - init_stake_amount ) ); + BOOST_TEST_REQUIRE( within_one( (purchase + rent).get_amount(), get_rex_vote_stake(alice).get_amount() ) ); + BOOST_TEST_REQUIRE ( stake2votes(purchase + rent + init_stake) == + get_producer_info(producer_names[0])["total_votes"].as_double() ); + BOOST_TEST_REQUIRE ( stake2votes(purchase + rent + init_stake) == + get_producer_info(producer_names[20])["total_votes"].as_double() ); + + const asset to_net_stake = core_sym::from_string("60.0000"); + const asset to_cpu_stake = core_sym::from_string("40.0000"); + transfer( config::system_account_name, alice, to_net_stake + to_cpu_stake, config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), rentcpu( emily, bob, rent ) ); + produce_block( fc::hours(30 * 24 + 13) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 1 ) ); + BOOST_REQUIRE_EQUAL( success(), stake( alice, alice, to_net_stake, to_cpu_stake ) ); + BOOST_REQUIRE_EQUAL( purchase + rent + rent, get_rex_vote_stake(alice) ); + BOOST_TEST_REQUIRE ( stake2votes(init_stake + purchase + rent + rent + to_net_stake + to_cpu_stake) == + get_producer_info(producer_names[0])["total_votes"].as_double() ); + BOOST_REQUIRE_EQUAL( success(), rentcpu( emily, bob, rent ) ); + produce_block( fc::hours(30 * 24 + 13) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( alice, 1 ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( alice, alice, to_net_stake, to_cpu_stake ) ); + BOOST_REQUIRE_EQUAL( purchase + rent + rent + rent, get_rex_vote_stake(alice) ); + BOOST_TEST_REQUIRE ( stake2votes(init_stake + get_rex_vote_stake(alice) ) == + get_producer_info(producer_names[0])["total_votes"].as_double() ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( deposit_rex_fund, eosio_system_tester ) try { + + const asset init_balance = core_sym::from_string("1000.0000"); + const asset init_net = core_sym::from_string("70.0000"); + const asset init_cpu = core_sym::from_string("90.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount) }; + account_name alice = accounts[0], bob = accounts[1]; + setup_rex_accounts( accounts, init_balance, init_net, init_cpu, false ); + + BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), get_rex_fund( alice ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must deposit to REX fund first"), withdraw( alice, core_sym::from_string("0.0001") ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("overdrawn balance"), deposit( alice, init_balance + init_balance ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("must deposit core token"), deposit( alice, asset::from_string("1.0000 RNDM") ) ); + + asset deposit_quant( init_balance.get_amount() / 5, init_balance.get_symbol() ); + BOOST_REQUIRE_EQUAL( success(), deposit( alice, deposit_quant ) ); + BOOST_REQUIRE_EQUAL( get_balance( alice ), init_balance - deposit_quant ); + BOOST_REQUIRE_EQUAL( get_rex_fund( alice ), deposit_quant ); + BOOST_REQUIRE_EQUAL( success(), deposit( alice, deposit_quant ) ); + BOOST_REQUIRE_EQUAL( get_rex_fund( alice ), deposit_quant + deposit_quant ); + BOOST_REQUIRE_EQUAL( get_balance( alice ), init_balance - deposit_quant - deposit_quant ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient funds"), withdraw( alice, get_rex_fund( alice ) + core_sym::from_string("0.0001")) ); + BOOST_REQUIRE_EQUAL( success(), withdraw( alice, deposit_quant ) ); + BOOST_REQUIRE_EQUAL( get_rex_fund( alice ), deposit_quant ); + BOOST_REQUIRE_EQUAL( get_balance( alice ), init_balance - deposit_quant ); + BOOST_REQUIRE_EQUAL( success(), withdraw( alice, get_rex_fund( alice ) ) ); + BOOST_REQUIRE_EQUAL( get_rex_fund( alice ).get_amount(), 0 ); + BOOST_REQUIRE_EQUAL( get_balance( alice ), init_balance ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( rex_lower_bound, eosio_system_tester ) try { + + const asset init_balance = core_sym::from_string("25000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount) }; + account_name alice = accounts[0], bob = accounts[1]; + setup_rex_accounts( accounts, init_balance ); + const symbol rex_sym( SY(4, REX) ); + + const asset payment = core_sym::from_string("25000.0000"); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment ) ); + const asset fee = core_sym::from_string("25.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, fee ) ); + + const auto rex_pool = get_rex_pool(); + const int64_t tot_rex = rex_pool["total_rex"].as().get_amount(); + const int64_t tot_unlent = rex_pool["total_unlent"].as().get_amount(); + const int64_t tot_lent = rex_pool["total_lent"].as().get_amount(); + const int64_t tot_lendable = rex_pool["total_lendable"].as().get_amount(); + double rex_per_eos = double(tot_rex) / double(tot_lendable); + int64_t sell_amount = rex_per_eos * ( tot_unlent - 0.09 * tot_lent ); + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset( sell_amount, rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( success(), cancelrexorder( alice ) ); + sell_amount = rex_per_eos * ( tot_unlent - 0.1 * tot_lent ); + BOOST_REQUIRE_EQUAL( success(), sellrex( alice, asset( sell_amount, rex_sym ) ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("no sellrex order is scheduled"), + cancelrexorder( alice ) ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( close_rex, eosio_system_tester ) try { + + const asset init_balance = core_sym::from_string("25000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount), N(carolaccount), N(emilyaccount) }; + account_name alice = accounts[0], bob = accounts[1], carol = accounts[2], emily = accounts[3]; + setup_rex_accounts( accounts, init_balance ); + + BOOST_REQUIRE_EQUAL( true, !get_rex_fund_obj( alice ).is_null() ); + BOOST_REQUIRE_EQUAL( init_balance, get_rex_fund( alice ) ); + BOOST_REQUIRE_EQUAL( success(), closerex( alice ) ); + BOOST_REQUIRE_EQUAL( success(), withdraw( alice, init_balance ) ); + BOOST_REQUIRE_EQUAL( success(), closerex( alice ) ); + BOOST_REQUIRE_EQUAL( true, get_rex_fund_obj( alice ).is_null() ); + BOOST_REQUIRE_EQUAL( success(), deposit( alice, init_balance ) ); + BOOST_REQUIRE_EQUAL( true, !get_rex_fund_obj( alice ).is_null() ); + + BOOST_REQUIRE_EQUAL( true, get_rex_balance_obj( bob ).is_null() ); + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, init_balance ) ); + BOOST_REQUIRE_EQUAL( true, !get_rex_balance_obj( bob ).is_null() ); + BOOST_REQUIRE_EQUAL( true, !get_rex_fund_obj( bob ).is_null() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_fund( bob ).get_amount() ); + BOOST_REQUIRE_EQUAL( closerex( bob ), wasm_assert_msg("account has remaining REX balance, must sell first") ); + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, get_rex_balance( bob ) ) ); + BOOST_REQUIRE_EQUAL( success(), closerex( bob ) ); + BOOST_REQUIRE_EQUAL( success(), withdraw( bob, get_rex_fund( bob ) ) ); + BOOST_REQUIRE_EQUAL( success(), closerex( bob ) ); + BOOST_REQUIRE_EQUAL( true, get_rex_balance_obj( bob ).is_null() ); + BOOST_REQUIRE_EQUAL( true, get_rex_fund_obj( bob ).is_null() ); + + BOOST_REQUIRE_EQUAL( success(), deposit( bob, init_balance ) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( bob, init_balance ) ); + + const asset fee = core_sym::from_string("1.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( carol, emily, fee ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("insufficient funds"), + withdraw( carol, init_balance ) ); + BOOST_REQUIRE_EQUAL( success(), withdraw( carol, init_balance - fee ) ); + + produce_block( fc::days(20) ); + + BOOST_REQUIRE_EQUAL( success(), closerex( carol ) ); + BOOST_REQUIRE_EQUAL( true, !get_rex_fund_obj( carol ).is_null() ); + + produce_block( fc::days(10) ); + + BOOST_REQUIRE_EQUAL( success(), closerex( carol ) ); + BOOST_REQUIRE_EQUAL( true, get_rex_balance_obj( carol ).is_null() ); + BOOST_REQUIRE_EQUAL( true, get_rex_fund_obj( carol ).is_null() ); + + BOOST_REQUIRE_EQUAL( success(), rentnet( emily, emily, fee ) ); + BOOST_REQUIRE_EQUAL( true, !get_rex_fund_obj( emily ).is_null() ); + BOOST_REQUIRE_EQUAL( success(), closerex( emily ) ); + BOOST_REQUIRE_EQUAL( true, !get_rex_fund_obj( emily ).is_null() ); + + BOOST_REQUIRE_EQUAL( success(), sellrex( bob, get_rex_balance( bob ) ) ); + BOOST_REQUIRE_EQUAL( closerex( bob ), wasm_assert_msg("account has remaining REX balance, must sell first") ); + + produce_block( fc::days(30) ); + + BOOST_REQUIRE_EQUAL( closerex( bob ), success() ); + BOOST_REQUIRE ( 0 < get_rex_fund( bob ).get_amount() ); + BOOST_REQUIRE_EQUAL( success(), withdraw( bob, get_rex_fund( bob ) ) ); + BOOST_REQUIRE_EQUAL( success(), closerex( bob ) ); + BOOST_REQUIRE_EQUAL( true, get_rex_balance_obj( bob ).is_null() ); + BOOST_REQUIRE_EQUAL( true, get_rex_fund_obj( bob ).is_null() ); + + BOOST_REQUIRE_EQUAL( 0, get_rex_pool()["total_rex"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_pool()["total_lendable"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("rex loans are currently not available"), + rentcpu( emily, emily, core_sym::from_string("1.0000") ) ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( set_rex, eosio_system_tester ) try { + + const asset init_balance = core_sym::from_string("25000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount) }; + account_name alice = accounts[0], bob = accounts[1]; + setup_rex_accounts( accounts, init_balance ); + + const name act_name{ N(setrex) }; + const asset init_total_rent = core_sym::from_string("20000.0000"); + const asset set_total_rent = core_sym::from_string("10000.0000"); + const asset negative_balance = core_sym::from_string("-10000.0000"); + const asset different_symbol = asset::from_string("10000.0000 RND"); + BOOST_REQUIRE_EQUAL( error("missing authority of eosio"), + push_action( alice, act_name, mvo()("balance", set_total_rent) ) ); + BOOST_REQUIRE_EQUAL( error("missing authority of eosio"), + push_action( bob, act_name, mvo()("balance", set_total_rent) ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("rex system is not initialized"), + push_action( config::system_account_name, act_name, mvo()("balance", set_total_rent) ) ); + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, init_balance ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("balance must be set to have a positive amount"), + push_action( config::system_account_name, act_name, mvo()("balance", negative_balance) ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("balance symbol must be core symbol"), + push_action( config::system_account_name, act_name, mvo()("balance", different_symbol) ) ); + const asset fee = core_sym::from_string("100.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, fee ) ); + const auto& init_rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( init_total_rent + fee, init_rex_pool["total_rent"].as() ); + BOOST_TEST_REQUIRE( set_total_rent != init_rex_pool["total_rent"].as() ); + BOOST_REQUIRE_EQUAL( success(), + push_action( config::system_account_name, act_name, mvo()("balance", set_total_rent) ) ); + const auto& curr_rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( init_rex_pool["total_lendable"].as(), curr_rex_pool["total_lendable"].as() ); + BOOST_REQUIRE_EQUAL( init_rex_pool["total_lent"].as(), curr_rex_pool["total_lent"].as() ); + BOOST_REQUIRE_EQUAL( init_rex_pool["total_unlent"].as(), curr_rex_pool["total_unlent"].as() ); + BOOST_REQUIRE_EQUAL( init_rex_pool["namebid_proceeds"].as(), curr_rex_pool["namebid_proceeds"].as() ); + BOOST_REQUIRE_EQUAL( init_rex_pool["loan_num"].as_uint64(), curr_rex_pool["loan_num"].as_uint64() ); + BOOST_REQUIRE_EQUAL( set_total_rent, curr_rex_pool["total_rent"].as() ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( b1_vesting, eosio_system_tester ) try { + + cross_15_percent_threshold(); + + produce_block( fc::days(14) ); + + const asset init_balance = core_sym::from_string("25000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount) }; + account_name alice = accounts[0], bob = accounts[1]; + setup_rex_accounts( accounts, init_balance ); + + const name b1{ N(b1) }; + + issue_and_transfer( alice, core_sym::from_string("20000.0000"), config::system_account_name ); + issue_and_transfer( bob, core_sym::from_string("20000.0000"), config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), bidname( bob, b1, core_sym::from_string( "0.5000" ) ) ); + BOOST_REQUIRE_EQUAL( success(), bidname( alice, b1, core_sym::from_string( "1.0000" ) ) ); + + produce_block( fc::days(1) ); + + create_accounts_with_resources( { b1 }, alice ); + + const asset stake_amount = core_sym::from_string("50000000.0000"); + const asset half_stake = core_sym::from_string("25000000.0000"); + const asset small_amount = core_sym::from_string("1000.0000"); + issue_and_transfer( b1, stake_amount + stake_amount + stake_amount, config::system_account_name ); + + stake( b1, b1, stake_amount, stake_amount ); + + BOOST_REQUIRE_EQUAL( 2 * stake_amount.get_amount(), get_voter_info( b1 )["staked"].as() ); + + BOOST_REQUIRE_EQUAL( success(), unstake( b1, b1, small_amount, small_amount ) ); + + produce_block( fc::days(4) ); + + BOOST_REQUIRE_EQUAL( success(), push_action( b1, N(refund), mvo()("owner", b1) ) ); + + BOOST_REQUIRE_EQUAL( 2 * ( stake_amount.get_amount() - small_amount.get_amount() ), + get_voter_info( b1 )["staked"].as() ); + + produce_block( fc::days( 3 * 364 ) ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("b1 can only claim their tokens over 10 years"), + unstake( b1, b1, half_stake, half_stake ) ); + + BOOST_REQUIRE_EQUAL( success(), vote( b1, { }, N(proxyaccount) ) ); + BOOST_REQUIRE_EQUAL( success(), unstaketorex( b1, b1, half_stake, half_stake ) ); + + produce_block( fc::days(5) ); + produce_blocks(1); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("b1 can only claim their tokens over 10 years"), + sellrex( b1, get_rex_balance( b1 ) ) ); + + produce_block( fc::days( 2 * 364 ) ); + + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, core_sym::from_string("10000.0000") ) ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("b1 sellrex orders should not be queued"), + sellrex( b1, get_rex_balance( b1 ) ) ); + + produce_block( fc::days( 30 ) ); + + BOOST_REQUIRE_EQUAL( success(), sellrex( b1, get_rex_balance( b1 ) ) ); + + produce_block( fc::days( 3 * 364 ) ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg("b1 can only claim their tokens over 10 years"), + unstake( b1, b1, half_stake - small_amount, half_stake - small_amount ) ); + + produce_block( fc::days( 1 * 364 ) ); + + BOOST_REQUIRE_EQUAL( success(), + unstake( b1, b1, half_stake - small_amount, half_stake - small_amount ) ); + + produce_block( fc::days(4) ); + BOOST_REQUIRE_EQUAL( success(), push_action( b1, N(refund), mvo()("owner", b1) ) ); + +} FC_LOG_AND_RETHROW() + + +BOOST_FIXTURE_TEST_CASE( rex_return, eosio_system_tester ) try { + + constexpr uint32_t total_intervals = 30 * 144; + constexpr uint32_t dist_interval = 10 * 60; + BOOST_REQUIRE_EQUAL( true, get_rex_return_pool().is_null() ); + + const asset init_balance = core_sym::from_string("100000.0000"); + const std::vector accounts = { N(aliceaccount), N(bobbyaccount) }; + account_name alice = accounts[0], bob = accounts[1]; + setup_rex_accounts( accounts, init_balance ); + + const asset payment = core_sym::from_string("100000.0000"); + { + BOOST_REQUIRE_EQUAL( success(), buyrex( alice, payment ) ); + auto rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( payment, rex_pool["total_lendable"].as() ); + BOOST_REQUIRE_EQUAL( payment, rex_pool["total_unlent"].as() ); + + BOOST_REQUIRE_EQUAL( true, get_rex_return_pool().is_null() ); + } + + { + const asset fee = core_sym::from_string("30.0000"); + const uint32_t bucket_interval_sec = fc::hours(12).to_seconds(); + const uint32_t current_time_sec = control->pending_block_time().sec_since_epoch(); + const time_point_sec expected_pending_bucket_time{current_time_sec - current_time_sec % bucket_interval_sec + bucket_interval_sec}; + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, fee ) ); + auto rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( false, rex_return_pool.is_null() ); + BOOST_REQUIRE_EQUAL( 0, rex_return_pool["current_rate_of_increase"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_return_buckets()["return_buckets"].get_array().size() ); + BOOST_REQUIRE_EQUAL( expected_pending_bucket_time.sec_since_epoch(), + rex_return_pool["pending_bucket_time"].as().sec_since_epoch() ); + int32_t t0 = rex_return_pool["pending_bucket_time"].as().sec_since_epoch(); + + produce_block( fc::hours(13) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + rex_return_pool = get_rex_return_pool(); + int64_t rate = fee.get_amount() / total_intervals; + BOOST_REQUIRE_EQUAL( rate, rex_return_pool["current_rate_of_increase"].as() ); + + int32_t t1 = rex_return_pool["last_dist_time"].as().sec_since_epoch(); + int64_t change = rate * ((t1-t0) / dist_interval) + fee.get_amount() % total_intervals; + int64_t expected = payment.get_amount() + change; + + auto rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( expected, rex_pool["total_lendable"].as().get_amount() ); + + produce_blocks( 1 ); + produce_block( fc::days(25) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( rate, rex_return_pool["current_rate_of_increase"].as() ); + BOOST_REQUIRE_EQUAL( 1, get_rex_return_buckets()["return_buckets"].get_array().size() ); + int64_t t2 = rex_return_pool["last_dist_time"].as().sec_since_epoch(); + change = rate * ((t2-t0) / dist_interval) + fee.get_amount() % total_intervals; + expected = payment.get_amount() + change; + + rex_pool = get_rex_pool(); + BOOST_REQUIRE_EQUAL( expected, rex_pool["total_lendable"].as().get_amount() ); + + produce_blocks( 1 ); + produce_block( fc::days(5) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + + rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( 0, rex_return_pool["current_rate_of_increase"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_return_buckets()["return_buckets"].get_array().size() ); + + rex_pool = get_rex_pool(); + expected = payment.get_amount() + fee.get_amount(); + BOOST_REQUIRE_EQUAL( expected, rex_pool["total_lendable"].as().get_amount() ); + BOOST_REQUIRE_EQUAL( rex_pool["total_lendable"].as(), + rex_pool["total_unlent"].as() ); + } + + produce_block( fc::hours(1) ); + + { + const asset init_lendable = get_rex_pool()["total_lendable"].as(); + const asset fee = core_sym::from_string("15.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, fee ) ); + auto rex_return_pool = get_rex_return_pool(); + uint32_t t0 = rex_return_pool["last_dist_time"].as().sec_since_epoch(); + produce_block( fc::hours(1) ); + BOOST_REQUIRE_EQUAL( success(), rentnet( bob, bob, fee ) ); + rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( 0, rex_return_pool["current_rate_of_increase"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_return_buckets()["return_buckets"].get_array().size() ); + uint32_t t1 = rex_return_pool["last_dist_time"].as().sec_since_epoch(); + BOOST_REQUIRE_EQUAL( t1, t0 + 6 * dist_interval ); + + produce_block( fc::hours(12) ); + BOOST_REQUIRE_EQUAL( success(), rentnet( bob, bob, fee ) ); + rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( 1, get_rex_return_buckets()["return_buckets"].get_array().size() ); + int64_t rate = 2 * fee.get_amount() / total_intervals; + BOOST_REQUIRE_EQUAL( rate, rex_return_pool["current_rate_of_increase"].as() ); + produce_block( fc::hours(8) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( rate, rex_return_pool["current_rate_of_increase"].as() ); + + produce_block( fc::days(30) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( fee.get_amount() / total_intervals, rex_return_pool["current_rate_of_increase"].as() ); + BOOST_TEST_REQUIRE( (init_lendable + fee + fee).get_amount() < get_rex_pool()["total_lendable"].as().get_amount() ); + + produce_block( fc::days(1) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + rex_return_pool = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( 0, rex_return_pool["current_rate_of_increase"].as() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_return_buckets()["return_buckets"].get_array().size() ); + BOOST_REQUIRE_EQUAL( init_lendable.get_amount() + 3 * fee.get_amount(), + get_rex_pool()["total_lendable"].as().get_amount() ); + } + + { + const asset fee = core_sym::from_string("25.0000"); + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, fee ) ); + produce_block( fc::hours(13) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + auto rex_pool_0 = get_rex_pool(); + auto rex_return_pool_0 = get_rex_return_pool(); + produce_block( fc::minutes(2) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + auto rex_pool_1 = get_rex_pool(); + auto rex_return_pool_1 = get_rex_return_pool(); + BOOST_REQUIRE_EQUAL( rex_return_pool_0["last_dist_time"].as().sec_since_epoch(), + rex_return_pool_1["last_dist_time"].as().sec_since_epoch() ); + BOOST_REQUIRE_EQUAL( rex_pool_0["total_lendable"].as(), + rex_pool_1["total_lendable"].as() ); + produce_block( fc::minutes(9) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + auto rex_pool_2 = get_rex_pool(); + auto rex_return_pool_2 = get_rex_return_pool(); + BOOST_TEST_REQUIRE( rex_return_pool_1["last_dist_time"].as().sec_since_epoch() < + rex_return_pool_2["last_dist_time"].as().sec_since_epoch() ); + BOOST_TEST_REQUIRE( rex_pool_1["total_lendable"].as().get_amount() < + rex_pool_2["total_lendable"].as().get_amount() ); + produce_block( fc::days(31) ); + produce_blocks( 1 ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + BOOST_REQUIRE_EQUAL( 0, get_rex_return_buckets()["return_buckets"].get_array().size() ); + BOOST_REQUIRE_EQUAL( 0, get_rex_return_pool()["current_rate_of_increase"].as() ); + } + + { + const asset fee = core_sym::from_string("30.0000"); + for ( uint8_t i = 0; i < 5; ++i ) { + BOOST_REQUIRE_EQUAL( success(), rentcpu( bob, bob, fee ) ); + produce_block( fc::days(1) ); + } + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + BOOST_REQUIRE_EQUAL( 5, get_rex_return_buckets()["return_buckets"].get_array().size() ); + produce_block( fc::days(30) ); + BOOST_REQUIRE_EQUAL( success(), rexexec( bob, 1 ) ); + BOOST_REQUIRE_EQUAL( 0, get_rex_return_buckets()["return_buckets"].get_array().size() ); + } + +} FC_LOG_AND_RETHROW() + + +BOOST_AUTO_TEST_CASE( setabi_bios ) try { + fc::temp_directory tempdir; + validating_tester t( tempdir, true ); + t.execute_setup_policy( setup_policy::full ); + + abi_serializer abi_ser(fc::json::from_string( (const char*)contracts::bios_abi().data()).template as(), abi_serializer::create_yield_function(base_tester::abi_serializer_max_time)); + t.set_code( config::system_account_name, contracts::bios_wasm() ); + t.set_abi( config::system_account_name, contracts::bios_abi().data() ); + t.create_account(N(eosio.token)); + t.set_abi( N(eosio.token), contracts::token_abi().data() ); + { + auto res = t.get_row_by_account( config::system_account_name, config::system_account_name, N(abihash), N(eosio.token) ); + _abi_hash abi_hash; + auto abi_hash_var = abi_ser.binary_to_variant( "abi_hash", res, abi_serializer::create_yield_function(base_tester::abi_serializer_max_time) ); + abi_serializer::from_variant( abi_hash_var, abi_hash, t.get_resolver(), abi_serializer::create_yield_function(base_tester::abi_serializer_max_time)); + auto abi = fc::raw::pack(fc::json::from_string( (const char*)contracts::token_abi().data()).template as()); + auto result = fc::sha256::hash( (const char*)abi.data(), abi.size() ); + + BOOST_REQUIRE( abi_hash.hash == result ); + } + + t.set_abi( N(eosio.token), contracts::system_abi().data() ); + { + auto res = t.get_row_by_account( config::system_account_name, config::system_account_name, N(abihash), N(eosio.token) ); + _abi_hash abi_hash; + auto abi_hash_var = abi_ser.binary_to_variant( "abi_hash", res, abi_serializer::create_yield_function(base_tester::abi_serializer_max_time) ); + abi_serializer::from_variant( abi_hash_var, abi_hash, t.get_resolver(), abi_serializer::create_yield_function(base_tester::abi_serializer_max_time)); + auto abi = fc::raw::pack(fc::json::from_string( (const char*)contracts::system_abi().data()).template as()); + auto result = fc::sha256::hash( (const char*)abi.data(), abi.size() ); + + BOOST_REQUIRE( abi_hash.hash == result ); + } +} FC_LOG_AND_RETHROW() + +BOOST_FIXTURE_TEST_CASE( setabi, eosio_system_tester ) try { + set_abi( N(eosio.token), contracts::token_abi().data() ); + { + auto res = get_row_by_account( config::system_account_name, config::system_account_name, N(abihash), N(eosio.token) ); + _abi_hash abi_hash; + auto abi_hash_var = abi_ser.binary_to_variant( "abi_hash", res, abi_serializer::create_yield_function(abi_serializer_max_time) ); + abi_serializer::from_variant( abi_hash_var, abi_hash, get_resolver(), abi_serializer::create_yield_function(abi_serializer_max_time)); + auto abi = fc::raw::pack(fc::json::from_string( (const char*)contracts::token_abi().data()).template as()); + auto result = fc::sha256::hash( (const char*)abi.data(), abi.size() ); + + BOOST_REQUIRE( abi_hash.hash == result ); + } + + set_abi( N(eosio.token), contracts::system_abi().data() ); + { + auto res = get_row_by_account( config::system_account_name, config::system_account_name, N(abihash), N(eosio.token) ); + _abi_hash abi_hash; + auto abi_hash_var = abi_ser.binary_to_variant( "abi_hash", res, abi_serializer::create_yield_function(abi_serializer_max_time) ); + abi_serializer::from_variant( abi_hash_var, abi_hash, get_resolver(), abi_serializer::create_yield_function(abi_serializer_max_time)); + auto abi = fc::raw::pack(fc::json::from_string( (const char*)contracts::system_abi().data()).template as()); + auto result = fc::sha256::hash( (const char*)abi.data(), abi.size() ); + + BOOST_REQUIRE( abi_hash.hash == result ); + } + +} FC_LOG_AND_RETHROW() + +BOOST_FIXTURE_TEST_CASE( change_limited_account_back_to_unlimited, eosio_system_tester ) try { + BOOST_REQUIRE( get_total_stake( "eosio" ).is_null() ); + + transfer( N(eosio), N(alice1111111), core_sym::from_string("1.0000") ); + + auto error_msg = stake( N(alice1111111), N(eosio), core_sym::from_string("0.0000"), core_sym::from_string("1.0000") ); + auto semicolon_pos = error_msg.find(';'); + + BOOST_REQUIRE_EQUAL( error("account eosio has insufficient ram"), + error_msg.substr(0, semicolon_pos) ); + + int64_t ram_bytes_needed = 0; + { + std::istringstream s( error_msg ); + s.seekg( semicolon_pos + 7, std::ios_base::beg ); + s >> ram_bytes_needed; + ram_bytes_needed += 256; // enough room to cover total_resources_table + } + + push_action( N(eosio), N(setalimits), mvo() + ("account", "eosio") + ("ram_bytes", ram_bytes_needed) + ("net_weight", -1) + ("cpu_weight", -1) + ); + + stake( N(alice1111111), N(eosio), core_sym::from_string("0.0000"), core_sym::from_string("1.0000") ); + + REQUIRE_MATCHING_OBJECT( get_total_stake( "eosio" ), mvo() + ("owner", "eosio") + ("net_weight", core_sym::from_string("0.0000")) + ("cpu_weight", core_sym::from_string("1.0000")) + ("ram_bytes", 0) + ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg( "only supports unlimited accounts" ), + push_action( N(eosio), N(setalimits), mvo() + ("account", "eosio") + ("ram_bytes", ram_bytes_needed) + ("net_weight", -1) + ("cpu_weight", -1) + ) + ); + + BOOST_REQUIRE_EQUAL( error( "transaction net usage is too high: 128 > 0" ), + push_action( N(eosio), N(setalimits), mvo() + ("account", "eosio.saving") + ("ram_bytes", -1) + ("net_weight", -1) + ("cpu_weight", -1) + ) + ); + + BOOST_REQUIRE_EQUAL( success(), + push_action( N(eosio), N(setacctnet), mvo() + ("account", "eosio") + ("net_weight", -1) + ) + ); + + BOOST_REQUIRE_EQUAL( success(), + push_action( N(eosio), N(setacctcpu), mvo() + ("account", "eosio") + ("cpu_weight", -1) + + ) + ); + + BOOST_REQUIRE_EQUAL( success(), + push_action( N(eosio), N(setalimits), mvo() + ("account", "eosio.saving") + ("ram_bytes", ram_bytes_needed) + ("net_weight", -1) + ("cpu_weight", -1) + ) + ); + +} FC_LOG_AND_RETHROW() + +BOOST_FIXTURE_TEST_CASE( buy_pin_sell_ram, eosio_system_tester ) try { + BOOST_REQUIRE( get_total_stake( "eosio" ).is_null() ); + + transfer( N(eosio), N(alice1111111), core_sym::from_string("1020.0000") ); + + auto error_msg = stake( N(alice1111111), N(eosio), core_sym::from_string("10.0000"), core_sym::from_string("10.0000") ); + auto semicolon_pos = error_msg.find(';'); + + BOOST_REQUIRE_EQUAL( error("account eosio has insufficient ram"), + error_msg.substr(0, semicolon_pos) ); + + int64_t ram_bytes_needed = 0; + { + std::istringstream s( error_msg ); + s.seekg( semicolon_pos + 7, std::ios_base::beg ); + s >> ram_bytes_needed; + ram_bytes_needed += ram_bytes_needed/10; // enough buffer to make up for buyrambytes estimation errors + } + + auto alice_original_balance = get_balance( N(alice1111111) ); + + BOOST_REQUIRE_EQUAL( success(), buyrambytes( N(alice1111111), N(eosio), static_cast(ram_bytes_needed) ) ); + + auto tokens_paid_for_ram = alice_original_balance - get_balance( N(alice1111111) ); + + auto total_res = get_total_stake( "eosio" ); + + REQUIRE_MATCHING_OBJECT( total_res, mvo() + ("owner", "eosio") + ("net_weight", core_sym::from_string("0.0000")) + ("cpu_weight", core_sym::from_string("0.0000")) + ("ram_bytes", total_res["ram_bytes"].as_int64() ) + ); + + BOOST_REQUIRE_EQUAL( wasm_assert_msg( "only supports unlimited accounts" ), + push_action( N(eosio), N(setalimits), mvo() + ("account", "eosio") + ("ram_bytes", ram_bytes_needed) + ("net_weight", -1) + ("cpu_weight", -1) + ) + ); + + BOOST_REQUIRE_EQUAL( success(), + push_action( N(eosio), N(setacctram), mvo() + ("account", "eosio") + ("ram_bytes", total_res["ram_bytes"].as_int64() ) + ) + ); + + auto eosio_original_balance = get_balance( N(eosio) ); + + BOOST_REQUIRE_EQUAL( success(), sellram( N(eosio), total_res["ram_bytes"].as_int64() ) ); + + auto tokens_received_by_selling_ram = get_balance( N(eosio) ) - eosio_original_balance; + + BOOST_REQUIRE( double(tokens_paid_for_ram.get_amount() - tokens_received_by_selling_ram.get_amount()) / tokens_paid_for_ram.get_amount() < 0.01 ); + } FC_LOG_AND_RETHROW() BOOST_AUTO_TEST_SUITE_END() diff --git a/tests/eosio.token_tests.cpp b/tests/eosio.token_tests.cpp index 8d7d73ff6..23de001aa 100644 --- a/tests/eosio.token_tests.cpp +++ b/tests/eosio.token_tests.cpp @@ -33,7 +33,7 @@ class eosio_token_tester : public tester { const auto& accnt = control->db().get( N(eosio.token) ); abi_def abi; BOOST_REQUIRE_EQUAL(abi_serializer::to_abi(accnt.abi, abi), true); - abi_ser.set_abi(abi, abi_serializer_max_time); + abi_ser.set_abi(abi, abi_serializer::create_yield_function(abi_serializer_max_time)); } action_result push_action( const account_name& signer, const action_name &name, const variant_object &data ) { @@ -42,29 +42,29 @@ class eosio_token_tester : public tester { action act; act.account = N(eosio.token); act.name = name; - act.data = abi_ser.variant_to_binary( action_type_name, data,abi_serializer_max_time ); + act.data = abi_ser.variant_to_binary( action_type_name, data, abi_serializer::create_yield_function(abi_serializer_max_time) ); - return base_tester::push_action( std::move(act), uint64_t(signer)); + return base_tester::push_action( std::move(act), signer.to_uint64_t() ); } fc::variant get_stats( const string& symbolname ) { auto symb = eosio::chain::symbol::from_string(symbolname); auto symbol_code = symb.to_symbol_code().value; - vector data = get_row_by_account( N(eosio.token), symbol_code, N(stat), symbol_code ); - return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "currency_stats", data, abi_serializer_max_time ); + vector data = get_row_by_account( N(eosio.token), name(symbol_code), N(stat), account_name(symbol_code) ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "currency_stats", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); } fc::variant get_account( account_name acc, const string& symbolname) { auto symb = eosio::chain::symbol::from_string(symbolname); auto symbol_code = symb.to_symbol_code().value; - vector data = get_row_by_account( N(eosio.token), acc, N(accounts), symbol_code ); - return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "account", data, abi_serializer_max_time ); + vector data = get_row_by_account( N(eosio.token), acc, N(accounts), account_name(symbol_code) ); + return data.empty() ? fc::variant() : abi_ser.binary_to_variant( "account", data, abi_serializer::create_yield_function(abi_serializer_max_time) ); } action_result create( account_name issuer, - asset maximum_supply ) { + asset maximum_supply ) { return push_action( N(eosio.token), N(create), mvo() ( "issuer", issuer) @@ -72,9 +72,9 @@ class eosio_token_tester : public tester { ); } - action_result issue( account_name issuer, account_name to, asset quantity, string memo ) { + action_result issue( account_name issuer, asset quantity, string memo ) { return push_action( issuer, N(issue), mvo() - ( "to", to) + ( "to", issuer) ( "quantity", quantity) ( "memo", memo) ); @@ -214,7 +214,7 @@ BOOST_FIXTURE_TEST_CASE( issue_tests, eosio_token_tester ) try { auto token = create( N(alice), asset::from_string("1000.000 TKN")); produce_blocks(1); - issue( N(alice), N(alice), asset::from_string("500.000 TKN"), "hola" ); + issue( N(alice), asset::from_string("500.000 TKN"), "hola" ); auto stats = get_stats("3,TKN"); REQUIRE_MATCHING_OBJECT( stats, mvo() @@ -229,15 +229,15 @@ BOOST_FIXTURE_TEST_CASE( issue_tests, eosio_token_tester ) try { ); BOOST_REQUIRE_EQUAL( wasm_assert_msg( "quantity exceeds available supply" ), - issue( N(alice), N(alice), asset::from_string("500.001 TKN"), "hola" ) + issue( N(alice), asset::from_string("500.001 TKN"), "hola" ) ); BOOST_REQUIRE_EQUAL( wasm_assert_msg( "must issue positive quantity" ), - issue( N(alice), N(alice), asset::from_string("-1.000 TKN"), "hola" ) + issue( N(alice), asset::from_string("-1.000 TKN"), "hola" ) ); BOOST_REQUIRE_EQUAL( success(), - issue( N(alice), N(alice), asset::from_string("1.000 TKN"), "hola" ) + issue( N(alice), asset::from_string("1.000 TKN"), "hola" ) ); @@ -248,7 +248,7 @@ BOOST_FIXTURE_TEST_CASE( retire_tests, eosio_token_tester ) try { auto token = create( N(alice), asset::from_string("1000.000 TKN")); produce_blocks(1); - BOOST_REQUIRE_EQUAL( success(), issue( N(alice), N(alice), asset::from_string("500.000 TKN"), "hola" ) ); + BOOST_REQUIRE_EQUAL( success(), issue( N(alice), asset::from_string("500.000 TKN"), "hola" ) ); auto stats = get_stats("3,TKN"); REQUIRE_MATCHING_OBJECT( stats, mvo() @@ -305,7 +305,7 @@ BOOST_FIXTURE_TEST_CASE( transfer_tests, eosio_token_tester ) try { auto token = create( N(alice), asset::from_string("1000 CERO")); produce_blocks(1); - issue( N(alice), N(alice), asset::from_string("1000 CERO"), "hola" ); + issue( N(alice), asset::from_string("1000 CERO"), "hola" ); auto stats = get_stats("0,CERO"); REQUIRE_MATCHING_OBJECT( stats, mvo() @@ -352,8 +352,12 @@ BOOST_FIXTURE_TEST_CASE( open_tests, eosio_token_tester ) try { auto alice_balance = get_account(N(alice), "0,CERO"); BOOST_REQUIRE_EQUAL(true, alice_balance.is_null() ); - - BOOST_REQUIRE_EQUAL( success(), issue( N(alice), N(alice), asset::from_string("1000 CERO"), "issue" ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("tokens can only be issued to issuer account"), + push_action( N(alice), N(issue), mvo() + ( "to", "bob") + ( "quantity", asset::from_string("1000 CERO") ) + ( "memo", "") ) ); + BOOST_REQUIRE_EQUAL( success(), issue( N(alice), asset::from_string("1000 CERO"), "issue" ) ); alice_balance = get_account(N(alice), "0,CERO"); REQUIRE_MATCHING_OBJECT( alice_balance, mvo() @@ -363,7 +367,10 @@ BOOST_FIXTURE_TEST_CASE( open_tests, eosio_token_tester ) try { auto bob_balance = get_account(N(bob), "0,CERO"); BOOST_REQUIRE_EQUAL(true, bob_balance.is_null() ); - BOOST_REQUIRE_EQUAL( success(), open( N(bob), "0,CERO", N(alice) ) ); + BOOST_REQUIRE_EQUAL( wasm_assert_msg("owner account does not exist"), + open( N(nonexistent), "0,CERO", N(alice) ) ); + BOOST_REQUIRE_EQUAL( success(), + open( N(bob), "0,CERO", N(alice) ) ); bob_balance = get_account(N(bob), "0,CERO"); REQUIRE_MATCHING_OBJECT( bob_balance, mvo() @@ -392,7 +399,7 @@ BOOST_FIXTURE_TEST_CASE( close_tests, eosio_token_tester ) try { auto alice_balance = get_account(N(alice), "0,CERO"); BOOST_REQUIRE_EQUAL(true, alice_balance.is_null() ); - BOOST_REQUIRE_EQUAL( success(), issue( N(alice), N(alice), asset::from_string("1000 CERO"), "hola" ) ); + BOOST_REQUIRE_EQUAL( success(), issue( N(alice), asset::from_string("1000 CERO"), "hola" ) ); alice_balance = get_account(N(alice), "0,CERO"); REQUIRE_MATCHING_OBJECT( alice_balance, mvo() diff --git a/tests/eosio.wrap_tests.cpp b/tests/eosio.wrap_tests.cpp index b6f1424d5..1f462bb85 100644 --- a/tests/eosio.wrap_tests.cpp +++ b/tests/eosio.wrap_tests.cpp @@ -77,9 +77,9 @@ class eosio_wrap_tester : public tester { const auto& accnt = control->db().get( N(eosio.wrap) ); abi_def abi; BOOST_REQUIRE_EQUAL(abi_serializer::to_abi(accnt.abi, abi), true); - abi_ser.set_abi(abi, abi_serializer_max_time); + abi_ser.set_abi(abi, abi_serializer::create_yield_function(abi_serializer_max_time)); - while( control->pending_block_state()->header.producer.to_string() == "eosio" ) { + while( control->pending_block_producer().to_string() == "eosio" ) { produce_block(); } } @@ -134,7 +134,7 @@ transaction eosio_wrap_tester::wrap_exec( account_name executer, const transacti transaction trx2; set_transaction_headers(trx2, expiration); action act; - abi_serializer::from_variant( act_obj, act, get_resolver(), abi_serializer_max_time ); + abi_serializer::from_variant( act_obj, act, get_resolver(), abi_serializer::create_yield_function(abi_serializer_max_time) ); trx2.actions.push_back( std::move(act) ); return trx2; } @@ -155,7 +155,7 @@ transaction eosio_wrap_tester::reqauth( account_name from, const vectorapplied_transaction.connect([&]( const transaction_trace_ptr& t) { if (t->scheduled) { trace = t; } } ); + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { trace = t; } + } ); { signed_transaction wrap_trx( wrap_exec( N(alice), trx ), {}, {} ); @@ -180,7 +184,7 @@ BOOST_FIXTURE_TEST_CASE( wrap_exec_direct, eosio_wrap_tester ) try { ) ); */ wrap_trx.sign( get_private_key( N(alice), "active" ), control->get_chain_id() ); - for( const auto& actor : {"prod1", "prod2", "prod3", "prod4"} ) { + for( const auto& actor : {N(prod1), N(prod2), N(prod3), N(prod4)} ) { wrap_trx.sign( get_private_key( actor, "active" ), control->get_chain_id() ); } push_transaction( wrap_trx ); @@ -190,8 +194,8 @@ BOOST_FIXTURE_TEST_CASE( wrap_exec_direct, eosio_wrap_tester ) try { BOOST_REQUIRE( bool(trace) ); BOOST_REQUIRE_EQUAL( 1, trace->action_traces.size() ); - BOOST_REQUIRE_EQUAL( "eosio", name{trace->action_traces[0].act.account} ); - BOOST_REQUIRE_EQUAL( "reqauth", name{trace->action_traces[0].act.name} ); + BOOST_REQUIRE_EQUAL( config::system_account_name, name{trace->action_traces[0].act.account} ); + BOOST_REQUIRE_EQUAL( N(reqauth), name{trace->action_traces[0].act.name} ); BOOST_REQUIRE_EQUAL( transaction_receipt::executed, trace->receipt->status ); } FC_LOG_AND_RETHROW() @@ -214,8 +218,10 @@ BOOST_FIXTURE_TEST_CASE( wrap_with_msig, eosio_wrap_tester ) try { approve( N(carol), N(first), N(prod4) ); vector traces; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { - if (t->scheduled) { + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { traces.push_back( t ); } } ); @@ -232,13 +238,13 @@ BOOST_FIXTURE_TEST_CASE( wrap_with_msig, eosio_wrap_tester ) try { BOOST_REQUIRE_EQUAL( 2, traces.size() ); BOOST_REQUIRE_EQUAL( 1, traces[0]->action_traces.size() ); - BOOST_REQUIRE_EQUAL( "eosio.wrap", name{traces[0]->action_traces[0].act.account} ); - BOOST_REQUIRE_EQUAL( "exec", name{traces[0]->action_traces[0].act.name} ); + BOOST_REQUIRE_EQUAL( N(eosio.wrap), name{traces[0]->action_traces[0].act.account} ); + BOOST_REQUIRE_EQUAL( N(exec), name{traces[0]->action_traces[0].act.name} ); BOOST_REQUIRE_EQUAL( transaction_receipt::executed, traces[0]->receipt->status ); BOOST_REQUIRE_EQUAL( 1, traces[1]->action_traces.size() ); - BOOST_REQUIRE_EQUAL( "eosio", name{traces[1]->action_traces[0].act.account} ); - BOOST_REQUIRE_EQUAL( "reqauth", name{traces[1]->action_traces[0].act.name} ); + BOOST_REQUIRE_EQUAL( config::system_account_name, name{traces[1]->action_traces[0].act.account} ); + BOOST_REQUIRE_EQUAL( N(reqauth), name{traces[1]->action_traces[0].act.name} ); BOOST_REQUIRE_EQUAL( transaction_receipt::executed, traces[1]->receipt->status ); } FC_LOG_AND_RETHROW() @@ -299,7 +305,7 @@ BOOST_FIXTURE_TEST_CASE( wrap_with_msig_producers_change, eosio_wrap_tester ) tr set_producers( {N(prod1), N(prod2), N(prod3), N(prod4), N(prod5), N(newprod1)} ); // With 6 producers, the 2/3+1 threshold becomes 5 - while( control->pending_block_state()->active_schedule.producers.size() != 6 ) { + while( control->active_producers().producers.size() != 6 ) { produce_block(); } @@ -328,8 +334,10 @@ BOOST_FIXTURE_TEST_CASE( wrap_with_msig_producers_change, eosio_wrap_tester ) tr approve( N(carol), N(first), N(prod5) ); vector traces; - control->applied_transaction.connect([&]( const transaction_trace_ptr& t) { - if (t->scheduled) { + control->applied_transaction.connect( + [&]( std::tuple p ) { + const auto& t = std::get<0>(p); + if( t->scheduled ) { traces.push_back( t ); } } ); @@ -346,13 +354,13 @@ BOOST_FIXTURE_TEST_CASE( wrap_with_msig_producers_change, eosio_wrap_tester ) tr BOOST_REQUIRE_EQUAL( 2, traces.size() ); BOOST_REQUIRE_EQUAL( 1, traces[0]->action_traces.size() ); - BOOST_REQUIRE_EQUAL( "eosio.wrap", name{traces[0]->action_traces[0].act.account} ); - BOOST_REQUIRE_EQUAL( "exec", name{traces[0]->action_traces[0].act.name} ); + BOOST_REQUIRE_EQUAL( N(eosio.wrap), name{traces[0]->action_traces[0].act.account} ); + BOOST_REQUIRE_EQUAL( N(exec), name{traces[0]->action_traces[0].act.name} ); BOOST_REQUIRE_EQUAL( transaction_receipt::executed, traces[0]->receipt->status ); BOOST_REQUIRE_EQUAL( 1, traces[1]->action_traces.size() ); - BOOST_REQUIRE_EQUAL( "eosio", name{traces[1]->action_traces[0].act.account} ); - BOOST_REQUIRE_EQUAL( "reqauth", name{traces[1]->action_traces[0].act.name} ); + BOOST_REQUIRE_EQUAL( config::system_account_name, name{traces[1]->action_traces[0].act.account} ); + BOOST_REQUIRE_EQUAL( N(reqauth), name{traces[1]->action_traces[0].act.name} ); BOOST_REQUIRE_EQUAL( transaction_receipt::executed, traces[1]->receipt->status ); } FC_LOG_AND_RETHROW() diff --git a/tests/main.cpp b/tests/main.cpp index 2c658f31a..e3d617509 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -31,7 +31,12 @@ boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) { break; } } - if(!is_verbose) fc::logger::get(DEFAULT_LOGGER).set_log_level(fc::log_level::off); + + if(is_verbose) { + fc::logger::get(DEFAULT_LOGGER).set_log_level(fc::log_level::debug); + } else { + fc::logger::get(DEFAULT_LOGGER).set_log_level(fc::log_level::off); + } // Register fc::exception translator boost::unit_test::unit_test_monitor.template register_exception_translator(&translate_fc_exception); diff --git a/tests/test_contracts/exchange.wast b/tests/test_contracts/exchange.wast deleted file mode 100644 index 2b6900213..000000000 --- a/tests/test_contracts/exchange.wast +++ /dev/null @@ -1,47435 +0,0 @@ -(module - (type $FUNCSIG$vijiiii (func (param i32 i64 i32 i32 i32 i32))) - (type $FUNCSIG$viji (func (param i32 i64 i32))) - (type $FUNCSIG$vijji (func (param i32 i64 i64 i32))) - (type $FUNCSIG$vijjdi (func (param i32 i64 i64 f64 i32))) - (type $FUNCSIG$v (func)) - (type $FUNCSIG$j (func (result i64))) - (type $FUNCSIG$vjj (func (param i64 i64))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$ijjjj (func (param i64 i64 i64 i64) (result i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$vijii (func (param i32 i64 i32 i32))) - (type $FUNCSIG$ijjjjii (func (param i64 i64 i64 i64 i32 i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$ijjjij (func (param i64 i64 i64 i32 i64) (result i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$ijjjii (func (param i64 i64 i64 i32 i32) (result i32))) - (type $FUNCSIG$vj (func (param i64))) - (type $FUNCSIG$vd (func (param f64))) - (type $FUNCSIG$ijjjji (func (param i64 i64 i64 i64 i32) (result i32))) - (type $FUNCSIG$ij (func (param i64) (result i32))) - (type $FUNCSIG$i (func (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_idx64_find_primary" (func $db_idx64_find_primary (param i64 i64 i64 i32 i64) (result i32))) - (import "env" "db_idx64_lowerbound" (func $db_idx64_lowerbound (param i64 i64 i64 i32 i32) (result i32))) - (import "env" "db_idx64_next" (func $db_idx64_next (param i32 i32) (result i32))) - (import "env" "db_idx64_remove" (func $db_idx64_remove (param i32))) - (import "env" "db_idx64_store" (func $db_idx64_store (param i64 i64 i64 i64 i32) (result i32))) - (import "env" "db_idx64_update" (func $db_idx64_update (param i32 i64 i32))) - (import "env" "db_lowerbound_i64" (func $db_lowerbound_i64 (param i64 i64 i64 i64) (result i32))) - (import "env" "db_next_i64" (func $db_next_i64 (param 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" "eosio_exit" (func $eosio_exit (param i32))) - (import "env" "has_auth" (func $has_auth (param i64) (result i32))) - (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) - (import "env" "printdf" (func $printdf (param f64))) - (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 6 6 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $_ZN5eosio8exchange7createxEyNS_5assetEmNS_14extended_assetES2_ $_ZN5eosio8exchange4lendEyNS_11symbol_typeENS_14extended_assetE $_ZN5eosio8exchange8withdrawEyNS_14extended_assetE $_ZN5eosio8exchange6unlendEyNS_11symbol_typeEdNS_15extended_symbolE $_ZN5eosio8exchange7depositEyNS_14extended_assetE) - (memory $0 1) - (data (i32.const 4) "\b0W\00\00") - (data (i32.const 16) "magnitude of asset amount must be less than 2^62\00") - (data (i32.const 80) "invalid symbol name\00") - (data (i32.const 112) "unexpected asset contract input\00") - (data (i32.const 144) "unexpected asset symbol input\00") - (data (i32.const 176) "invalid sell\00") - (data (i32.const 192) "invalid conversion\00") - (data (i32.const 224) "object passed to iterator_to is not in multi_index\00") - (data (i32.const 288) "cannot create objects in table of another contract\00") - (data (i32.const 352) "cannot pass end iterator to modify\00") - (data (i32.const 400) "object passed to modify is not in multi_index\00") - (data (i32.const 448) "cannot modify objects in table of another contract\00") - (data (i32.const 512) "overdrawn balance 2\00") - (data (i32.const 544) "updater cannot change primary key when modifying an object\00") - (data (i32.const 608) "write\00") - (data (i32.const 624) "overdrawn balance 1\00") - (data (i32.const 656) "error reading iterator\00") - (data (i32.const 688) "read\00") - (data (i32.const 704) "get\00") - (data (i32.const 720) "unknown market\00") - (data (i32.const 736) "programmer error: insufficient collateral to cover\00") - (data (i32.const 800) "type mismatch\00") - (data (i32.const 816) "attempt to subtract asset with different symbol\00") - (data (i32.const 864) "subtraction underflow\00") - (data (i32.const 896) "subtraction overflow\00") - (data (i32.const 928) "cannot pass end iterator to erase\00") - (data (i32.const 976) "object passed to erase is not in multi_index\00") - (data (i32.const 1024) "cannot erase objects in table of another contract\00") - (data (i32.const 1088) "attempt to remove object that was not in multi_index\00") - (data (i32.const 1152) "cannot increment end iterator\00") - (data (i32.const 1184) "unable to lend to this market\00") - (data (i32.const 1216) "underflow\00") - (data (i32.const 1232) "cannot unlend negative balance\00") - (data (i32.const 1264) "sym: \00") - (data (i32.const 1280) "@\00") - (data (i32.const 1296) "unlend: \00") - (data (i32.const 1312) " existing interest_shares: \00") - (data (i32.const 1344) "\n\00") - (data (i32.const 1360) ",\00") - (data (i32.const 1376) "invalid debt asset\00") - (data (i32.const 1408) "no known margin position\00") - (data (i32.const 1440) "attempt to cover more than user has\00") - (data (i32.const 1488) "unable to cover debt\00") - (data (i32.const 1520) "cannot borrow neg\00") - (data (i32.const 1552) "cannot have neg collat\00") - (data (i32.const 1584) "user failed to claim all collateral\00") - (data (i32.const 1632) "attempt to add asset with different symbol\00") - (data (i32.const 1680) "addition underflow\00") - (data (i32.const 1712) "addition overflow\00") - (data (i32.const 1744) "insufficient funds availalbe to borrow\00") - (data (i32.const 1792) "this update would trigger a margin call\00") - (data (i32.const 1840) "invalid quantity\00") - (data (i32.const 1872) "deposit\00") - (data (i32.const 1888) "active\00") - (data (i32.const 1904) "transfer\00") - (data (i32.const 1920) "cannot withdraw negative balance\00") - (data (i32.const 1968) "withdraw\00") - (data (i32.const 1984) "invalid sell amount\00") - (data (i32.const 2016) "sell amount must be positive\00") - (data (i32.const 2048) "invalid min receive amount\00") - (data (i32.const 2080) "min receive amount cannot be negative\00") - (data (i32.const 2128) " \00") - (data (i32.const 2144) " => \00") - (data (i32.const 2160) "unable to fill\00") - (data (i32.const 2176) "sold\00") - (data (i32.const 2192) "received\00") - (data (i32.const 2224) "unable to find key\00") - (data (i32.const 2256) "can only transfer to white listed accounts\00") - (data (i32.const 2304) "receiver requires whitelist by issuer\00") - (data (i32.const 2352) ".\00") - (data (i32.const 2368) " \00") - (data (i32.const 2384) "invalid borrow delta\00") - (data (i32.const 2416) "invalid collateral delta\00") - (data (i32.const 2448) "no effect\00") - (data (i32.const 2464) "invalid args\00") - (data (i32.const 2480) "invalid asset for market\00") - (data (i32.const 2512) "borrowed\00") - (data (i32.const 2528) "collateral\00") - (data (i32.const 2544) "invalid cover amount\00") - (data (i32.const 2576) "cover amount must be positive\00") - (data (i32.const 2608) "invalid initial supply\00") - (data (i32.const 2640) "initial supply must be positive\00") - (data (i32.const 2672) "invalid base deposit\00") - (data (i32.const 2704) "base deposit must be positive\00") - (data (i32.const 2736) "invalid quote deposit\00") - (data (i32.const 2768) "quote deposit must be positive\00") - (data (i32.const 2800) "must exchange between two different currencies\00") - (data (i32.const 2848) "base: \00") - (data (i32.const 2864) "quote: \00") - (data (i32.const 2880) "marketid: \00") - (data (i32.const 2896) " \n \00") - (data (i32.const 2912) "market already exists\00") - (data (i32.const 2944) "initial exchange tokens\00") - (data (i32.const 2976) "new exchange issue\00") - (data (i32.const 3008) "new exchange deposit\00") - (data (i32.const 3040) "token with symbol already exists\00") - (data (i32.const 3088) "must lend a positive amount\00") - (data (i32.const 3120) "must unlend a positive amount\00") - (data (i32.const 3152) "invalid quantity in transfer\00") - (data (i32.const 3184) "zero quantity is disallowed in transfer\00") - (data (i32.const 3232) "withdrew tokens without withdraw in memo\00") - (data (i32.const 3280) "received tokens without deposit in memo\00") - (data (i32.const 3328) "must transfer positive quantity\00") - (data (i32.const 3360) "overdrawn balance\00") - (data (i32.const 3392) "account is frozen by issuer\00") - (data (i32.const 3424) "all transfers are frozen by issuer\00") - (data (i32.const 3472) "account is not white listed\00") - (data (i32.const 3504) "issuer may not recall token\00") - (data (i32.const 3536) "insufficient authority\00") - (data (i32.const 3568) "issue\n\00") - (data (i32.const 3584) "transfer\n\00") - (data (i32.const 3600) "create\n\00") - (data (i32.const 3616) "must issue positive quantity\00") - (data (i32.const 3664) "\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8?") - (data (i32.const 3680) "\00\00\00\00\00\00\00\00\06\d0\cfC\eb\fdL>") - (data (i32.const 3696) "\00\00\00\00\00\00\00\00\00\00\00@\03\b8\e2?") - (data (i32.const 12112) "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 "_ZN5eosio14exchange_state19convert_to_exchangeERNS0_9connectorENS_14extended_assetE" (func $_ZN5eosio14exchange_state19convert_to_exchangeERNS0_9connectorENS_14extended_assetE)) - (export "_ZN5eosio14exchange_state21convert_from_exchangeERNS0_9connectorENS_14extended_assetE" (func $_ZN5eosio14exchange_state21convert_from_exchangeERNS0_9connectorENS_14extended_assetE)) - (export "_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE" (func $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE)) - (export "_ZNK5eosio14exchange_state20requires_margin_callERKNS0_9connectorE" (func $_ZNK5eosio14exchange_state20requires_margin_callERKNS0_9connectorE)) - (export "_ZNK5eosio14exchange_state20requires_margin_callEv" (func $_ZNK5eosio14exchange_state20requires_margin_callEv)) - (export "_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE" (func $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE)) - (export "_ZN5eosio12market_stateC2EyNS_11symbol_typeERNS_17exchange_accountsE" (func $_ZN5eosio12market_stateC2EyNS_11symbol_typeERNS_17exchange_accountsE)) - (export "_ZN5eosio12market_state11margin_callENS_15extended_symbolE" (func $_ZN5eosio12market_state11margin_callENS_15extended_symbolE)) - (export "_ZN5eosio12market_state11margin_callERNS_14exchange_state9connectorERNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS5_yXadL_ZNKS5_8get_callEvEEEEEEEEE" (func $_ZN5eosio12market_state11margin_callERNS_14exchange_state9connectorERNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS5_yXadL_ZNKS5_8get_callEvEEEEEEEEE)) - (export "_ZNK5eosio12market_state13initial_stateEv" (func $_ZNK5eosio12market_state13initial_stateEv)) - (export "_ZN5eosio12market_state4lendEyRKNS_14extended_assetE" (func $_ZN5eosio12market_state4lendEyRKNS_14extended_assetE)) - (export "_ZN5eosio12market_state18adjust_lend_sharesEyRNS_11multi_indexILy10163845904742744064ENS_13loan_positionEJEEEd" (func $_ZN5eosio12market_state18adjust_lend_sharesEyRNS_11multi_indexILy10163845904742744064ENS_13loan_positionEJEEEd)) - (export "_ZN5eosio12market_state6unlendEydRKNS_15extended_symbolE" (func $_ZN5eosio12market_state6unlendEydRKNS_15extended_symbolE)) - (export "_ZN5eosio12market_state12cover_marginEyRKNS_14extended_assetE" (func $_ZN5eosio12market_state12cover_marginEyRKNS_14extended_assetE)) - (export "_ZN5eosio12market_state12cover_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetE" (func $_ZN5eosio12market_state12cover_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetE)) - (export "_ZN5eosio12market_state13update_marginEyRKNS_14extended_assetES3_" (func $_ZN5eosio12market_state13update_marginEyRKNS_14extended_assetES3_)) - (export "_ZN5eosio12market_state13adjust_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetESG_" (func $_ZN5eosio12market_state13adjust_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetESG_)) - (export "_ZN5eosio12market_state4saveEv" (func $_ZN5eosio12market_state4saveEv)) - (export "_ZN5eosio8exchange7depositEyNS_14extended_assetE" (func $_ZN5eosio8exchange7depositEyNS_14extended_assetE)) - (export "_ZN5eosio8exchange8withdrawEyNS_14extended_assetE" (func $_ZN5eosio8exchange8withdrawEyNS_14extended_assetE)) - (export "_ZN5eosio8exchange2onERKNS0_5tradeE" (func $_ZN5eosio8exchange2onERKNS0_5tradeE)) - (export "_ZN5eosio8exchange2onERKNS0_8upmarginE" (func $_ZN5eosio8exchange2onERKNS0_8upmarginE)) - (export "_ZN5eosio8exchange2onERKNS0_11covermarginE" (func $_ZN5eosio8exchange2onERKNS0_11covermarginE)) - (export "_ZN5eosio8exchange7createxEyNS_5assetEmNS_14extended_assetES2_" (func $_ZN5eosio8exchange7createxEyNS_5assetEmNS_14extended_assetES2_)) - (export "_ZN5eosio8exchange4lendEyNS_11symbol_typeENS_14extended_assetE" (func $_ZN5eosio8exchange4lendEyNS_11symbol_typeENS_14extended_assetE)) - (export "_ZN5eosio8exchange6unlendEyNS_11symbol_typeEdNS_15extended_symbolE" (func $_ZN5eosio8exchange6unlendEyNS_11symbol_typeEdNS_15extended_symbolE)) - (export "_ZN5eosio8exchange2onERKNS_8currency8transferEy" (func $_ZN5eosio8exchange2onERKNS_8currency8transferEy)) - (export "_ZN5eosio8exchange5applyEyy" (func $_ZN5eosio8exchange5applyEyy)) - (export "apply" (func $apply)) - (export "pow" (func $pow)) - (export "sqrt" (func $sqrt)) - (export "fabs" (func $fabs)) - (export "scalbn" (func $scalbn)) - (export "memcmp" (func $memcmp)) - (export "strlen" (func $strlen)) - (export "malloc" (func $malloc)) - (export "free" (func $free)) - (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 $_ZN5eosio14exchange_state19convert_to_exchangeERNS0_9connectorENS_14extended_assetE (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (i64.store offset=8 - (get_local $1) - (i64.add - (tee_local $5 - (i64.trunc_s/f64 - (f64.neg - (f64.mul - (f64.convert_s/i64 - (i64.load offset=8 - (get_local $1) - ) - ) - (f64.sub - (f64.const 1) - (call $pow - (f64.add - (f64.div - (f64.convert_s/i64 - (tee_local $6 - (i64.load - (get_local $3) - ) - ) - ) - (f64.convert_s/i64 - (i64.add - (get_local $6) - (i64.load - (get_local $2) - ) - ) - ) - ) - (f64.const 1) - ) - (f64.div - (f64.convert_u/i32 - (i32.load offset=24 - (get_local $2) - ) - ) - (f64.const 1e3) - ) - ) - ) - ) - ) - ) - ) - (i64.load offset=8 - (get_local $1) - ) - ) - ) - (i64.store - (get_local $2) - (i64.add - (get_local $6) - (i64.load - (get_local $2) - ) - ) - ) - (set_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (set_local $6 - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i64.store - (get_local $0) - (get_local $5) - ) - (i64.store offset=8 - (get_local $0) - (get_local $6) - ) - (call $eosio_assert - (i64.lt_u - (i64.add - (get_local $5) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775807) - ) - (i32.const 16) - ) - (set_local $6 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (set_local $1 - (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 $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 $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $2 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $2 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $2) - (i32.const 80) - ) - (i64.store offset=16 - (get_local $0) - (get_local $4) - ) - ) - (func $_ZN5eosio14exchange_state21convert_from_exchangeERNS0_9connectorENS_14extended_assetE (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i64) - (local $5 f64) - (local $6 i64) - (local $7 i64) - (call $eosio_assert - (i64.eq - (i64.load offset=16 - (get_local $3) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (i32.const 112) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $3) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i32.const 144) - ) - (set_local $6 - (i64.load - (get_local $2) - ) - ) - (set_local $5 - (call $pow - (f64.add - (f64.div - (f64.convert_s/i64 - (tee_local $7 - (i64.load - (get_local $3) - ) - ) - ) - (f64.convert_s/i64 - (i64.sub - (i64.load offset=8 - (get_local $1) - ) - (get_local $7) - ) - ) - ) - (f64.const 1) - ) - (f64.div - (f64.const 1e3) - (f64.convert_u/i32 - (i32.load offset=24 - (get_local $2) - ) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $1) - (i64.sub - (i64.load offset=8 - (get_local $1) - ) - (get_local $7) - ) - ) - (i64.store - (get_local $2) - (i64.sub - (i64.load - (get_local $2) - ) - (tee_local $7 - (i64.trunc_s/f64 - (f64.mul - (f64.convert_s/i64 - (get_local $6) - ) - (f64.add - (get_local $5) - (f64.const -1) - ) - ) - ) - ) - ) - ) - (set_local $4 - (i64.load offset=16 - (get_local $2) - ) - ) - (set_local $6 - (i64.load offset=8 - (get_local $2) - ) - ) - (i64.store - (get_local $0) - (get_local $7) - ) - (i64.store offset=8 - (get_local $0) - (get_local $6) - ) - (call $eosio_assert - (i64.lt_u - (i64.add - (get_local $7) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775807) - ) - (i32.const 16) - ) - (set_local $7 - (i64.shr_u - (get_local $6) - (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 $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 $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $1 - (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 $1 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 80) - ) - (i64.store offset=16 - (get_local $0) - (get_local $4) - ) - ) - (func $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (local $9 f64) - (local $10 i32) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $14 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 208) - ) - ) - ) - (set_local $8 - (i64.load - (i32.add - (get_local $1) - (i32.const 152) - ) - ) - ) - (set_local $7 - (i64.load - (i32.add - (get_local $1) - (i32.const 144) - ) - ) - ) - (set_local $6 - (i64.load - (i32.add - (get_local $1) - (i32.const 56) - ) - ) - ) - (set_local $5 - (i64.load - (i32.add - (get_local $1) - (i32.const 48) - ) - ) - ) - (set_local $12 - (i64.load offset=16 - (get_local $2) - ) - ) - (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 - (i64.ne - (tee_local $4 - (i64.load offset=8 - (get_local $2) - ) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - ) - (br_if $label$8 - (i64.ne - (get_local $12) - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - ) - (br_if $label$7 - (i64.ne - (tee_local $12 - (i64.load - (get_local $3) - ) - ) - (get_local $5) - ) - ) - (br_if $label$7 - (i64.ne - (i64.load offset=8 - (get_local $3) - ) - (get_local $6) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 160) - ) - (i32.const 16) - ) - (tee_local $5 - (i64.load - (tee_local $13 - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 160) - ) - (i32.const 8) - ) - (tee_local $4 - (i64.load - (tee_local $10 - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - ) - ) - (set_local $12 - (i64.load - (get_local $2) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 48) - ) - (i32.const 16) - ) - (get_local $5) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 48) - ) - (i32.const 8) - ) - (get_local $4) - ) - (i64.store offset=160 - (get_local $14) - (get_local $12) - ) - (i64.store offset=48 - (get_local $14) - (get_local $12) - ) - (call $_ZN5eosio14exchange_state21convert_from_exchangeERNS0_9connectorENS_14extended_assetE - (i32.add - (get_local $14) - (i32.const 184) - ) - (get_local $1) - (i32.add - (get_local $1) - (i32.const 40) - ) - (i32.add - (get_local $14) - (i32.const 48) - ) - ) - (i64.store - (get_local $13) - (i64.load - (i32.add - (i32.add - (get_local $14) - (i32.const 184) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (get_local $10) - (i64.load - (i32.add - (i32.add - (get_local $14) - (i32.const 184) - ) - (i32.const 8) - ) - ) - ) - (i64.store - (get_local $2) - (i64.load offset=184 - (get_local $14) - ) - ) - (br $label$0) - ) - (br_if $label$6 - (i64.ne - (get_local $4) - (get_local $5) - ) - ) - (br_if $label$6 - (i64.ne - (get_local $12) - (get_local $6) - ) - ) - (set_local $5 - (i64.load offset=8 - (get_local $1) - ) - ) - (set_local $9 - (call $pow - (f64.add - (f64.div - (f64.convert_s/i64 - (tee_local $12 - (i64.load - (get_local $2) - ) - ) - ) - (f64.convert_s/i64 - (i64.add - (i64.load - (tee_local $13 - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - ) - (get_local $12) - ) - ) - ) - (f64.const 1) - ) - (f64.div - (f64.convert_u/i32 - (i32.load - (i32.add - (get_local $1) - (i32.const 64) - ) - ) - ) - (f64.const 1e3) - ) - ) - ) - (i64.store - (get_local $13) - (i64.add - (get_local $12) - (i64.load - (get_local $13) - ) - ) - ) - (i64.store offset=8 - (get_local $1) - (i64.add - (tee_local $5 - (i64.trunc_s/f64 - (f64.neg - (f64.mul - (f64.convert_s/i64 - (get_local $5) - ) - (f64.sub - (f64.const 1) - (get_local $9) - ) - ) - ) - ) - ) - (i64.load offset=8 - (get_local $1) - ) - ) - ) - (set_local $6 - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (set_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (call $eosio_assert - (i64.lt_u - (i64.add - (get_local $5) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775807) - ) - (i32.const 16) - ) - (set_local $12 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (set_local $13 - (i32.const 0) - ) - (loop $label$9 - (br_if $label$5 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $12) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$10 - (br_if $label$10 - (i64.ne - (i64.and - (tee_local $12 - (i64.shr_u - (get_local $12) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$11 - (br_if $label$5 - (i64.ne - (i64.and - (tee_local $12 - (i64.shr_u - (get_local $12) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$11 - (i32.lt_s - (tee_local $13 - (i32.add - (get_local $13) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $10 - (i32.const 1) - ) - (br_if $label$9 - (i32.lt_s - (tee_local $13 - (i32.add - (get_local $13) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$4) - ) - ) - (block $label$12 - (br_if $label$12 - (i64.ne - (get_local $12) - (get_local $7) - ) - ) - (br_if $label$12 - (i64.ne - (i64.load offset=8 - (get_local $3) - ) - (get_local $8) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 136) - ) - (i32.const 16) - ) - (tee_local $5 - (i64.load - (tee_local $13 - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 136) - ) - (i32.const 8) - ) - (tee_local $4 - (i64.load - (tee_local $10 - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - ) - ) - (set_local $12 - (i64.load - (get_local $2) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 72) - ) - (i32.const 16) - ) - (get_local $5) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 72) - ) - (i32.const 8) - ) - (get_local $4) - ) - (i64.store offset=136 - (get_local $14) - (get_local $12) - ) - (i64.store offset=72 - (get_local $14) - (get_local $12) - ) - (call $_ZN5eosio14exchange_state21convert_from_exchangeERNS0_9connectorENS_14extended_assetE - (i32.add - (get_local $14) - (i32.const 184) - ) - (get_local $1) - (i32.add - (get_local $1) - (i32.const 136) - ) - (i32.add - (get_local $14) - (i32.const 72) - ) - ) - (i64.store - (get_local $13) - (i64.load - (i32.add - (i32.add - (get_local $14) - (i32.const 184) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (get_local $10) - (i64.load - (i32.add - (i32.add - (get_local $14) - (i32.const 184) - ) - (i32.const 8) - ) - ) - ) - (i64.store - (get_local $2) - (i64.load offset=184 - (get_local $14) - ) - ) - (br $label$0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 192) - ) - (br $label$0) - ) - (br_if $label$3 - (i64.ne - (get_local $4) - (get_local $7) - ) - ) - (br_if $label$3 - (i64.ne - (get_local $12) - (get_local $8) - ) - ) - (set_local $5 - (i64.load offset=8 - (get_local $1) - ) - ) - (set_local $9 - (call $pow - (f64.add - (f64.div - (f64.convert_s/i64 - (tee_local $12 - (i64.load - (get_local $2) - ) - ) - ) - (f64.convert_s/i64 - (i64.add - (i64.load - (tee_local $13 - (i32.add - (get_local $1) - (i32.const 136) - ) - ) - ) - (get_local $12) - ) - ) - ) - (f64.const 1) - ) - (f64.div - (f64.convert_u/i32 - (i32.load - (i32.add - (get_local $1) - (i32.const 160) - ) - ) - ) - (f64.const 1e3) - ) - ) - ) - (i64.store - (get_local $13) - (i64.add - (get_local $12) - (i64.load - (get_local $13) - ) - ) - ) - (i64.store offset=8 - (get_local $1) - (i64.add - (tee_local $5 - (i64.trunc_s/f64 - (f64.neg - (f64.mul - (f64.convert_s/i64 - (get_local $5) - ) - (f64.sub - (f64.const 1) - (get_local $9) - ) - ) - ) - ) - ) - (i64.load offset=8 - (get_local $1) - ) - ) - ) - (set_local $6 - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (set_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (call $eosio_assert - (i64.lt_u - (i64.add - (get_local $5) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775807) - ) - (i32.const 16) - ) - (set_local $12 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (set_local $13 - (i32.const 0) - ) - (loop $label$13 - (br_if $label$2 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $12) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$14 - (br_if $label$14 - (i64.ne - (i64.and - (tee_local $12 - (i64.shr_u - (get_local $12) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$15 - (br_if $label$2 - (i64.ne - (i64.and - (tee_local $12 - (i64.shr_u - (get_local $12) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$15 - (i32.lt_s - (tee_local $13 - (i32.add - (get_local $13) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $10 - (i32.const 1) - ) - (br_if $label$13 - (i32.lt_s - (tee_local $13 - (i32.add - (get_local $13) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$1) - ) - ) - (set_local $10 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $10) - (i32.const 80) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 8) - ) - (get_local $4) - ) - (i64.store - (get_local $2) - (get_local $5) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 16) - ) - (get_local $6) - ) - (br $label$0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 176) - ) - (br $label$0) - ) - (set_local $10 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $10) - (i32.const 80) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 8) - ) - (get_local $4) - ) - (i64.store - (get_local $2) - (get_local $5) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 16) - ) - (get_local $6) - ) - ) - (block $label$16 - (block $label$17 - (br_if $label$17 - (i64.ne - (i64.load - (get_local $3) - ) - (i64.load - (tee_local $13 - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - ) - ) - (br_if $label$17 - (i64.ne - (i64.load offset=8 - (get_local $3) - ) - (i64.load - (tee_local $10 - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $0) - (i64.load - (get_local $2) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (i64.load - (get_local $10) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (br $label$16) - ) - (i64.store - (tee_local $10 - (i32.add - (i32.add - (get_local $14) - (i32.const 112) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - (i64.store - (tee_local $11 - (i32.add - (i32.add - (get_local $14) - (i32.const 112) - ) - (i32.const 8) - ) - ) - (i64.load - (get_local $13) - ) - ) - (i64.store offset=112 - (get_local $14) - (i64.load - (get_local $2) - ) - ) - (i64.store - (tee_local $13 - (i32.add - (i32.add - (get_local $14) - (i32.const 96) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - (i64.store offset=96 - (get_local $14) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 24) - ) - (i32.const 16) - ) - (i64.load - (get_local $10) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 24) - ) - (i32.const 8) - ) - (i64.load - (get_local $11) - ) - ) - (i64.store offset=24 - (get_local $14) - (i64.load offset=112 - (get_local $14) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $14) - (i32.const 8) - ) - (i32.const 8) - ) - (i64.load - (get_local $13) - ) - ) - (i64.store offset=8 - (get_local $14) - (i64.load offset=96 - (get_local $14) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (get_local $0) - (get_local $1) - (i32.add - (get_local $14) - (i32.const 24) - ) - (i32.add - (get_local $14) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $14) - (i32.const 208) - ) - ) - ) - (func $_ZNK5eosio14exchange_state20requires_margin_callERKNS0_9connectorE (param $0 i32) (param $1 i32) (result i32) - (local $2 i64) - (local $3 f64) - (local $4 i64) - (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 336) - ) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i64.lt_s - (tee_local $5 - (i64.load - (i32.add - (get_local $1) - (i32.const 56) - ) - ) - ) - (i64.const 1) - ) - ) - (drop - (call $memcpy - (i32.add - (get_local $7) - (i32.const 104) - ) - (get_local $0) - (i32.const 232) - ) - ) - (set_local $3 - (f64.load - (i32.add - (get_local $1) - (i32.const 80) - ) - ) - ) - (i64.store offset=64 - (get_local $7) - (tee_local $4 - (i64.load offset=8 - (get_local $1) - ) - ) - ) - (i64.store offset=56 - (get_local $7) - (tee_local $5 - (i64.trunc_s/f64 - (f64.mul - (get_local $3) - (f64.convert_s/i64 - (get_local $5) - ) - ) - ) - ) - ) - (set_local $2 - (i64.load offset=16 - (get_local $1) - ) - ) - (call $eosio_assert - (i64.lt_u - (i64.add - (get_local $5) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775807) - ) - (i32.const 16) - ) - (set_local $5 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$2 - (block $label$3 - (loop $label$4 - (br_if $label$3 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $5) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$5 - (br_if $label$5 - (i64.ne - (i64.and - (tee_local $5 - (i64.shr_u - (get_local $5) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$6 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $5 - (i64.shr_u - (get_local $5) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$6 - (i32.lt_s - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $6 - (i32.const 1) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$2) - ) - ) - (set_local $6 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 80) - ) - (i64.store offset=72 - (get_local $7) - (get_local $2) - ) - (set_local $5 - (i64.load - (i32.add - (get_local $1) - (i32.const 64) - ) - ) - ) - (set_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 72) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (i32.add - (get_local $7) - (i32.const 56) - ) - (i32.const 20) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 32) - ) - (i32.load offset=72 - (get_local $7) - ) - ) - (i64.store offset=48 - (get_local $7) - (get_local $4) - ) - (i32.store - (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $7) - (i32.const 56) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 8) - ) - (i32.load - (i32.add - (i32.add - (get_local $7) - (i32.const 56) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=40 - (get_local $7) - (get_local $5) - ) - (i32.store offset=20 - (get_local $7) - (i32.load offset=60 - (get_local $7) - ) - ) - (i32.store offset=16 - (get_local $7) - (i32.load offset=56 - (get_local $7) - ) - ) - (i64.store - (i32.add - (get_local $7) - (i32.const 8) - ) - (i64.load offset=48 - (get_local $7) - ) - ) - (i64.store - (get_local $7) - (i64.load offset=40 - (get_local $7) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (i32.add - (get_local $7) - (i32.const 80) - ) - (i32.add - (get_local $7) - (i32.const 104) - ) - (i32.add - (get_local $7) - (i32.const 16) - ) - (get_local $7) - ) - (set_local $0 - (i32.const 1) - ) - (br_if $label$0 - (i64.le_s - (i64.load offset=80 - (get_local $7) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 56) - ) - ) - ) - ) - ) - (set_local $0 - (i32.const 0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 336) - ) - ) - (get_local $0) - ) - (func $_ZNK5eosio14exchange_state20requires_margin_callEv (param $0 i32) (result i32) - (local $1 i32) - (set_local $1 - (i32.const 1) - ) - (block $label$0 - (br_if $label$0 - (call $_ZNK5eosio14exchange_state20requires_margin_callERKNS0_9connectorE - (get_local $0) - (i32.add - (get_local $0) - (i32.const 40) - ) - ) - ) - (set_local $1 - (call $_ZNK5eosio14exchange_state20requires_margin_callERKNS0_9connectorE - (get_local $0) - (i32.add - (get_local $0) - (i32.const 136) - ) - ) - ) - ) - (get_local $1) - ) - (func $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i64) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $12 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i64.store offset=16 - (get_local $12) - (get_local $1) - ) - (set_local $4 - (i32.add - (tee_local $11 - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $10 - (i32.mul - (i32.load - (i32.add - (get_local $0) - (i32.const 12) - ) - ) - (i32.const 48) - ) - ) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $10) - ) - ) - (set_local $10 - (i32.div_s - (get_local $10) - (i32.const 48) - ) - ) - (set_local $9 - (get_local $11) - ) - (loop $label$1 - (set_local $9 - (select - (tee_local $7 - (i32.add - (tee_local $6 - (i32.add - (get_local $9) - (i32.mul - (tee_local $5 - (i32.shr_u - (get_local $10) - (i32.const 1) - ) - ) - (i32.const 48) - ) - ) - ) - (i32.const 48) - ) - ) - (get_local $9) - (tee_local $6 - (i64.lt_u - (i64.load - (get_local $6) - ) - (get_local $1) - ) - ) - ) - ) - (set_local $11 - (select - (get_local $7) - (get_local $11) - (get_local $6) - ) - ) - (br_if $label$1 - (tee_local $10 - (select - (i32.sub - (i32.add - (get_local $10) - (i32.const -1) - ) - (get_local $5) - ) - (get_local $5) - (get_local $6) - ) - ) - ) - ) - ) - (block $label$2 - (br_if $label$2 - (i32.eq - (get_local $11) - (get_local $4) - ) - ) - (set_local $11 - (select - (get_local $4) - (get_local $11) - (i64.gt_u - (i64.load - (get_local $11) - ) - (get_local $1) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.ne - (get_local $11) - (get_local $4) - ) - ) - (set_local $8 - (i64.load - (get_local $0) - ) - ) - (i64.store - (i32.add - (get_local $12) - (i32.const 64) - ) - (get_local $1) - ) - (i64.store - (i32.add - (get_local $12) - (i32.const 72) - ) - (i64.const -1) - ) - (i64.store - (tee_local $10 - (i32.add - (get_local $12) - (i32.const 80) - ) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 88) - ) - (i32.const 0) - ) - (i64.store offset=56 - (get_local $12) - (get_local $8) - ) - (i64.store offset=48 - (get_local $12) - (get_local $1) - ) - (call $_ZN5boost9container3dtl9flat_treeINS1_4pairIyN5eosio11multi_indexILy6290548272952901632ENS4_9exaccountEJEEEEENS1_9select1stIyEENSt3__14lessIyEENS0_13new_allocatorIS8_EEE13insert_uniqueEOS8_ - (i32.add - (get_local $12) - (i32.const 40) - ) - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.add - (get_local $12) - (i32.const 48) - ) - ) - (block $label$4 - (br_if $label$4 - (i32.eqz - (tee_local $5 - (i32.load - (get_local $10) - ) - ) - ) - ) - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.eq - (tee_local $10 - (i32.load - (tee_local $6 - (i32.add - (get_local $12) - (i32.const 84) - ) - ) - ) - ) - (get_local $5) - ) - ) - (loop $label$7 - (set_local $9 - (i32.load - (tee_local $10 - (i32.add - (get_local $10) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $10) - (i32.const 0) - ) - (block $label$8 - (br_if $label$8 - (i32.eqz - (get_local $9) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.load - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=8 - (get_local $9) - ) - ) - ) - (call $_ZdlPv - (get_local $9) - ) - ) - (br_if $label$7 - (i32.ne - (get_local $5) - (get_local $10) - ) - ) - ) - (set_local $10 - (i32.load - (i32.add - (get_local $12) - (i32.const 80) - ) - ) - ) - (br $label$5) - ) - (set_local $10 - (get_local $5) - ) - ) - (i32.store - (get_local $6) - (get_local $5) - ) - (call $_ZdlPv - (get_local $10) - ) - ) - (set_local $11 - (i32.load offset=40 - (get_local $12) - ) - ) - (set_local $1 - (i64.load offset=16 - (get_local $12) - ) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eq - (tee_local $5 - (i32.load - (i32.add - (get_local $11) - (i32.const 36) - ) - ) - ) - (tee_local $7 - (i32.load - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - ) - ) - ) - (set_local $10 - (i32.add - (get_local $5) - (i32.const -24) - ) - ) - (set_local $6 - (i32.sub - (i32.const 0) - (get_local $7) - ) - ) - (loop $label$11 - (br_if $label$10 - (i64.eq - (i64.load - (i32.load - (get_local $10) - ) - ) - (get_local $1) - ) - ) - (set_local $5 - (get_local $10) - ) - (set_local $10 - (tee_local $9 - (i32.add - (get_local $10) - (i32.const -24) - ) - ) - ) - (br_if $label$11 - (i32.ne - (i32.add - (get_local $9) - (get_local $6) - ) - (i32.const -24) - ) - ) - ) - ) - (set_local $10 - (i32.add - (get_local $11) - (i32.const 8) - ) - ) - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (br_if $label$15 - (i32.eq - (get_local $5) - (get_local $7) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=20 - (tee_local $9 - (i32.load - (i32.add - (get_local $5) - (i32.const -24) - ) - ) - ) - ) - (get_local $10) - ) - (i32.const 224) - ) - (br_if $label$14 - (get_local $9) - ) - (br $label$13) - ) - (br_if $label$13 - (i32.lt_s - (tee_local $9 - (call $db_find_i64 - (i64.load - (i32.add - (get_local $11) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $11) - (i32.const 16) - ) - ) - (i64.const 6290548272952901632) - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=20 - (tee_local $9 - (call $_ZNK5eosio11multi_indexILy6290548272952901632ENS_9exaccountEJEE31load_object_by_primary_iteratorEl - (get_local $10) - (get_local $9) - ) - ) - ) - (get_local $10) - ) - (i32.const 224) - ) - ) - (i32.store offset=48 - (get_local $12) - (get_local $2) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 352) - ) - (call $_ZN5eosio11multi_indexILy6290548272952901632ENS_9exaccountEJEE6modifyIZNS_17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEE3$_1EEvRKS1_yOT_ - (get_local $10) - (get_local $9) - (i32.add - (get_local $12) - (i32.const 48) - ) - ) - (br $label$12) - ) - (set_local $1 - (i64.load offset=16 - (get_local $12) - ) - ) - (i32.store offset=12 - (get_local $12) - (get_local $2) - ) - (i32.store offset=8 - (get_local $12) - (i32.add - (get_local $12) - (i32.const 16) - ) - ) - (i64.store offset=40 - (get_local $12) - (get_local $1) - ) - (call $eosio_assert - (i64.eq - (i64.load - (i32.add - (get_local $11) - (i32.const 8) - ) - ) - (call $current_receiver) - ) - (i32.const 288) - ) - (i32.store offset=48 - (get_local $12) - (get_local $10) - ) - (i32.store offset=52 - (get_local $12) - (i32.add - (get_local $12) - (i32.const 8) - ) - ) - (i32.store offset=56 - (get_local $12) - (i32.add - (get_local $12) - (i32.const 40) - ) - ) - (i32.store offset=16 - (tee_local $9 - (call $_Znwj - (i32.const 32) - ) - ) - (i32.const 0) - ) - (i64.store offset=8 align=4 - (get_local $9) - (i64.const 0) - ) - (i32.store offset=20 - (get_local $9) - (get_local $10) - ) - (call $_ZZN5eosio11multi_indexILy6290548272952901632ENS_9exaccountEJEE7emplaceIZNS_17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEE3$_0EENS2_14const_iteratorEyOT_ENKUlRSH_E_clINS2_4itemEEEDaSJ_ - (i32.add - (get_local $12) - (i32.const 48) - ) - (get_local $9) - ) - (i32.store offset=32 - (get_local $12) - (get_local $9) - ) - (i64.store offset=48 - (get_local $12) - (tee_local $1 - (i64.load - (get_local $9) - ) - ) - ) - (i32.store offset=28 - (get_local $12) - (tee_local $5 - (i32.load offset=24 - (get_local $9) - ) - ) - ) - (block $label$16 - (block $label$17 - (br_if $label$17 - (i32.ge_u - (tee_local $10 - (i32.load - (tee_local $6 - (i32.add - (get_local $11) - (i32.const 36) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $11) - (i32.const 40) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $10) - (get_local $1) - ) - (i32.store offset=16 - (get_local $10) - (get_local $5) - ) - (i32.store offset=32 - (get_local $12) - (i32.const 0) - ) - (i32.store - (get_local $10) - (get_local $9) - ) - (i32.store - (get_local $6) - (i32.add - (get_local $10) - (i32.const 24) - ) - ) - (br $label$16) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy6290548272952901632ENS1_9exaccountEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $11) - (i32.const 32) - ) - (i32.add - (get_local $12) - (i32.const 32) - ) - (i32.add - (get_local $12) - (i32.const 48) - ) - (i32.add - (get_local $12) - (i32.const 28) - ) - ) - ) - (set_local $10 - (i32.load offset=32 - (get_local $12) - ) - ) - (i32.store offset=32 - (get_local $12) - (i32.const 0) - ) - (br_if $label$12 - (i32.eqz - (get_local $10) - ) - ) - (block $label$18 - (br_if $label$18 - (i32.eqz - (i32.load - (i32.add - (get_local $10) - (i32.const 16) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=8 - (get_local $10) - ) - ) - ) - (call $_ZdlPv - (get_local $10) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $12) - (i32.const 96) - ) - ) - ) - (func $_ZN5boost9container3dtl9flat_treeINS1_4pairIyN5eosio11multi_indexILy6290548272952901632ENS4_9exaccountEJEEEEENS1_9select1stIyEENSt3__14lessIyEENS0_13new_allocatorIS8_EEE13insert_uniqueEOS8_ (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 i32) - (i32.store8 offset=4 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $0) - (i32.const 0) - ) - (set_local $5 - (i64.load - (get_local $2) - ) - ) - (set_local $6 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $7 - (i32.div_s - (i32.mul - (tee_local $4 - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.const 48) - ) - (i32.const 48) - ) - ) - ) - ) - (loop $label$1 - (block $label$2 - (br_if $label$2 - (i64.ge_u - (i64.load - (tee_local $8 - (i32.add - (get_local $6) - (i32.mul - (tee_local $10 - (i32.shr_u - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 48) - ) - ) - ) - ) - (get_local $5) - ) - ) - (set_local $6 - (i32.add - (get_local $8) - (i32.const 48) - ) - ) - (set_local $10 - (i32.sub - (i32.add - (get_local $7) - (i32.const -1) - ) - (get_local $10) - ) - ) - ) - (br_if $label$1 - (tee_local $7 - (get_local $10) - ) - ) - ) - ) - (block $label$3 - (block $label$4 - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.eq - (get_local $6) - (i32.add - (get_local $3) - (i32.mul - (get_local $4) - (i32.const 48) - ) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $0) - (i32.const 4) - ) - (i64.lt_u - (get_local $5) - (tee_local $9 - (i64.load - (get_local $6) - ) - ) - ) - ) - (br_if $label$5 - (i64.lt_u - (get_local $5) - (get_local $9) - ) - ) - (br $label$4) - ) - (i32.store8 - (i32.add - (get_local $0) - (i32.const 4) - ) - (i32.const 1) - ) - ) - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (br_if $label$10 - (i32.ne - (i32.load offset=8 - (get_local $1) - ) - (get_local $4) - ) - ) - (br_if $label$3 - (i32.eq - (get_local $4) - (i32.const 89478485) - ) - ) - (br_if $label$9 - (i32.gt_u - (get_local $4) - (i32.const 536870911) - ) - ) - (set_local $7 - (i32.div_u - (i32.shl - (get_local $4) - (i32.const 3) - ) - (i32.const 5) - ) - ) - (br $label$8) - ) - (call $_ZN5boost9container6vectorINS0_3dtl4pairIyN5eosio11multi_indexILy6290548272952901632ENS4_9exaccountEJEEEEENS0_13new_allocatorIS8_EEvE40priv_forward_range_insert_expand_forwardINS2_17insert_move_proxyISA_PS8_EEEEvSE_jT_ - (get_local $1) - (get_local $6) - (i32.const 1) - (get_local $2) - ) - (br $label$7) - ) - (set_local $7 - (select - (i32.const -1) - (i32.shl - (get_local $4) - (i32.const 3) - ) - (i32.gt_u - (get_local $4) - (i32.const -1610612737) - ) - ) - ) - ) - (br_if $label$3 - (i32.ge_u - (tee_local $7 - (select - (tee_local $10 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (tee_local $7 - (select - (get_local $7) - (i32.const 89478485) - (i32.lt_u - (get_local $7) - (i32.const 89478485) - ) - ) - ) - (i32.gt_u - (get_local $10) - (get_local $7) - ) - ) - ) - (i32.const 89478486) - ) - ) - (call $_ZN5boost9container6vectorINS0_3dtl4pairIyN5eosio11multi_indexILy6290548272952901632ENS4_9exaccountEJEEEEENS0_13new_allocatorIS8_EEvE40priv_forward_range_insert_new_allocationINS2_17insert_move_proxyISA_PS8_EEEEvSE_jSE_jT_ - (get_local $1) - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 48) - ) - ) - (get_local $7) - (get_local $6) - (i32.const 1) - (get_local $2) - ) - ) - (set_local $6 - (i32.add - (i32.load - (get_local $1) - ) - (i32.mul - (i32.div_s - (i32.sub - (get_local $6) - (get_local $3) - ) - (i32.const 48) - ) - (i32.const 48) - ) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - (return) - ) - (call $abort) - (unreachable) - ) - (func $_ZNK5eosio11multi_indexILy6290548272952901632ENS_9exaccountEJEE31load_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 656) - ) - (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=36 - (get_local $8) - (get_local $4) - ) - (i32.store offset=32 - (get_local $8) - (get_local $4) - ) - (i32.store offset=40 - (get_local $8) - (tee_local $7 - (i32.add - (get_local $4) - (get_local $6) - ) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.le_u - (get_local $6) - (i32.const 512) - ) - ) - (call $free - (get_local $4) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $8) - (i32.const 40) - ) - ) - ) - (set_local $4 - (i32.load offset=36 - (get_local $8) - ) - ) - ) - (i32.store offset=16 - (tee_local $6 - (call $_Znwj - (i32.const 32) - ) - ) - (i32.const 0) - ) - (i64.store offset=8 align=4 - (get_local $6) - (i64.const 0) - ) - (i32.store offset=20 - (get_local $6) - (get_local $0) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (get_local $7) - (get_local $4) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $6) - (get_local $4) - (i32.const 8) - ) - ) - (i32.store offset=36 - (get_local $8) - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEENS_15extended_symbolExEERT_S7_RN5boost9container8flat_mapIT0_T1_NSt3__14lessISB_EENS9_13new_allocatorINSD_4pairISB_SC_EEEEEE - (i32.add - (get_local $8) - (i32.const 32) - ) - (i32.add - (get_local $6) - (i32.const 8) - ) - ) - ) - (i32.store offset=24 - (get_local $6) - (get_local $1) - ) - (i32.store offset=24 - (get_local $8) - (get_local $6) - ) - (i64.store offset=16 - (get_local $8) - (tee_local $5 - (i64.load - (get_local $6) - ) - ) - ) - (i32.store offset=12 - (get_local $8) - (tee_local $7 - (i32.load offset=24 - (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_indexILy6290548272952901632ENS1_9exaccountEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 12) - ) - ) - ) - (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) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.load - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=8 - (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 $_ZZN5eosio11multi_indexILy6290548272952901632ENS_9exaccountEJEE7emplaceIZNS_17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEE3$_0EENS2_14const_iteratorEyOT_ENKUlRSH_E_clINS2_4itemEEEDaSJ_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i64) - (local $14 i32) - (local $15 i32) - (set_local $14 - (tee_local $15 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $15) - ) - (i64.store - (get_local $1) - (i64.load - (i32.load - (tee_local $3 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - ) - ) - (set_local $6 - (i32.add - (tee_local $11 - (i32.load offset=8 - (get_local $1) - ) - ) - (tee_local $10 - (i32.mul - (i32.load - (i32.add - (get_local $1) - (i32.const 12) - ) - ) - (i32.const 24) - ) - ) - ) - ) - (set_local $2 - (i32.load - (get_local $0) - ) - ) - (set_local $5 - (i64.load offset=16 - (tee_local $12 - (i32.load offset=4 - (get_local $3) - ) - ) - ) - ) - (set_local $13 - (i64.load offset=8 - (get_local $12) - ) - ) - (set_local $4 - (i64.load - (get_local $12) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $10) - ) - ) - (set_local $12 - (i32.div_s - (get_local $10) - (i32.const 24) - ) - ) - (set_local $10 - (get_local $11) - ) - (loop $label$1 - (set_local $10 - (select - (tee_local $9 - (i32.add - (tee_local $8 - (i32.add - (get_local $10) - (i32.mul - (tee_local $7 - (i32.shr_u - (get_local $12) - (i32.const 1) - ) - ) - (i32.const 24) - ) - ) - ) - (i32.const 24) - ) - ) - (get_local $10) - (tee_local $8 - (i64.lt_u - (i64.load - (get_local $8) - ) - (get_local $13) - ) - ) - ) - ) - (set_local $11 - (select - (get_local $9) - (get_local $11) - (get_local $8) - ) - ) - (br_if $label$1 - (tee_local $12 - (select - (i32.sub - (i32.add - (get_local $12) - (i32.const -1) - ) - (get_local $7) - ) - (get_local $7) - (get_local $8) - ) - ) - ) - ) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $11) - (get_local $6) - ) - ) - (br_if $label$2 - (i64.ge_u - (get_local $13) - (i64.load - (get_local $11) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $14) - (get_local $5) - ) - (i64.store - (get_local $14) - (get_local $13) - ) - (i64.store offset=16 - (get_local $14) - (i64.const 0) - ) - (call $_ZN5boost9container3dtl9flat_treeINS1_4pairIN5eosio15extended_symbolExEENS1_9select1stIS5_EENSt3__14lessIS5_EENS0_13new_allocatorIS6_EEE13insert_uniqueENS0_12vec_iteratorIPS6_Lb1EEEOS6_ - (i32.add - (get_local $14) - (i32.const 24) - ) - (get_local $7) - (get_local $11) - (get_local $14) - ) - (set_local $11 - (i32.load offset=24 - (get_local $14) - ) - ) - ) - (i64.store offset=16 - (get_local $11) - (get_local $4) - ) - (call $eosio_assert - (i32.xor - (i32.wrap/i64 - (i64.shr_u - (i64.load - (i32.load - (i32.add - (get_local $3) - (i32.const 4) - ) - ) - ) - (i64.const 63) - ) - ) - (i32.const 1) - ) - (i32.const 624) - ) - (set_local $13 - (i64.extend_u/i32 - (tee_local $10 - (i32.load - (i32.add - (get_local $1) - (i32.const 12) - ) - ) - ) - ) - ) - (set_local $12 - (i32.const 8) - ) - (loop $label$4 - (set_local $12 - (i32.add - (get_local $12) - (i32.const 1) - ) - ) - (br_if $label$4 - (i64.ne - (tee_local $13 - (i64.shr_u - (get_local $13) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (get_local $10) - ) - ) - (set_local $12 - (i32.add - (i32.sub - (tee_local $10 - (i32.mul - (get_local $10) - (i32.const 24) - ) - ) - (i32.rem_u - (i32.add - (get_local $10) - (i32.const -24) - ) - (i32.const 24) - ) - ) - (get_local $12) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.lt_u - (get_local $12) - (i32.const 513) - ) - ) - (set_local $10 - (call $malloc - (get_local $12) - ) - ) - (br $label$6) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $10 - (i32.sub - (get_local $15) - (i32.and - (i32.add - (get_local $12) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (i32.store - (get_local $14) - (get_local $10) - ) - (i32.store offset=8 - (get_local $14) - (i32.add - (get_local $10) - (get_local $12) - ) - ) - (call $eosio_assert - (i32.gt_s - (get_local $12) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (get_local $10) - (get_local $1) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $14) - (i32.add - (get_local $10) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEENS_15extended_symbolExEERT_S6_RKN5boost9container8flat_mapIT0_T1_NSt3__14lessISA_EENS8_13new_allocatorINSC_4pairISA_SB_EEEEEE - (get_local $14) - (get_local $7) - ) - ) - (i32.store offset=24 - (get_local $1) - (call $db_store_i64 - (i64.load offset=8 - (get_local $2) - ) - (i64.const 6290548272952901632) - (i64.load - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $13 - (i64.load - (get_local $1) - ) - ) - (get_local $10) - (get_local $12) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.lt_u - (get_local $12) - (i32.const 513) - ) - ) - (call $free - (get_local $10) - ) - ) - (block $label$9 - (br_if $label$9 - (i64.lt_u - (get_local $13) - (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 $13) - (i64.const 1) - ) - (i64.gt_u - (get_local $13) - (i64.const -3) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $14) - (i32.const 32) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy6290548272952901632ENS1_9exaccountEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_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) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (i32.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=8 - (get_local $1) - ) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (br_if $label$8 - (i32.ne - (get_local $6) - (get_local $7) - ) - ) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $6) - ) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - ) - (func $_ZN5eosio11multi_indexILy6290548272952901632ENS_9exaccountEJEE6modifyIZNS_17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEE3$_1EEvRKS1_yOT_ (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - (set_local $13 - (tee_local $14 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $14) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=20 - (get_local $1) - ) - (get_local $0) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (set_local $6 - (i32.add - (tee_local $11 - (i32.load offset=8 - (get_local $1) - ) - ) - (tee_local $10 - (i32.mul - (i32.load - (i32.add - (get_local $1) - (i32.const 12) - ) - ) - (i32.const 24) - ) - ) - ) - ) - (set_local $3 - (i64.load - (get_local $1) - ) - ) - (set_local $5 - (i64.load offset=16 - (tee_local $2 - (i32.load - (get_local $2) - ) - ) - ) - ) - (set_local $12 - (i64.load offset=8 - (get_local $2) - ) - ) - (set_local $4 - (i64.load - (get_local $2) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $10) - ) - ) - (set_local $2 - (i32.div_s - (get_local $10) - (i32.const 24) - ) - ) - (set_local $10 - (get_local $11) - ) - (loop $label$1 - (set_local $10 - (select - (tee_local $9 - (i32.add - (tee_local $8 - (i32.add - (get_local $10) - (i32.mul - (tee_local $7 - (i32.shr_u - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 24) - ) - ) - ) - (i32.const 24) - ) - ) - (get_local $10) - (tee_local $8 - (i64.lt_u - (i64.load - (get_local $8) - ) - (get_local $12) - ) - ) - ) - ) - (set_local $11 - (select - (get_local $9) - (get_local $11) - (get_local $8) - ) - ) - (br_if $label$1 - (tee_local $2 - (select - (i32.sub - (i32.add - (get_local $2) - (i32.const -1) - ) - (get_local $7) - ) - (get_local $7) - (get_local $8) - ) - ) - ) - ) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $11) - (get_local $6) - ) - ) - (br_if $label$2 - (i64.ge_u - (get_local $12) - (i64.load - (get_local $11) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $13) - (get_local $5) - ) - (i64.store - (get_local $13) - (get_local $12) - ) - (i64.store offset=16 - (get_local $13) - (i64.const 0) - ) - (call $_ZN5boost9container3dtl9flat_treeINS1_4pairIN5eosio15extended_symbolExEENS1_9select1stIS5_EENSt3__14lessIS5_EENS0_13new_allocatorIS6_EEE13insert_uniqueENS0_12vec_iteratorIPS6_Lb1EEEOS6_ - (i32.add - (get_local $13) - (i32.const 24) - ) - (get_local $7) - (get_local $11) - (get_local $13) - ) - (set_local $11 - (i32.load offset=24 - (get_local $13) - ) - ) - ) - (i64.store offset=16 - (get_local $11) - (tee_local $12 - (i64.add - (i64.load offset=16 - (get_local $11) - ) - (get_local $4) - ) - ) - ) - (call $eosio_assert - (i32.xor - (i32.wrap/i64 - (i64.shr_u - (get_local $12) - (i64.const 63) - ) - ) - (i32.const 1) - ) - (i32.const 512) - ) - (call $eosio_assert - (i64.eq - (get_local $3) - (i64.load - (get_local $1) - ) - ) - (i32.const 544) - ) - (set_local $12 - (i64.extend_u/i32 - (tee_local $10 - (i32.load - (i32.add - (get_local $1) - (i32.const 12) - ) - ) - ) - ) - ) - (set_local $2 - (i32.const 8) - ) - (loop $label$4 - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (br_if $label$4 - (i64.ne - (tee_local $12 - (i64.shr_u - (get_local $12) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (get_local $10) - ) - ) - (set_local $2 - (i32.add - (i32.sub - (tee_local $10 - (i32.mul - (get_local $10) - (i32.const 24) - ) - ) - (i32.rem_u - (i32.add - (get_local $10) - (i32.const -24) - ) - (i32.const 24) - ) - ) - (get_local $2) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (set_local $10 - (call $malloc - (get_local $2) - ) - ) - (br $label$6) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $10 - (i32.sub - (get_local $14) - (i32.and - (i32.add - (get_local $2) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (i32.store - (get_local $13) - (get_local $10) - ) - (i32.store offset=8 - (get_local $13) - (i32.add - (get_local $10) - (get_local $2) - ) - ) - (call $eosio_assert - (i32.gt_s - (get_local $2) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (get_local $10) - (get_local $1) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $13) - (i32.add - (get_local $10) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEENS_15extended_symbolExEERT_S6_RKN5boost9container8flat_mapIT0_T1_NSt3__14lessISA_EENS8_13new_allocatorINSC_4pairISA_SB_EEEEEE - (get_local $13) - (get_local $7) - ) - ) - (call $db_update_i64 - (i32.load offset=24 - (get_local $1) - ) - (i64.const 0) - (get_local $10) - (get_local $2) - ) - (block $label$8 - (br_if $label$8 - (i32.lt_u - (get_local $2) - (i32.const 513) - ) - ) - (call $free - (get_local $10) - ) - ) - (block $label$9 - (br_if $label$9 - (i64.lt_u - (get_local $3) - (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 $3) - (i64.const 1) - ) - (i64.gt_u - (get_local $3) - (i64.const -3) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $13) - (i32.const 32) - ) - ) - ) - (func $_ZN5boost9container3dtl9flat_treeINS1_4pairIN5eosio15extended_symbolExEENS1_9select1stIS5_EENSt3__14lessIS5_EENS0_13new_allocatorIS6_EEE13insert_uniqueENS0_12vec_iteratorIPS6_Lb1EEEOS6_ (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i64) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $13 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (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.eq - (tee_local $6 - (i32.add - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - (i32.mul - (tee_local $5 - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.const 24) - ) - ) - ) - (get_local $2) - ) - ) - (br_if $label$7 - (i64.ge_u - (tee_local $7 - (i64.load - (get_local $3) - ) - ) - (i64.load - (get_local $2) - ) - ) - ) - ) - (br_if $label$4 - (i32.eq - (get_local $4) - (get_local $2) - ) - ) - (br_if $label$4 - (i64.lt_u - (tee_local $8 - (i64.load - (tee_local $12 - (i32.add - (get_local $2) - (i32.const -24) - ) - ) - ) - ) - (tee_local $7 - (i64.load - (get_local $3) - ) - ) - ) - ) - (br_if $label$3 - (i64.ge_u - (get_local $7) - (get_local $8) - ) - ) - (set_local $2 - (get_local $4) - ) - (br_if $label$6 - (tee_local $11 - (i32.div_s - (i32.sub - (get_local $12) - (get_local $4) - ) - (i32.const 24) - ) - ) - ) - (br $label$5) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (tee_local $11 - (i32.div_s - (i32.sub - (get_local $6) - (get_local $2) - ) - (i32.const 24) - ) - ) - ) - ) - (loop $label$10 - (block $label$11 - (br_if $label$11 - (i64.ge_u - (i64.load - (tee_local $9 - (i32.add - (get_local $2) - (i32.mul - (tee_local $10 - (i32.shr_u - (get_local $11) - (i32.const 1) - ) - ) - (i32.const 24) - ) - ) - ) - ) - (get_local $7) - ) - ) - (set_local $2 - (i32.add - (get_local $9) - (i32.const 24) - ) - ) - (set_local $10 - (i32.sub - (i32.add - (get_local $11) - (i32.const -1) - ) - (get_local $10) - ) - ) - ) - (br_if $label$10 - (tee_local $11 - (get_local $10) - ) - ) - ) - ) - (br_if $label$4 - (i32.eq - (get_local $2) - (get_local $6) - ) - ) - (set_local $12 - (get_local $2) - ) - (br_if $label$4 - (i64.lt_u - (get_local $7) - (i64.load - (get_local $2) - ) - ) - ) - (br $label$3) - ) - (loop $label$12 - (block $label$13 - (br_if $label$13 - (i64.ge_u - (i64.load - (tee_local $9 - (i32.add - (get_local $2) - (i32.mul - (tee_local $10 - (i32.shr_u - (get_local $11) - (i32.const 1) - ) - ) - (i32.const 24) - ) - ) - ) - ) - (get_local $7) - ) - ) - (set_local $2 - (i32.add - (get_local $9) - (i32.const 24) - ) - ) - (set_local $10 - (i32.sub - (i32.add - (get_local $11) - (i32.const -1) - ) - (get_local $10) - ) - ) - ) - (br_if $label$12 - (tee_local $11 - (get_local $10) - ) - ) - ) - ) - (br_if $label$4 - (i32.eq - (get_local $2) - (get_local $12) - ) - ) - (set_local $12 - (get_local $2) - ) - (br_if $label$3 - (i64.ge_u - (get_local $7) - (i64.load - (get_local $2) - ) - ) - ) - ) - (i32.store offset=8 - (get_local $13) - (get_local $2) - ) - (block $label$14 - (br_if $label$14 - (i32.ne - (i32.load offset=8 - (get_local $1) - ) - (get_local $5) - ) - ) - (call $_ZN5boost9container6vectorINS0_3dtl4pairIN5eosio15extended_symbolExEENS0_13new_allocatorIS6_EEvE37priv_forward_range_insert_no_capacityINS2_17insert_move_proxyIS8_PS6_EEEENS0_12vec_iteratorISC_Lb0EEERKSC_jT_NS_11move_detail17integral_constantIjLj1EEE - (get_local $0) - (get_local $1) - (i32.add - (get_local $13) - (i32.const 8) - ) - (i32.const 1) - (get_local $3) - ) - (br $label$0) - ) - (set_local $9 - (i32.div_s - (i32.sub - (get_local $2) - (get_local $4) - ) - (i32.const 24) - ) - ) - (br_if $label$2 - (i32.eq - (get_local $6) - (get_local $2) - ) - ) - (i64.store - (i32.add - (get_local $6) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $6) - (i32.const -16) - ) - ) - ) - (i64.store - (get_local $6) - (i64.load - (tee_local $11 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - ) - (i64.store offset=16 - (i32.add - (get_local $4) - (i32.mul - (get_local $5) - (i32.const 24) - ) - ) - (i64.load - (i32.add - (get_local $6) - (i32.const -8) - ) - ) - ) - (i32.store - (tee_local $10 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (i32.add - (i32.load - (get_local $10) - ) - (i32.const 1) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.eq - (get_local $11) - (get_local $2) - ) - ) - (loop $label$16 - (i64.store - (i32.add - (get_local $11) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $11) - (i32.const -16) - ) - ) - ) - (i64.store - (get_local $11) - (i64.load - (tee_local $10 - (i32.add - (get_local $11) - (i32.const -24) - ) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $11) - (i32.const -8) - ) - ) - ) - (set_local $11 - (get_local $10) - ) - (br_if $label$16 - (i32.ne - (get_local $2) - (get_local $10) - ) - ) - ) - ) - (i64.store - (get_local $2) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - (i64.store offset=16 - (get_local $2) - (i64.load offset=16 - (get_local $3) - ) - ) - (br $label$1) - ) - (i32.store - (get_local $0) - (i32.add - (get_local $4) - (i32.mul - (i32.div_s - (i32.sub - (get_local $12) - (get_local $4) - ) - (i32.const 24) - ) - (i32.const 24) - ) - ) - ) - (br $label$0) - ) - (i64.store - (get_local $2) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - (i64.store offset=16 - (i32.add - (get_local $4) - (i32.mul - (get_local $5) - (i32.const 24) - ) - ) - (i64.load offset=16 - (get_local $3) - ) - ) - (i32.store - (tee_local $11 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (i32.add - (i32.load - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (i32.store - (get_local $0) - (i32.add - (i32.load - (get_local $1) - ) - (i32.mul - (get_local $9) - (i32.const 24) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $13) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEENS_15extended_symbolExEERT_S6_RKN5boost9container8flat_mapIT0_T1_NSt3__14lessISA_EENS8_13new_allocatorINSC_4pairISA_SB_EEEEEE (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) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (set_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $5 - (i64.load32_u offset=4 - (get_local $1) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $4 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$0 - (set_local $7 - (i32.wrap/i64 - (get_local $5) - ) - ) - (i32.store8 offset=15 - (get_local $8) - (i32.or - (i32.shl - (tee_local $2 - (i64.ne - (tee_local $5 - (i64.shr_u - (get_local $5) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - (i32.const 7) - ) - (i32.and - (get_local $7) - (i32.const 127) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $3) - ) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load - (get_local $4) - ) - (i32.add - (get_local $8) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$0 - (get_local $2) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $4 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (set_local $3 - (i32.add - (tee_local $7 - (i32.load - (get_local $1) - ) - ) - (i32.mul - (get_local $4) - (i32.const 24) - ) - ) - ) - (set_local $4 - (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 $6) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load - (get_local $4) - ) - (get_local $7) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $6) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load - (get_local $4) - ) - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $6) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load - (get_local $4) - ) - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - ) - (br_if $label$2 - (i32.ne - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 24) - ) - ) - (get_local $3) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5boost9container6vectorINS0_3dtl4pairIN5eosio15extended_symbolExEENS0_13new_allocatorIS6_EEvE37priv_forward_range_insert_no_capacityINS2_17insert_move_proxyIS8_PS6_EEEENS0_12vec_iteratorISC_Lb0EEERKSC_jT_NS_11move_detail17integral_constantIjLj1EEE (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (set_local $6 - (i32.div_s - (i32.sub - (tee_local $5 - (i32.load - (get_local $2) - ) - ) - (i32.load - (get_local $1) - ) - ) - (i32.const 24) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.lt_u - (i32.sub - (i32.const 178956970) - (tee_local $2 - (i32.load offset=8 - (get_local $1) - ) - ) - ) - (i32.add - (i32.sub - (get_local $3) - (get_local $2) - ) - (tee_local $10 - (i32.load offset=4 - (get_local $1) - ) - ) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.gt_u - (get_local $2) - (i32.const 536870911) - ) - ) - (set_local $2 - (i32.div_u - (i32.shl - (get_local $2) - (i32.const 3) - ) - (i32.const 5) - ) - ) - (br $label$1) - ) - (set_local $2 - (select - (i32.const -1) - (i32.shl - (get_local $2) - (i32.const 3) - ) - (i32.gt_u - (get_local $2) - (i32.const -1610612737) - ) - ) - ) - ) - (br_if $label$0 - (i32.ge_u - (tee_local $7 - (select - (tee_local $10 - (i32.add - (get_local $10) - (get_local $3) - ) - ) - (tee_local $2 - (select - (get_local $2) - (i32.const 178956970) - (i32.lt_u - (get_local $2) - (i32.const 178956970) - ) - ) - ) - (i32.gt_u - (get_local $10) - (get_local $2) - ) - ) - ) - (i32.const 178956971) - ) - ) - (set_local $2 - (tee_local $9 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 24) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eq - (tee_local $8 - (i32.load - (get_local $1) - ) - ) - (get_local $5) - ) - ) - (set_local $2 - (get_local $9) - ) - (br_if $label$3 - (i32.eqz - (get_local $8) - ) - ) - (set_local $10 - (get_local $8) - ) - (set_local $2 - (get_local $9) - ) - (loop $label$4 - (i64.store - (get_local $2) - (i64.load - (get_local $10) - ) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const 8) - ) - ) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const 16) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 24) - ) - ) - (br_if $label$4 - (i32.ne - (tee_local $10 - (i32.add - (get_local $10) - (i32.const 24) - ) - ) - (get_local $5) - ) - ) - ) - ) - (i64.store - (get_local $2) - (i64.load - (get_local $4) - ) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - (i64.store offset=16 - (get_local $2) - (i64.load offset=16 - (get_local $4) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.mul - (get_local $3) - (i32.const 24) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (get_local $8) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.eq - (tee_local $10 - (i32.add - (get_local $8) - (i32.mul - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (i32.const 24) - ) - ) - ) - (get_local $5) - ) - ) - (loop $label$7 - (i64.store - (get_local $2) - (i64.load - (get_local $5) - ) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (i64.store - (i32.add - (get_local $2) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 24) - ) - ) - (br_if $label$7 - (i32.ne - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 24) - ) - ) - (get_local $10) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load - (get_local $1) - ) - ) - ) - (i32.store - (get_local $1) - (get_local $9) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 8) - ) - (get_local $7) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (i32.div_s - (i32.sub - (get_local $2) - (get_local $9) - ) - (i32.const 24) - ) - ) - (i32.store - (get_local $0) - (i32.add - (get_local $9) - (i32.mul - (get_local $6) - (i32.const 24) - ) - ) - ) - (return) - ) - (call $abort) - (unreachable) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEENS_15extended_symbolExEERT_S7_RN5boost9container8flat_mapIT0_T1_NSt3__14lessISB_EENS9_13new_allocatorINSD_4pairISB_SC_EEEEEE (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) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=4 - (get_local $1) - (i32.const 0) - ) - (set_local $8 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $5 - (i64.const 0) - ) - (set_local $7 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$0 - (call $eosio_assert - (i32.lt_u - (get_local $8) - (i32.load - (get_local $7) - ) - ) - (i32.const 704) - ) - (set_local $3 - (i32.load8_u - (tee_local $8 - (i32.load - (get_local $2) - ) - ) - ) - ) - (i32.store - (get_local $2) - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - ) - (set_local $5 - (i64.or - (i64.extend_u/i32 - (i32.shl - (i32.and - (get_local $3) - (i32.const 127) - ) - (tee_local $6 - (i32.and - (get_local $6) - (i32.const 255) - ) - ) - ) - ) - (get_local $5) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 7) - ) - ) - (br_if $label$0 - (i32.shr_u - (get_local $3) - (i32.const 7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $3 - (i32.wrap/i64 - (get_local $5) - ) - ) - ) - ) - (set_local $7 - (i32.add - (get_local $3) - (i32.const -1) - ) - ) - (set_local $6 - (i32.add - (i32.add - (get_local $9) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (set_local $4 - (i32.add - (get_local $9) - (i32.const 56) - ) - ) - (loop $label$2 - (i64.store - (get_local $6) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $9) - (i64.const 0) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (get_local $8) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $9) - (i32.const 16) - ) - (i32.load - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $3) - (tee_local $8 - (i32.add - (i32.load - (get_local $3) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $8) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $6) - (i32.load - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $3) - (tee_local $8 - (i32.add - (i32.load - (get_local $3) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $8) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.load - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $3) - (i32.add - (i32.load - (get_local $3) - ) - (i32.const 8) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 40) - ) - (i32.const 8) - ) - (i64.load - (get_local $6) - ) - ) - (i64.store offset=40 - (get_local $9) - (i64.load offset=16 - (get_local $9) - ) - ) - (i64.store - (get_local $4) - (i64.load offset=8 - (get_local $9) - ) - ) - (call $_ZN5boost9container3dtl9flat_treeINS1_4pairIN5eosio15extended_symbolExEENS1_9select1stIS5_EENSt3__14lessIS5_EENS0_13new_allocatorIS6_EEE13insert_uniqueEOS6_ - (i32.add - (get_local $9) - (i32.const 32) - ) - (get_local $1) - (i32.add - (get_local $9) - (i32.const 40) - ) - ) - (br_if $label$1 - (i32.eqz - (get_local $7) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const -1) - ) - ) - (set_local $8 - (i32.load - (get_local $3) - ) - ) - (br $label$2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 64) - ) - ) - (get_local $0) - ) - (func $_ZN5boost9container3dtl9flat_treeINS1_4pairIN5eosio15extended_symbolExEENS1_9select1stIS5_EENSt3__14lessIS5_EENS0_13new_allocatorIS6_EEE13insert_uniqueEOS6_ (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (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 16) - ) - ) - ) - (i32.store8 offset=4 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $0) - (i32.const 0) - ) - (set_local $5 - (i64.load - (get_local $2) - ) - ) - (set_local $6 - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $7 - (i32.div_s - (i32.mul - (tee_local $4 - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.const 24) - ) - (i32.const 24) - ) - ) - ) - ) - (loop $label$1 - (block $label$2 - (br_if $label$2 - (i64.ge_u - (i64.load - (tee_local $8 - (i32.add - (get_local $6) - (i32.mul - (tee_local $10 - (i32.shr_u - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 24) - ) - ) - ) - ) - (get_local $5) - ) - ) - (set_local $6 - (i32.add - (get_local $8) - (i32.const 24) - ) - ) - (set_local $10 - (i32.sub - (i32.add - (get_local $7) - (i32.const -1) - ) - (get_local $10) - ) - ) - ) - (br_if $label$1 - (tee_local $7 - (get_local $10) - ) - ) - ) - ) - (block $label$3 - (block $label$4 - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.eqz - (tee_local $7 - (i32.ne - (get_local $6) - (tee_local $10 - (i32.add - (get_local $3) - (i32.mul - (get_local $4) - (i32.const 24) - ) - ) - ) - ) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $0) - (i32.const 4) - ) - (i64.lt_u - (get_local $5) - (tee_local $9 - (i64.load - (get_local $6) - ) - ) - ) - ) - (br_if $label$5 - (i64.lt_u - (get_local $5) - (get_local $9) - ) - ) - (br $label$4) - ) - (i32.store8 - (i32.add - (get_local $0) - (i32.const 4) - ) - (i32.const 1) - ) - ) - (i32.store offset=8 - (get_local $11) - (get_local $6) - ) - (block $label$7 - (br_if $label$7 - (i32.ne - (i32.load offset=8 - (get_local $1) - ) - (get_local $4) - ) - ) - (call $_ZN5boost9container6vectorINS0_3dtl4pairIN5eosio15extended_symbolExEENS0_13new_allocatorIS6_EEvE37priv_forward_range_insert_no_capacityINS2_17insert_move_proxyIS8_PS6_EEEENS0_12vec_iteratorISC_Lb0EEERKSC_jT_NS_11move_detail17integral_constantIjLj1EEE - (get_local $11) - (get_local $1) - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.const 1) - (get_local $2) - ) - (set_local $6 - (i32.load - (get_local $11) - ) - ) - (br $label$3) - ) - (set_local $8 - (i32.div_s - (i32.sub - (get_local $6) - (get_local $3) - ) - (i32.const 24) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eqz - (get_local $7) - ) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const -16) - ) - ) - ) - (i64.store - (get_local $10) - (i64.load - (tee_local $7 - (i32.add - (get_local $10) - (i32.const -24) - ) - ) - ) - ) - (i64.store offset=16 - (i32.add - (get_local $3) - (i32.mul - (get_local $4) - (i32.const 24) - ) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const -8) - ) - ) - ) - (i32.store - (tee_local $10 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (i32.add - (i32.load - (get_local $10) - ) - (i32.const 1) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eq - (get_local $7) - (get_local $6) - ) - ) - (loop $label$11 - (i64.store - (i32.add - (get_local $7) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -16) - ) - ) - ) - (i64.store - (get_local $7) - (i64.load - (tee_local $10 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (i64.store - (i32.add - (get_local $7) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -8) - ) - ) - ) - (set_local $7 - (get_local $10) - ) - (br_if $label$11 - (i32.ne - (get_local $6) - (get_local $10) - ) - ) - ) - ) - (i64.store - (get_local $6) - (i64.load - (get_local $2) - ) - ) - (i64.store - (i32.add - (get_local $6) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i64.store offset=16 - (get_local $6) - (i64.load offset=16 - (get_local $2) - ) - ) - (br $label$8) - ) - (i64.store - (get_local $6) - (i64.load - (get_local $2) - ) - ) - (i64.store - (i32.add - (get_local $6) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i64.store offset=16 - (i32.add - (get_local $3) - (i32.mul - (get_local $4) - (i32.const 24) - ) - ) - (i64.load offset=16 - (get_local $2) - ) - ) - (i32.store - (tee_local $7 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (i32.add - (i32.load - (get_local $7) - ) - (i32.const 1) - ) - ) - ) - (set_local $6 - (i32.add - (i32.load - (get_local $1) - ) - (i32.mul - (get_local $8) - (i32.const 24) - ) - ) - ) - ) - (i32.store - (get_local $11) - (get_local $6) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 16) - ) - ) - ) - (func $_ZN5boost9container6vectorINS0_3dtl4pairIyN5eosio11multi_indexILy6290548272952901632ENS4_9exaccountEJEEEEENS0_13new_allocatorIS8_EEvE40priv_forward_range_insert_new_allocationINS2_17insert_move_proxyISA_PS8_EEEEvSE_jSE_jT_ (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (set_local $11 - (get_local $1) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $10 - (i32.load - (get_local $0) - ) - ) - (get_local $3) - ) - ) - (set_local $11 - (get_local $1) - ) - (br_if $label$0 - (i32.eqz - (get_local $10) - ) - ) - (set_local $6 - (get_local $10) - ) - (set_local $11 - (get_local $1) - ) - (loop $label$1 - (i64.store - (get_local $11) - (i64.load - (get_local $6) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $6) - (i32.const 24) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $6) - (i32.const 8) - ) - ) - ) - (i32.store - (tee_local $12 - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $9 - (i32.add - (get_local $11) - (i32.const 36) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $7 - (i32.add - (get_local $11) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $12) - (i32.load - (tee_local $8 - (i32.add - (get_local $6) - (i32.const 32) - ) - ) - ) - ) - (i32.store - (get_local $9) - (i32.load - (i32.add - (get_local $6) - (i32.const 36) - ) - ) - ) - (i32.store - (get_local $7) - (i32.load - (tee_local $12 - (i32.add - (get_local $6) - (i32.const 40) - ) - ) - ) - ) - (i32.store - (get_local $12) - (i32.const 0) - ) - (i64.store align=4 - (get_local $8) - (i64.const 0) - ) - (set_local $11 - (i32.add - (get_local $11) - (i32.const 48) - ) - ) - (br_if $label$1 - (i32.ne - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 48) - ) - ) - (get_local $3) - ) - ) - ) - ) - (i64.store - (get_local $11) - (i64.load - (get_local $5) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 24) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $11) - (i64.load offset=8 - (get_local $5) - ) - ) - (i32.store - (tee_local $6 - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $12 - (i32.add - (get_local $11) - (i32.const 36) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $9 - (i32.add - (get_local $11) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $6) - (i32.load - (tee_local $7 - (i32.add - (get_local $5) - (i32.const 32) - ) - ) - ) - ) - (i32.store - (get_local $12) - (i32.load - (i32.add - (get_local $5) - (i32.const 36) - ) - ) - ) - (i32.store - (get_local $9) - (i32.load - (tee_local $6 - (i32.add - (get_local $5) - (i32.const 40) - ) - ) - ) - ) - (i32.store - (get_local $6) - (i32.const 0) - ) - (i64.store align=4 - (get_local $7) - (i64.const 0) - ) - (set_local $12 - (i32.add - (get_local $11) - (i32.mul - (get_local $4) - (i32.const 48) - ) - ) - ) - (block $label$2 - (br_if $label$2 - (i32.eqz - (get_local $10) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eq - (tee_local $8 - (i32.add - (get_local $10) - (i32.mul - (tee_local $9 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (i32.const 48) - ) - ) - ) - (get_local $3) - ) - ) - (loop $label$4 - (i64.store - (get_local $12) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (get_local $12) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 24) - ) - ) - ) - (i64.store - (i32.add - (get_local $12) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $12) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - (i32.store - (tee_local $11 - (i32.add - (get_local $12) - (i32.const 32) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $6 - (i32.add - (get_local $12) - (i32.const 36) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $9 - (i32.add - (get_local $12) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $11) - (i32.load - (tee_local $7 - (i32.add - (get_local $3) - (i32.const 32) - ) - ) - ) - ) - (i32.store - (get_local $6) - (i32.load - (i32.add - (get_local $3) - (i32.const 36) - ) - ) - ) - (i32.store - (get_local $9) - (i32.load - (tee_local $11 - (i32.add - (get_local $3) - (i32.const 40) - ) - ) - ) - ) - (i32.store - (get_local $11) - (i32.const 0) - ) - (i64.store align=4 - (get_local $7) - (i64.const 0) - ) - (set_local $12 - (i32.add - (get_local $12) - (i32.const 48) - ) - ) - (br_if $label$4 - (i32.ne - (tee_local $3 - (i32.add - (get_local $3) - (i32.const 48) - ) - ) - (get_local $8) - ) - ) - ) - (set_local $9 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (get_local $9) - ) - ) - (loop $label$6 - (set_local $9 - (i32.add - (get_local $9) - (i32.const -1) - ) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (tee_local $3 - (i32.load - (tee_local $7 - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - ) - ) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eq - (tee_local $11 - (i32.load - (tee_local $8 - (i32.add - (get_local $10) - (i32.const 36) - ) - ) - ) - ) - (get_local $3) - ) - ) - (loop $label$10 - (set_local $6 - (i32.load - (tee_local $11 - (i32.add - (get_local $11) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $11) - (i32.const 0) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $6) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (i32.load - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=8 - (get_local $6) - ) - ) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - (br_if $label$10 - (i32.ne - (get_local $3) - (get_local $11) - ) - ) - ) - (set_local $11 - (i32.load - (get_local $7) - ) - ) - (br $label$8) - ) - (set_local $11 - (get_local $3) - ) - ) - (i32.store - (get_local $8) - (get_local $3) - ) - (call $_ZdlPv - (get_local $11) - ) - ) - (set_local $10 - (i32.add - (get_local $10) - (i32.const 48) - ) - ) - (br_if $label$6 - (get_local $9) - ) - ) - ) - (call $_ZdlPv - (i32.load - (get_local $0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (i32.store offset=8 - (get_local $0) - (get_local $2) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (i32.div_s - (i32.sub - (get_local $12) - (get_local $1) - ) - (i32.const 48) - ) - ) - ) - (func $_ZN5boost9container6vectorINS0_3dtl4pairIyN5eosio11multi_indexILy6290548272952901632ENS4_9exaccountEJEEEEENS0_13new_allocatorIS8_EEvE40priv_forward_range_insert_expand_forwardINS2_17insert_move_proxyISA_PS8_EEEEvSE_jT_ (param $0 i32) (param $1 i32) (param $2 i32) (param $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) - (local $14 i32) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $2) - ) - ) - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $13 - (i32.sub - (tee_local $11 - (i32.add - (tee_local $4 - (i32.load - (get_local $0) - ) - ) - (i32.mul - (tee_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 48) - ) - ) - ) - (get_local $1) - ) - ) - ) - ) - (br_if $label$9 - (i32.ge_u - (i32.div_s - (get_local $13) - (i32.const 48) - ) - (get_local $2) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eq - (get_local $11) - (get_local $1) - ) - ) - (set_local $9 - (i32.sub - (i32.sub - (i32.const 0) - (get_local $4) - ) - (i32.mul - (get_local $6) - (i32.const 48) - ) - ) - ) - (set_local $10 - (i32.mul - (get_local $2) - (i32.const 48) - ) - ) - (set_local $13 - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (loop $label$12 - (i64.store - (i32.add - (tee_local $8 - (i32.add - (get_local $13) - (get_local $10) - ) - ) - (i32.const -40) - ) - (i64.load - (i32.add - (get_local $13) - (i32.const -40) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -28) - ) - (i32.load - (i32.add - (get_local $13) - (i32.const -28) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -32) - ) - (i32.load - (i32.add - (get_local $13) - (i32.const -32) - ) - ) - ) - (i64.store - (i32.add - (get_local $8) - (i32.const -16) - ) - (i64.load - (i32.add - (get_local $13) - (i32.const -16) - ) - ) - ) - (i64.store - (i32.add - (get_local $8) - (i32.const -24) - ) - (i64.load - (i32.add - (get_local $13) - (i32.const -24) - ) - ) - ) - (i32.store - (tee_local $7 - (i32.add - (get_local $8) - (i32.const -8) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $12 - (i32.add - (get_local $8) - (i32.const -4) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i32.store - (get_local $7) - (i32.load - (tee_local $14 - (i32.add - (get_local $13) - (i32.const -8) - ) - ) - ) - ) - (i32.store - (get_local $12) - (i32.load - (tee_local $7 - (i32.add - (get_local $13) - (i32.const -4) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.load - (get_local $13) - ) - ) - (i32.store - (get_local $14) - (i32.const 0) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (i32.store - (get_local $13) - (i32.const 0) - ) - (br_if $label$12 - (i32.ne - (i32.add - (tee_local $13 - (i32.add - (get_local $13) - (i32.const 48) - ) - ) - (get_local $9) - ) - (i32.const 40) - ) - ) - ) - ) - (i64.store - (get_local $1) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (get_local $1) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 24) - ) - ) - ) - (i64.store - (i32.add - (get_local $1) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $1) - (i64.load offset=8 - (get_local $3) - ) - ) - (set_local $12 - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - (br_if $label$8 - (i32.eqz - (tee_local $7 - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - ) - ) - (br_if $label$6 - (i32.eq - (tee_local $13 - (i32.load - (tee_local $9 - (i32.add - (get_local $1) - (i32.const 36) - ) - ) - ) - ) - (get_local $7) - ) - ) - (loop $label$13 - (set_local $8 - (i32.load - (tee_local $13 - (i32.add - (get_local $13) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $13) - (i32.const 0) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (get_local $8) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (i32.load - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=8 - (get_local $8) - ) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$13 - (i32.ne - (get_local $7) - (get_local $13) - ) - ) - ) - (set_local $13 - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - (br $label$5) - ) - (i64.store - (get_local $11) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 24) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $11) - (i64.load offset=8 - (get_local $3) - ) - ) - (i32.store - (tee_local $13 - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $8 - (i32.add - (get_local $11) - (i32.const 36) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $7 - (i32.add - (get_local $11) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $13) - (i32.load - (tee_local $11 - (i32.add - (get_local $3) - (i32.const 32) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.load - (i32.add - (get_local $3) - (i32.const 36) - ) - ) - ) - (i32.store - (get_local $7) - (i32.load - (tee_local $13 - (i32.add - (get_local $3) - (i32.const 40) - ) - ) - ) - ) - (i32.store - (get_local $13) - (i32.const 0) - ) - (i64.store align=4 - (get_local $11) - (i64.const 0) - ) - (i32.store - (tee_local $13 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (i32.add - (i32.load - (get_local $13) - ) - (get_local $2) - ) - ) - (return) - ) - (set_local $6 - (i32.add - (i32.add - (get_local $4) - (tee_local $13 - (i32.mul - (i32.sub - (i32.const 0) - (get_local $2) - ) - (i32.const 48) - ) - ) - ) - (tee_local $8 - (i32.mul - (get_local $6) - (i32.const 48) - ) - ) - ) - ) - (set_local $5 - (i32.mul - (get_local $2) - (i32.const 48) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (get_local $8) - ) - ) - (set_local $12 - (i32.add - (get_local $11) - (get_local $13) - ) - ) - (set_local $7 - (i32.const 0) - ) - (loop $label$16 - (i64.store - (tee_local $13 - (i32.add - (get_local $4) - (get_local $7) - ) - ) - (i64.load - (tee_local $8 - (i32.add - (get_local $6) - (get_local $7) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $13) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $8) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $13) - (i32.const 8) - ) - (i32.load - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - ) - (i64.store - (i32.add - (get_local $13) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $8) - (i32.const 24) - ) - ) - ) - (i64.store - (i32.add - (get_local $13) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - (i32.store - (tee_local $14 - (i32.add - (get_local $13) - (i32.const 32) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $9 - (i32.add - (get_local $13) - (i32.const 36) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $13 - (i32.add - (get_local $13) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $14) - (i32.load - (tee_local $10 - (i32.add - (get_local $8) - (i32.const 32) - ) - ) - ) - ) - (i32.store - (get_local $9) - (i32.load - (tee_local $14 - (i32.add - (get_local $8) - (i32.const 36) - ) - ) - ) - ) - (i32.store - (get_local $13) - (i32.load - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 40) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i32.store - (get_local $10) - (i32.const 0) - ) - (i32.store - (get_local $14) - (i32.const 0) - ) - (br_if $label$16 - (i32.ne - (get_local $5) - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 48) - ) - ) - ) - ) - ) - (i32.store - (tee_local $13 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (i32.add - (i32.load - (get_local $13) - ) - (get_local $2) - ) - ) - (block $label$17 - (br_if $label$17 - (i32.eq - (get_local $12) - (get_local $1) - ) - ) - (loop $label$18 - (i64.store - (tee_local $5 - (i32.add - (get_local $11) - (i32.const -48) - ) - ) - (i64.load - (tee_local $10 - (i32.add - (get_local $12) - (i32.const -48) - ) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const -24) - ) - (i64.load - (i32.add - (get_local $12) - (i32.const -24) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const -32) - ) - (i64.load - (i32.add - (get_local $12) - (i32.const -32) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const -40) - ) - (i64.load - (i32.add - (get_local $12) - (i32.const -40) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $12) - (i32.const -16) - ) - ) - (block $label$19 - (block $label$20 - (block $label$21 - (block $label$22 - (br_if $label$22 - (i32.eqz - (tee_local $7 - (i32.load - (tee_local $9 - (i32.add - (get_local $11) - (i32.const -16) - ) - ) - ) - ) - ) - ) - (br_if $label$21 - (i32.eq - (tee_local $13 - (i32.load - (tee_local $14 - (i32.add - (get_local $11) - (i32.const -12) - ) - ) - ) - ) - (get_local $7) - ) - ) - (loop $label$23 - (set_local $8 - (i32.load - (tee_local $13 - (i32.add - (get_local $13) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $13) - (i32.const 0) - ) - (block $label$24 - (br_if $label$24 - (i32.eqz - (get_local $8) - ) - ) - (block $label$25 - (br_if $label$25 - (i32.eqz - (i32.load - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=8 - (get_local $8) - ) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$23 - (i32.ne - (get_local $7) - (get_local $13) - ) - ) - ) - (set_local $13 - (i32.load - (get_local $9) - ) - ) - (br $label$20) - ) - (set_local $8 - (i32.add - (get_local $11) - (i32.const -8) - ) - ) - (set_local $14 - (i32.add - (get_local $11) - (i32.const -12) - ) - ) - (br $label$19) - ) - (set_local $13 - (get_local $7) - ) - ) - (i32.store - (get_local $14) - (get_local $7) - ) - (call $_ZdlPv - (get_local $13) - ) - (i32.store - (get_local $14) - (i32.const 0) - ) - (i32.store - (tee_local $8 - (i32.add - (get_local $11) - (i32.const -8) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $9) - (i32.const 0) - ) - ) - (i32.store - (get_local $9) - (i32.load - (get_local $6) - ) - ) - (i32.store - (get_local $14) - (i32.load - (tee_local $13 - (i32.add - (get_local $12) - (i32.const -12) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.load - (i32.add - (get_local $12) - (i32.const -8) - ) - ) - ) - (i32.store - (get_local $6) - (i32.const 0) - ) - (i64.store align=4 - (get_local $13) - (i64.const 0) - ) - (set_local $11 - (get_local $5) - ) - (set_local $12 - (get_local $10) - ) - (br_if $label$18 - (i32.ne - (get_local $10) - (get_local $1) - ) - ) - ) - ) - (i64.store - (get_local $1) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (get_local $1) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 24) - ) - ) - ) - (i64.store - (i32.add - (get_local $1) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $1) - (i64.load offset=8 - (get_local $3) - ) - ) - (br_if $label$7 - (i32.eqz - (tee_local $7 - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - ) - ) - (br_if $label$3 - (i32.eq - (tee_local $13 - (i32.load - (tee_local $11 - (i32.add - (get_local $1) - (i32.const 36) - ) - ) - ) - ) - (get_local $7) - ) - ) - (loop $label$26 - (set_local $8 - (i32.load - (tee_local $13 - (i32.add - (get_local $13) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $13) - (i32.const 0) - ) - (block $label$27 - (br_if $label$27 - (i32.eqz - (get_local $8) - ) - ) - (block $label$28 - (br_if $label$28 - (i32.eqz - (i32.load - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=8 - (get_local $8) - ) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$26 - (i32.ne - (get_local $7) - (get_local $13) - ) - ) - ) - (set_local $13 - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - (br $label$2) - ) - (set_local $13 - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (set_local $9 - (i32.add - (get_local $1) - (i32.const 36) - ) - ) - (br $label$4) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (set_local $11 - (i32.add - (get_local $1) - (i32.const 36) - ) - ) - (br $label$1) - ) - (set_local $13 - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 36) - ) - (get_local $7) - ) - (call $_ZdlPv - (get_local $13) - ) - (i32.store - (tee_local $13 - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $1) - (i32.const 32) - ) - (i64.const 0) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.load - (tee_local $8 - (i32.add - (get_local $3) - (i32.const 32) - ) - ) - ) - ) - (i32.store - (get_local $9) - (i32.load - (tee_local $14 - (i32.add - (get_local $3) - (i32.const 36) - ) - ) - ) - ) - (i32.store - (get_local $13) - (i32.load - (tee_local $7 - (i32.add - (get_local $3) - (i32.const 40) - ) - ) - ) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (i64.store align=4 - (get_local $8) - (i64.const 0) - ) - (i64.store - (get_local $11) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (tee_local $13 - (i32.add - (get_local $4) - (i32.mul - (get_local $6) - (i32.const 48) - ) - ) - ) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $12) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $13) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $12) - (i32.const 8) - ) - ) - ) - (i64.store offset=8 - (get_local $13) - (i64.load - (get_local $12) - ) - ) - (i32.store - (tee_local $11 - (i32.add - (get_local $13) - (i32.const 32) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $12 - (i32.add - (get_local $13) - (i32.const 36) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $13 - (i32.add - (get_local $13) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $11) - (i32.load - (get_local $8) - ) - ) - (i32.store - (get_local $12) - (i32.load - (get_local $14) - ) - ) - (i32.store - (get_local $13) - (i32.load - (get_local $7) - ) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (i64.store align=4 - (get_local $8) - (i64.const 0) - ) - (i32.store - (tee_local $13 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (i32.add - (i32.load - (get_local $13) - ) - (get_local $2) - ) - ) - (return) - ) - (set_local $13 - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 36) - ) - (get_local $7) - ) - (call $_ZdlPv - (get_local $13) - ) - (i32.store - (tee_local $7 - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $1) - (i32.const 32) - ) - (i64.const 0) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.load - (tee_local $13 - (i32.add - (get_local $3) - (i32.const 32) - ) - ) - ) - ) - (i32.store - (get_local $11) - (i32.load - (i32.add - (get_local $3) - (i32.const 36) - ) - ) - ) - (i32.store - (get_local $7) - (i32.load - (tee_local $8 - (i32.add - (get_local $3) - (i32.const 40) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i64.store align=4 - (get_local $13) - (i64.const 0) - ) - ) - ) - (func $_ZN5eosio12market_stateC2EyNS_11symbol_typeERNS_17exchange_accountsE (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (i64.store - (get_local $0) - (i64.shr_u - (get_local $2) - (i64.const 8) - ) - ) - (set_local $4 - (call $_ZN5eosio14exchange_stateC2Ev - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (i64.store offset=240 - (get_local $0) - (get_local $1) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 256) - ) - (i64.const -1) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 264) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 272) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 248) - ) - (tee_local $2 - (i64.load - (get_local $0) - ) - ) - ) - (i64.store offset=280 - (get_local $0) - (get_local $1) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 288) - ) - (tee_local $6 - (i64.or - (tee_local $5 - (i64.shl - (get_local $2) - (i64.const 4) - ) - ) - (i64.const 1) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 296) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 304) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 308) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 312) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $0) - (i32.const 316) - ) - (i32.const 0) - ) - (i64.store offset=320 - (get_local $0) - (get_local $1) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 328) - ) - (tee_local $5 - (i64.or - (get_local $5) - (i64.const 2) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 336) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 344) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 348) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 352) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $0) - (i32.const 356) - ) - (i32.const 0) - ) - (i64.store offset=360 - (get_local $0) - (get_local $1) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 368) - ) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 376) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 384) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 388) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 392) - ) - (i32.const 0) - ) - (i64.store offset=400 - (get_local $0) - (get_local $1) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 408) - ) - (get_local $5) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 416) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 424) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 428) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 432) - ) - (i32.const 0) - ) - (i32.store offset=440 - (get_local $0) - (get_local $3) - ) - (call $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE4findEy - (i32.add - (get_local $0) - (i32.const 444) - ) - (i32.add - (get_local $0) - (i32.const 240) - ) - (get_local $2) - ) - (call $eosio_assert - (i32.ne - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 448) - ) - ) - ) - (i32.const 0) - ) - (i32.const 720) - ) - (drop - (call $memcpy - (get_local $4) - (i32.load - (get_local $3) - ) - (i32.const 232) - ) - ) - (get_local $0) - ) - (func $_ZN5eosio14exchange_stateC2Ev (param $0 i32) (result i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $1 - (i64.shr_u - (i64.load - (get_local $2) - ) - (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 80) - ) - (i64.store offset=40 - (get_local $0) - (i64.const 0) - ) - (i32.store offset=32 - (get_local $0) - (i32.const 0) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 48) - ) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (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 80) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 64) - ) - (i32.const 500) - ) - (drop - (call $_ZN5eosio12margin_stateC2Ev - (i32.add - (get_local $0) - (i32.const 72) - ) - ) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 144) - ) - ) - (i64.const 1398362884) - ) - (i64.store offset=136 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $1 - (i64.shr_u - (i64.load - (get_local $2) - ) - (i64.const 8) - ) - ) - (set_local $2 - (i32.const 0) - ) - (block $label$10 - (block $label$11 - (loop $label$12 - (br_if $label$11 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $1) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$13 - (br_if $label$13 - (i64.ne - (i64.and - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$14 - (br_if $label$11 - (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$14 - (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$12 - (i32.lt_s - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$10) - ) - ) - (set_local $3 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $3) - (i32.const 80) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 160) - ) - (i32.const 500) - ) - (drop - (call $_ZN5eosio12margin_stateC2Ev - (i32.add - (get_local $0) - (i32.const 168) - ) - ) - ) - (get_local $0) - ) - (func $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE4findEy (param $0 i32) (param $1 i32) (param $2 i64) - (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 $1) - (i32.const 28) - ) - ) - ) - (tee_local $3 - (i32.load offset=24 - (get_local $1) - ) - ) - ) - ) - (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 - (i64.eq - (i64.shr_u - (i64.load - (i32.add - (i32.load - (get_local $6) - ) - (i32.const 16) - ) - ) - (i64.const 8) - ) - (get_local $2) - ) - ) - (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 - (br_if $label$2 - (i32.eq - (get_local $7) - (get_local $3) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=232 - (tee_local $6 - (i32.load - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (get_local $1) - ) - (i32.const 224) - ) - (i32.store offset=4 - (get_local $0) - (get_local $6) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (return) - ) - (block $label$3 - (br_if $label$3 - (i32.le_s - (tee_local $6 - (call $db_find_i64 - (i64.load - (get_local $1) - ) - (i64.load offset=8 - (get_local $1) - ) - (i64.const -7949128877345865728) - (get_local $2) - ) - ) - (i32.const -1) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=232 - (tee_local $6 - (call $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE31load_object_by_primary_iteratorEl - (get_local $1) - (get_local $6) - ) - ) - ) - (get_local $1) - ) - (i32.const 224) - ) - (i32.store offset=4 - (get_local $0) - (get_local $6) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (return) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - ) - (func $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE31load_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 656) - ) - (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=36 - (get_local $8) - (get_local $4) - ) - (i32.store offset=32 - (get_local $8) - (get_local $4) - ) - (i32.store offset=40 - (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) - ) - ) - (set_local $4 - (call $_ZN5eosio14exchange_stateC2Ev - (tee_local $6 - (call $_Znwj - (i32.const 248) - ) - ) - ) - ) - (i32.store offset=232 - (get_local $6) - (get_local $0) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_14exchange_stateE - (i32.add - (get_local $8) - (i32.const 32) - ) - (get_local $4) - ) - ) - (i32.store offset=236 - (get_local $6) - (get_local $1) - ) - (i32.store offset=24 - (get_local $8) - (get_local $6) - ) - (i64.store offset=16 - (get_local $8) - (tee_local $5 - (i64.shr_u - (i64.load offset=16 - (get_local $6) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=12 - (get_local $8) - (tee_local $7 - (i32.load offset=236 - (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_indexILy10497615196363685888ENS1_14exchange_stateEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 12) - ) - ) - ) - (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 $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_14exchange_stateE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $1) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 3) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_14exchange_state9connectorE - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_14exchange_state9connectorE - (get_local $0) - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (i32.add - (get_local $1) - (i32.const 136) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy10497615196363685888ENS1_14exchange_stateEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_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 $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_14exchange_state9connectorE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $1) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 3) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 40) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 48) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 56) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 64) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 72) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 80) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 88) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (get_local $0) - ) - (func $_ZN5eosio12margin_stateC2Ev (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 16) - ) - (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 80) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - (i64.const 1398362884) - ) - (i64.store offset=24 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (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 80) - ) - (i64.store offset=56 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=48 - (get_local $0) - (i64.const 9218868437227405311) - ) - (get_local $0) - ) - (func $_ZN5eosio12market_state11margin_callENS_15extended_symbolE (param $0 i32) (param $1 i32) - (block $label$0 - (br_if $label$0 - (i64.ne - (i64.load - (get_local $1) - ) - (i64.load - (i32.add - (get_local $0) - (i32.const 56) - ) - ) - ) - ) - (br_if $label$0 - (i64.ne - (i64.load offset=8 - (get_local $1) - ) - (i64.load - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - ) - (call $_ZN5eosio12market_state11margin_callERNS_14exchange_state9connectorERNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS5_yXadL_ZNKS5_8get_callEvEEEEEEEEE - (get_local $0) - (i32.add - (get_local $0) - (i32.const 48) - ) - (i32.add - (get_local $0) - (i32.const 280) - ) - ) - (return) - ) - (call $_ZN5eosio12market_state11margin_callERNS_14exchange_state9connectorERNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS5_yXadL_ZNKS5_8get_callEvEEEEEEEEE - (get_local $0) - (i32.add - (get_local $0) - (i32.const 144) - ) - (i32.add - (get_local $0) - (i32.const 320) - ) - ) - ) - (func $_ZN5eosio12market_state11margin_callERNS_14exchange_state9connectorERNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS5_yXadL_ZNKS5_8get_callEvEEEEEEEEE (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (local $8 f64) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 288) - ) - ) - ) - (i32.store offset=272 - (get_local $9) - (get_local $2) - ) - (i64.store offset=240 - (get_local $9) - (i64.const 0) - ) - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5indexILy4729653573519933440ES6_Ly0ELb0EE11lower_boundERKy - (i32.add - (get_local $9) - (i32.const 264) - ) - (i32.add - (get_local $9) - (i32.const 272) - ) - (i32.add - (get_local $9) - (i32.const 240) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $2 - (i32.load offset=268 - (get_local $9) - ) - ) - ) - ) - (i64.store - (tee_local $3 - (i32.add - (i32.add - (get_local $9) - (i32.const 216) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 48) - ) - ) - ) - (i64.store - (tee_local $4 - (i32.add - (i32.add - (get_local $9) - (i32.const 216) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 40) - ) - ) - ) - (i64.store offset=216 - (get_local $9) - (i64.load offset=32 - (get_local $2) - ) - ) - (set_local $7 - (i64.load - (i32.add - (get_local $2) - (i32.const 24) - ) - ) - ) - (i64.store offset=200 - (get_local $9) - (i64.load - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - (i64.store offset=208 - (get_local $9) - (get_local $7) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 16) - ) - (i64.load - (get_local $3) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 8) - ) - (i64.load - (get_local $4) - ) - ) - (i64.store offset=80 - (get_local $9) - (i64.load offset=216 - (get_local $9) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 8) - ) - (i64.load offset=208 - (get_local $9) - ) - ) - (i64.store offset=64 - (get_local $9) - (i64.load offset=200 - (get_local $9) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (i32.add - (get_local $9) - (i32.const 240) - ) - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.add - (get_local $9) - (i32.const 64) - ) - ) - (call $eosio_assert - (i64.ge_s - (tee_local $7 - (i64.load offset=240 - (get_local $9) - ) - ) - (i64.load offset=8 - (i32.load offset=268 - (get_local $9) - ) - ) - ) - (i32.const 736) - ) - (call $eosio_assert - (i64.eq - (tee_local $5 - (i64.load offset=256 - (get_local $9) - ) - ) - (i64.load - (i32.add - (tee_local $2 - (i32.load offset=268 - (get_local $9) - ) - ) - (i32.const 24) - ) - ) - ) - (i32.const 800) - ) - (call $eosio_assert - (i64.eq - (i64.load - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - (tee_local $6 - (i64.load offset=248 - (get_local $9) - ) - ) - ) - (i32.const 816) - ) - (call $eosio_assert - (i64.gt_s - (tee_local $7 - (i64.sub - (get_local $7) - (i64.load offset=8 - (get_local $2) - ) - ) - ) - (i64.const -4611686018427387904) - ) - (i32.const 864) - ) - (call $eosio_assert - (i64.lt_s - (get_local $7) - (i64.const 4611686018427387904) - ) - (i32.const 896) - ) - (i64.store offset=160 - (get_local $9) - (get_local $6) - ) - (i64.store offset=152 - (get_local $9) - (get_local $7) - ) - (i64.store offset=168 - (get_local $9) - (get_local $5) - ) - (i64.store offset=136 - (get_local $9) - (i64.load - (i32.add - (tee_local $2 - (i32.load offset=268 - (get_local $9) - ) - ) - (i32.const 40) - ) - ) - ) - (i64.store offset=144 - (get_local $9) - (i64.load - (i32.add - (get_local $2) - (i32.const 48) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 40) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (i32.add - (get_local $9) - (i32.const 152) - ) - (i32.const 20) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 40) - ) - (i32.const 16) - ) - (i32.load offset=168 - (get_local $9) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 40) - ) - (i32.const 8) - ) - (i64.load offset=160 - (get_local $9) - ) - ) - (i64.store offset=40 - (get_local $9) - (i64.load offset=152 - (get_local $9) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 8) - ) - (i64.load offset=144 - (get_local $9) - ) - ) - (i64.store offset=24 - (get_local $9) - (i64.load offset=136 - (get_local $9) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (i32.add - (get_local $9) - (i32.const 176) - ) - (get_local $3) - (i32.add - (get_local $9) - (i32.const 40) - ) - (i32.add - (get_local $9) - (i32.const 24) - ) - ) - (set_local $7 - (i64.load - (i32.load offset=268 - (get_local $9) - ) - ) - ) - (i64.store - (tee_local $2 - (i32.add - (i32.add - (get_local $9) - (i32.const 112) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 176) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (tee_local $3 - (i32.add - (i32.add - (get_local $9) - (i32.const 112) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 176) - ) - (i32.const 8) - ) - ) - ) - (i32.store offset=112 - (get_local $9) - (i32.load offset=176 - (get_local $9) - ) - ) - (i32.store offset=116 - (get_local $9) - (i32.load offset=180 - (get_local $9) - ) - ) - (set_local $0 - (i32.load offset=440 - (get_local $0) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 16) - ) - (i64.load - (get_local $2) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 8) - ) - (i64.load - (get_local $3) - ) - ) - (i64.store - (get_local $9) - (i64.load offset=112 - (get_local $9) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $0) - (get_local $7) - (get_local $9) - (get_local $9) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 56) - ) - ) - (i64.sub - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (i32.load offset=268 - (get_local $9) - ) - ) - ) - ) - (i64.store offset=280 - (get_local $9) - (tee_local $7 - (i64.load offset=264 - (get_local $9) - ) - ) - ) - (call $eosio_assert - (i32.ne - (tee_local $2 - (i32.wrap/i64 - (i64.shr_u - (get_local $7) - (i64.const 32) - ) - ) - ) - (i32.const 0) - ) - (i32.const 928) - ) - (drop - (call $_ZN5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5indexILy4729653573519933440ES6_Ly0ELb0EE14const_iteratorppEv - (i32.add - (get_local $9) - (i32.const 280) - ) - ) - ) - (call $_ZN5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5eraseERKS1_ - (i32.load offset=272 - (get_local $9) - ) - (get_local $2) - ) - (i64.store offset=280 - (get_local $9) - (i64.const 0) - ) - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5indexILy4729653573519933440ES6_Ly0ELb0EE11lower_boundERKy - (i32.add - (get_local $9) - (i32.const 104) - ) - (i32.add - (get_local $9) - (i32.const 272) - ) - (i32.add - (get_local $9) - (i32.const 280) - ) - ) - (i64.store offset=264 - (get_local $9) - (tee_local $7 - (i64.load offset=104 - (get_local $9) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.eqz - (tee_local $2 - (i32.wrap/i64 - (i64.shr_u - (get_local $7) - (i64.const 32) - ) - ) - ) - ) - ) - (set_local $8 - (f64.load offset=56 - (get_local $2) - ) - ) - (br $label$1) - ) - (set_local $8 - (f64.const 18446744073709551615) - ) - ) - (f64.store - (i32.add - (get_local $1) - (i32.const 80) - ) - (get_local $8) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 288) - ) - ) - ) - (func $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5indexILy4729653573519933440ES6_Ly0ELb0EE11lower_boundERKy (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $10 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $10) - (i64.const 0) - ) - (i64.store - (get_local $10) - (i64.load - (get_local $2) - ) - ) - (set_local $2 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.lt_s - (tee_local $3 - (call $db_idx64_lowerbound - (i64.load - (tee_local $8 - (i32.load - (get_local $1) - ) - ) - ) - (i64.load offset=8 - (get_local $8) - ) - (i64.const -7949197150146002944) - (get_local $10) - (i32.add - (get_local $10) - (i32.const 8) - ) - ) - ) - (i32.const 0) - ) - ) - (set_local $5 - (i64.load offset=8 - (get_local $10) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (tee_local $9 - (i32.load - (i32.add - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - (i32.const 28) - ) - ) - ) - (tee_local $6 - (i32.load offset=24 - (get_local $4) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $9) - (i32.const -24) - ) - ) - (set_local $7 - (i32.sub - (i32.const 0) - (get_local $6) - ) - ) - (loop $label$2 - (br_if $label$1 - (i64.eq - (i64.load - (i32.load - (get_local $2) - ) - ) - (get_local $5) - ) - ) - (set_local $9 - (get_local $2) - ) - (set_local $2 - (tee_local $8 - (i32.add - (get_local $2) - (i32.const -24) - ) - ) - ) - (br_if $label$2 - (i32.ne - (i32.add - (get_local $8) - (get_local $7) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.eq - (get_local $9) - (get_local $6) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (tee_local $2 - (i32.load - (i32.add - (get_local $9) - (i32.const -24) - ) - ) - ) - ) - (get_local $4) - ) - (i32.const 224) - ) - (br $label$3) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (tee_local $2 - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorEl - (get_local $4) - (call $db_find_i64 - (i64.load - (get_local $4) - ) - (i64.load offset=8 - (get_local $4) - ) - (i64.const -7949197150146002944) - (get_local $5) - ) - ) - ) - ) - (get_local $4) - ) - (i32.const 224) - ) - ) - (i32.store - (i32.add - (get_local $2) - (i32.const 72) - ) - (get_local $3) - ) - ) - (i32.store offset=4 - (get_local $0) - (get_local $2) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5indexILy4729653573519933440ES6_Ly0ELb0EE14const_iteratorppEv (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (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 16) - ) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=4 - (get_local $0) - ) - (i32.const 0) - ) - (i32.const 1152) - ) - (block $label$0 - (br_if $label$0 - (i32.ne - (tee_local $7 - (i32.load offset=72 - (tee_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - ) - (i32.const -1) - ) - ) - (set_local $7 - (call $db_idx64_find_primary - (i64.load - (tee_local $7 - (i32.load - (i32.load - (get_local $0) - ) - ) - ) - ) - (i64.load offset=8 - (get_local $7) - ) - (i64.const -7949197150146002944) - (i32.add - (get_local $9) - (i32.const 8) - ) - (i64.load - (get_local $6) - ) - ) - ) - (i32.store offset=72 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (get_local $7) - ) - ) - (i64.store offset=8 - (get_local $9) - (i64.const 0) - ) - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.le_s - (tee_local $1 - (call $db_idx64_next - (get_local $7) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - ) - (i32.const -1) - ) - ) - (set_local $3 - (i64.load offset=8 - (get_local $9) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $8 - (i32.load - (i32.add - (tee_local $2 - (i32.load - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 28) - ) - ) - ) - (tee_local $4 - (i32.load offset=24 - (get_local $2) - ) - ) - ) - ) - (set_local $7 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - (set_local $5 - (i32.sub - (i32.const 0) - (get_local $4) - ) - ) - (loop $label$6 - (br_if $label$5 - (i64.eq - (i64.load - (i32.load - (get_local $7) - ) - ) - (get_local $3) - ) - ) - (set_local $8 - (get_local $7) - ) - (set_local $7 - (tee_local $6 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - (br_if $label$6 - (i32.ne - (i32.add - (get_local $6) - (get_local $5) - ) - (i32.const -24) - ) - ) - ) - ) - (br_if $label$3 - (i32.eq - (get_local $8) - (get_local $4) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (tee_local $7 - (i32.load - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - ) - ) - (get_local $2) - ) - (i32.const 224) - ) - (br $label$2) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (i32.const 0) - ) - (br $label$1) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (tee_local $7 - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorEl - (get_local $2) - (call $db_find_i64 - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (get_local $2) - ) - (i64.const -7949197150146002944) - (get_local $3) - ) - ) - ) - ) - (get_local $2) - ) - (i32.const 224) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $7) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 72) - ) - (get_local $1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5eraseERKS1_ (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) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (get_local $1) - ) - (get_local $0) - ) - (i32.const 976) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 1024) - ) - (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 - (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.eq - (i64.load - (i32.load - (get_local $8) - ) - ) - (get_local $2) - ) - ) - (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 1088) - ) - (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=68 - (get_local $1) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.gt_s - (tee_local $7 - (i32.load - (i32.add - (get_local $1) - (i32.const 72) - ) - ) - ) - (i32.const -1) - ) - ) - (br_if $label$8 - (i32.lt_s - (tee_local $7 - (call $db_idx64_find_primary - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - (i64.const -7949197150146002944) - (i32.add - (get_local $9) - (i32.const 8) - ) - (i64.load - (get_local $1) - ) - ) - ) - (i32.const 0) - ) - ) - ) - (call $db_idx64_remove - (get_local $7) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - (func $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_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) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i32.store offset=44 - (tee_local $8 - (get_local $9) - ) - (get_local $1) - ) - (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 656) - ) - (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=36 - (get_local $8) - (get_local $4) - ) - (i32.store offset=32 - (get_local $8) - (get_local $4) - ) - (i32.store offset=40 - (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) - ) - ) - (i32.store offset=8 - (get_local $8) - (get_local $0) - ) - (i32.store offset=12 - (get_local $8) - (i32.add - (get_local $8) - (i32.const 32) - ) - ) - (i32.store offset=16 - (get_local $8) - (i32.add - (get_local $8) - (i32.const 44) - ) - ) - (drop - (call $_ZN5eosio15margin_positionC2Ev - (tee_local $6 - (call $_Znwj - (i32.const 80) - ) - ) - ) - ) - (i32.store offset=64 - (get_local $6) - (get_local $0) - ) - (call $_ZZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorElENKUlRT_E_clINS8_4itemEEEDaSA_ - (i32.add - (get_local $8) - (i32.const 8) - ) - (get_local $6) - ) - (i32.store offset=24 - (get_local $8) - (get_local $6) - ) - (i64.store offset=8 - (get_local $8) - (tee_local $5 - (i64.load - (get_local $6) - ) - ) - ) - (i32.store offset=4 - (get_local $8) - (tee_local $7 - (i32.load offset=68 - (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_indexILy10497546923563548672ENS1_15margin_positionEJNS1_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS3_yXadL_ZNKS3_8get_callEvEEEEEEEE8item_ptrENS_9allocatorISB_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINSA_4itemENS_14default_deleteISH_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (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 $_ZN5eosio15margin_positionC2Ev (param $0 i32) (result i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $1 - (i64.shr_u - (i64.load - (get_local $2) - ) - (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 80) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 40) - ) - ) - (i64.const 1398362884) - ) - (i64.store offset=32 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (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 80) - ) - (i64.store offset=56 - (get_local $0) - (i64.const 0) - ) - (get_local $0) - ) - (func $_ZZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorElENKUlRT_E_clINS8_4itemEEEDaSA_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $2 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (i32.load offset=4 - (get_local $2) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $1) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $3 - (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 $3) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $3 - (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 $3) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $3 - (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 $3) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $3 - (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 $3) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $3 - (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 $3) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 40) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $3 - (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 $3) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 48) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $3 - (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 $3) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 56) - ) - (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 $2 - (i32.load - (i32.load offset=8 - (get_local $0) - ) - ) - ) - (i32.store offset=72 - (get_local $1) - (i32.const -1) - ) - (i32.store offset=68 - (get_local $1) - (get_local $2) - ) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy10497546923563548672ENS1_15margin_positionEJNS1_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS3_yXadL_ZNKS3_8get_callEvEEEEEEEE8item_ptrENS_9allocatorISB_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINSA_4itemENS_14default_deleteISH_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 $_ZNK5eosio12market_state13initial_stateEv (param $0 i32) (result i32) - (i32.load - (i32.add - (get_local $0) - (i32.const 448) - ) - ) - ) - (func $_ZN5eosio12market_state4lendEyRKNS_14extended_assetE (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i32) - (local $6 i64) - (local $7 f64) - (local $8 f64) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i64.store offset=32 - (get_local $9) - (tee_local $3 - (i64.load offset=8 - (get_local $2) - ) - ) - ) - (set_local $5 - (i32.load offset=440 - (get_local $0) - ) - ) - (set_local $4 - (i64.load offset=16 - (get_local $2) - ) - ) - (set_local $6 - (i64.load - (get_local $2) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 8) - ) - (get_local $3) - ) - (i64.store offset=24 - (get_local $9) - (tee_local $6 - (i64.sub - (i64.const 0) - (get_local $6) - ) - ) - ) - (i64.store offset=40 - (get_local $9) - (get_local $4) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 16) - ) - (get_local $4) - ) - (i64.store - (get_local $9) - (get_local $6) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $5) - (get_local $1) - (get_local $9) - (get_local $9) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (block $label$5 - (br_if $label$5 - (i64.ne - (get_local $3) - (i64.load - (i32.add - (get_local $0) - (i32.const 56) - ) - ) - ) - ) - (br_if $label$5 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - ) - (set_local $4 - (i64.load - (get_local $2) - ) - ) - (br_if $label$4 - (i64.lt_s - (tee_local $3 - (i64.load - (i32.add - (get_local $0) - (i32.const 80) - ) - ) - ) - (i64.const 1) - ) - ) - (set_local $8 - (f64.add - (tee_local $8 - (f64.load - (i32.add - (get_local $0) - (i32.const 136) - ) - ) - ) - (f64.div - (f64.mul - (get_local $8) - (tee_local $7 - (f64.convert_s/i64 - (get_local $4) - ) - ) - ) - (f64.convert_s/i64 - (get_local $3) - ) - ) - ) - ) - (br $label$3) - ) - (block $label$6 - (br_if $label$6 - (i64.ne - (get_local $3) - (i64.load - (i32.add - (get_local $0) - (i32.const 152) - ) - ) - ) - ) - (br_if $label$6 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (get_local $0) - (i32.const 160) - ) - ) - ) - ) - (set_local $4 - (i64.load - (get_local $2) - ) - ) - (br_if $label$2 - (i64.lt_s - (tee_local $3 - (i64.load - (i32.add - (get_local $0) - (i32.const 176) - ) - ) - ) - (i64.const 1) - ) - ) - (set_local $8 - (f64.add - (tee_local $8 - (f64.load - (i32.add - (get_local $0) - (i32.const 232) - ) - ) - ) - (f64.div - (f64.mul - (get_local $8) - (tee_local $7 - (f64.convert_s/i64 - (get_local $4) - ) - ) - ) - (f64.convert_s/i64 - (get_local $3) - ) - ) - ) - ) - (br $label$1) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1184) - ) - (br $label$0) - ) - (set_local $8 - (f64.add - (tee_local $7 - (f64.convert_s/i64 - (get_local $4) - ) - ) - (f64.load - (i32.add - (get_local $0) - (i32.const 136) - ) - ) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 80) - ) - (i64.add - (get_local $3) - (get_local $4) - ) - ) - (f64.store - (i32.add - (get_local $0) - (i32.const 136) - ) - (get_local $8) - ) - (call $_ZN5eosio12market_state18adjust_lend_sharesEyRNS_11multi_indexILy10163845904742744064ENS_13loan_positionEJEEEd - (get_local $9) - (get_local $1) - (i32.add - (get_local $0) - (i32.const 360) - ) - (get_local $7) - ) - (br $label$0) - ) - (set_local $8 - (f64.add - (tee_local $7 - (f64.convert_s/i64 - (get_local $4) - ) - ) - (f64.load - (i32.add - (get_local $0) - (i32.const 232) - ) - ) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 176) - ) - (i64.add - (get_local $3) - (get_local $4) - ) - ) - (f64.store - (i32.add - (get_local $0) - (i32.const 232) - ) - (get_local $8) - ) - (call $_ZN5eosio12market_state18adjust_lend_sharesEyRNS_11multi_indexILy10163845904742744064ENS_13loan_positionEJEEEd - (get_local $9) - (get_local $1) - (i32.add - (get_local $0) - (i32.const 400) - ) - (get_local $7) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - ) - (func $_ZN5eosio12market_state18adjust_lend_sharesEyRNS_11multi_indexILy10163845904742744064ENS_13loan_positionEJEEEd (param $0 i32) (param $1 i64) (param $2 i32) (param $3 f64) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $10 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $9 - (i32.load - (i32.add - (get_local $2) - (i32.const 28) - ) - ) - ) - (tee_local $4 - (i32.load offset=24 - (get_local $2) - ) - ) - ) - ) - (set_local $8 - (i32.add - (get_local $9) - (i32.const -24) - ) - ) - (set_local $5 - (i32.sub - (i32.const 0) - (get_local $4) - ) - ) - (loop $label$1 - (br_if $label$0 - (i64.eq - (i64.load - (i32.load - (get_local $8) - ) - ) - (get_local $1) - ) - ) - (set_local $9 - (get_local $8) - ) - (set_local $8 - (tee_local $6 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $6) - (get_local $5) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$2 - (block $label$3 - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (get_local $9) - (get_local $4) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (tee_local $8 - (i32.load - (i32.add - (get_local $9) - (i32.const -24) - ) - ) - ) - ) - (get_local $2) - ) - (i32.const 224) - ) - (br_if $label$4 - (get_local $8) - ) - (br $label$3) - ) - (br_if $label$3 - (i32.lt_s - (tee_local $8 - (call $db_find_i64 - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (get_local $2) - ) - (i64.const -8282898168966807552) - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (tee_local $8 - (call $_ZNK5eosio11multi_indexILy10163845904742744064ENS_13loan_positionEJEE31load_object_by_primary_iteratorEl - (get_local $2) - (get_local $8) - ) - ) - ) - (get_local $2) - ) - (i32.const 224) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 352) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=16 - (get_local $8) - ) - (get_local $2) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $2) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (f64.store offset=8 - (get_local $8) - (tee_local $3 - (f64.add - (f64.load offset=8 - (get_local $8) - ) - (get_local $3) - ) - ) - ) - (set_local $1 - (i64.load - (get_local $8) - ) - ) - (call $eosio_assert - (f64.ge - (get_local $3) - (f64.const 0) - ) - (i32.const 1216) - ) - (call $eosio_assert - (i64.eq - (get_local $1) - (i64.load - (get_local $8) - ) - ) - (i32.const 544) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.add - (get_local $10) - (i32.const 16) - ) - (get_local $8) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.or - (i32.add - (get_local $10) - (i32.const 16) - ) - (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 $10) - (i32.const 16) - ) - (i32.const 16) - ) - (br_if $label$2 - (i64.lt_u - (get_local $1) - (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 $1) - (i64.const 1) - ) - (i64.gt_u - (get_local $1) - (i64.const -3) - ) - ) - ) - (br $label$2) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $2) - ) - (call $current_receiver) - ) - (i32.const 288) - ) - (i32.store offset=16 - (tee_local $8 - (call $_Znwj - (i32.const 32) - ) - ) - (get_local $2) - ) - (f64.store offset=8 - (get_local $8) - (get_local $3) - ) - (i64.store - (get_local $8) - (get_local $1) - ) - (call $eosio_assert - (f64.ge - (get_local $3) - (f64.const 0) - ) - (i32.const 1216) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.add - (get_local $10) - (i32.const 16) - ) - (get_local $8) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.or - (i32.add - (get_local $10) - (i32.const 16) - ) - (i32.const 8) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=20 - (get_local $8) - (tee_local $9 - (call $db_store_i64 - (i64.load offset=8 - (get_local $2) - ) - (i64.const -8282898168966807552) - (get_local $1) - (tee_local $7 - (i64.load - (get_local $8) - ) - ) - (i32.add - (get_local $10) - (i32.const 16) - ) - (i32.const 16) - ) - ) - ) - (block $label$6 - (br_if $label$6 - (i64.lt_u - (get_local $7) - (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 $7) - (i64.const 1) - ) - (i64.gt_u - (get_local $7) - (i64.const -3) - ) - ) - ) - ) - (i32.store offset=8 - (get_local $10) - (get_local $8) - ) - (i64.store offset=16 - (get_local $10) - (tee_local $1 - (i64.load - (get_local $8) - ) - ) - ) - (i32.store offset=4 - (get_local $10) - (get_local $9) - ) - (block $label$7 - (block $label$8 - (br_if $label$8 - (i32.ge_u - (tee_local $6 - (i32.load - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 28) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $6) - (get_local $1) - ) - (i32.store offset=16 - (get_local $6) - (get_local $9) - ) - (i32.store offset=8 - (get_local $10) - (i32.const 0) - ) - (i32.store - (get_local $6) - (get_local $8) - ) - (i32.store - (get_local $5) - (i32.add - (get_local $6) - (i32.const 24) - ) - ) - (br $label$7) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy10163845904742744064ENS1_13loan_positionEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $2) - (i32.const 24) - ) - (i32.add - (get_local $10) - (i32.const 8) - ) - (i32.add - (get_local $10) - (i32.const 16) - ) - (i32.add - (get_local $10) - (i32.const 4) - ) - ) - ) - (set_local $8 - (i32.load offset=8 - (get_local $10) - ) - ) - (i32.store offset=8 - (get_local $10) - (i32.const 0) - ) - (br_if $label$2 - (i32.eqz - (get_local $8) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - ) - (func $_ZNK5eosio11multi_indexILy10163845904742744064ENS_13loan_positionEJEE31load_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 32) - ) - ) - ) - (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 $4 - (call $db_get_i64 - (get_local $1) - (i32.const 0) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.const 1) - ) - (i32.const 656) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.le_u - (get_local $4) - (i32.const 512) - ) - ) - (drop - (call $db_get_i64 - (get_local $1) - (tee_local $7 - (call $malloc - (get_local $4) - ) - ) - (get_local $4) - ) - ) - (call $free - (get_local $7) - ) - (br $label$4) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (get_local $9) - (i32.and - (i32.add - (get_local $4) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - (drop - (call $db_get_i64 - (get_local $1) - (get_local $7) - (get_local $4) - ) - ) - ) - (i32.store offset=16 - (tee_local $6 - (call $_Znwj - (i32.const 32) - ) - ) - (get_local $0) - ) - (call $eosio_assert - (i32.gt_u - (get_local $4) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $6) - (get_local $7) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (i32.and - (get_local $4) - (i32.const -8) - ) - (i32.const 8) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $6) - (i32.const 8) - ) - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=20 - (get_local $6) - (get_local $1) - ) - (i32.store offset=24 - (get_local $8) - (get_local $6) - ) - (i64.store offset=16 - (get_local $8) - (tee_local $5 - (i64.load - (get_local $6) - ) - ) - ) - (i32.store offset=12 - (get_local $8) - (tee_local $7 - (i32.load offset=20 - (get_local $6) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (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$6) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy10163845904742744064ENS1_13loan_positionEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 12) - ) - ) - ) - (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 32) - ) - ) - (get_local $6) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy10163845904742744064ENS1_13loan_positionEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_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 $_ZN5eosio12market_state6unlendEydRKNS_15extended_symbolE (param $0 i32) (param $1 i64) (param $2 f64) (param $3 i32) - (local $4 i64) - (local $5 i64) - (local $6 i32) - (local $7 f64) - (local $8 f64) - (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 $eosio_assert - (f64.gt - (get_local $2) - (f64.const 0) - ) - (i32.const 1232) - ) - (call $_ZN5eosio12market_state18adjust_lend_sharesEyRNS_11multi_indexILy10163845904742744064ENS_13loan_positionEJEEEd - (get_local $9) - (get_local $1) - (i32.add - (get_local $0) - (i32.const 360) - ) - (f64.neg - (get_local $2) - ) - ) - (call $prints - (i32.const 1264) - ) - (call $_ZNK5eosio11symbol_type5printEb - (get_local $3) - (i32.const 1) - ) - (call $prints - (i32.const 1280) - ) - (call $printn - (i64.load offset=8 - (get_local $3) - ) - ) - (set_local $5 - (i64.load offset=8 - (get_local $3) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i64.ne - (tee_local $4 - (i64.load - (get_local $3) - ) - ) - (i64.load - (i32.add - (get_local $0) - (i32.const 56) - ) - ) - ) - ) - (br_if $label$1 - (i64.ne - (get_local $5) - (i64.load - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - ) - (i64.store - (tee_local $6 - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $0) - (i32.const 120) - ) - ) - ) - (i64.store offset=96 - (get_local $9) - (i64.load - (i32.add - (get_local $0) - (i32.const 112) - ) - ) - ) - (call $prints - (i32.const 1296) - ) - (call $printdf - (get_local $2) - ) - (call $prints - (i32.const 1312) - ) - (call $printdf - (f64.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 136) - ) - ) - ) - ) - (call $prints - (i32.const 1344) - ) - (f64.store - (get_local $3) - (tee_local $8 - (f64.sub - (tee_local $7 - (f64.load - (get_local $3) - ) - ) - (get_local $2) - ) - ) - ) - (i64.store - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 80) - ) - ) - (i64.sub - (tee_local $5 - (i64.load - (get_local $3) - ) - ) - (tee_local $5 - (i64.trunc_s/f64 - (f64.div - (f64.mul - (f64.convert_s/i64 - (get_local $5) - ) - (get_local $2) - ) - (get_local $7) - ) - ) - ) - ) - ) - (call $eosio_assert - (f64.ge - (get_local $8) - (f64.const 0) - ) - (i32.const 1216) - ) - (call $eosio_assert - (i32.xor - (i32.wrap/i64 - (i64.shr_u - (i64.load - (get_local $3) - ) - (i64.const 63) - ) - ) - (i32.const 1) - ) - (i32.const 1216) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 92) - ) - (i32.load - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (tee_local $3 - (i32.add - (i32.add - (get_local $9) - (i32.const 72) - ) - (i32.const 16) - ) - ) - (i32.load - (get_local $6) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 72) - ) - (i32.const 12) - ) - (i32.load offset=100 - (get_local $9) - ) - ) - (i64.store offset=72 - (get_local $9) - (get_local $5) - ) - (i32.store offset=80 - (get_local $9) - (i32.load offset=96 - (get_local $9) - ) - ) - (set_local $0 - (i32.load offset=440 - (get_local $0) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 8) - ) - (i64.load offset=80 - (get_local $9) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 16) - ) - (i64.load - (get_local $3) - ) - ) - (i64.store - (get_local $9) - (i64.load offset=72 - (get_local $9) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $0) - (get_local $1) - (get_local $9) - (get_local $9) - ) - (br $label$0) - ) - (block $label$2 - (br_if $label$2 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (get_local $0) - (i32.const 152) - ) - ) - ) - ) - (br_if $label$2 - (i64.ne - (get_local $5) - (i64.load - (i32.add - (get_local $0) - (i32.const 160) - ) - ) - ) - ) - (i64.store - (tee_local $6 - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $0) - (i32.const 216) - ) - ) - ) - (i64.store offset=96 - (get_local $9) - (i64.load - (i32.add - (get_local $0) - (i32.const 208) - ) - ) - ) - (call $prints - (i32.const 1296) - ) - (call $printdf - (get_local $2) - ) - (call $prints - (i32.const 1312) - ) - (call $printdf - (f64.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 232) - ) - ) - ) - ) - (call $prints - (i32.const 1344) - ) - (f64.store - (get_local $3) - (tee_local $8 - (f64.sub - (tee_local $7 - (f64.load - (get_local $3) - ) - ) - (get_local $2) - ) - ) - ) - (i64.store - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 176) - ) - ) - (i64.sub - (tee_local $5 - (i64.load - (get_local $3) - ) - ) - (tee_local $5 - (i64.trunc_s/f64 - (f64.div - (f64.mul - (f64.convert_s/i64 - (get_local $5) - ) - (get_local $2) - ) - (get_local $7) - ) - ) - ) - ) - ) - (call $eosio_assert - (f64.ge - (get_local $8) - (f64.const 0) - ) - (i32.const 1216) - ) - (call $eosio_assert - (i32.xor - (i32.wrap/i64 - (i64.shr_u - (i64.load - (get_local $3) - ) - (i64.const 63) - ) - ) - (i32.const 1) - ) - (i32.const 1216) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 68) - ) - (i32.load - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (tee_local $3 - (i32.add - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.const 16) - ) - ) - (i32.load - (get_local $6) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.const 12) - ) - (i32.load offset=100 - (get_local $9) - ) - ) - (i64.store offset=48 - (get_local $9) - (get_local $5) - ) - (i32.store offset=56 - (get_local $9) - (i32.load offset=96 - (get_local $9) - ) - ) - (set_local $0 - (i32.load offset=440 - (get_local $0) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 8) - ) - (i64.load offset=56 - (get_local $9) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 24) - ) - (i32.const 16) - ) - (i64.load - (get_local $3) - ) - ) - (i64.store offset=24 - (get_local $9) - (i64.load offset=48 - (get_local $9) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $0) - (get_local $1) - (i32.add - (get_local $9) - (i32.const 24) - ) - (get_local $9) - ) - (br $label$0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1184) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 112) - ) - ) - ) - (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 1360) - ) - ) - (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 $_ZN5eosio12market_state12cover_marginEyRKNS_14extended_assetE (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i64) - (local $4 i64) - (set_local $4 - (i64.load offset=16 - (get_local $2) - ) - ) - (block $label$0 - (br_if $label$0 - (i64.ne - (tee_local $3 - (i64.load offset=8 - (get_local $2) - ) - ) - (i64.load - (i32.add - (get_local $0) - (i32.const 56) - ) - ) - ) - ) - (br_if $label$0 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - ) - (call $_ZN5eosio12market_state12cover_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetE - (get_local $0) - (get_local $1) - (i32.add - (get_local $0) - (i32.const 280) - ) - (i32.add - (get_local $0) - (i32.const 48) - ) - (get_local $2) - ) - (return) - ) - (block $label$1 - (br_if $label$1 - (i64.ne - (get_local $3) - (i64.load - (i32.add - (get_local $0) - (i32.const 152) - ) - ) - ) - ) - (br_if $label$1 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (get_local $0) - (i32.const 160) - ) - ) - ) - ) - (call $_ZN5eosio12market_state12cover_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetE - (get_local $0) - (get_local $1) - (i32.add - (get_local $0) - (i32.const 320) - ) - (i32.add - (get_local $0) - (i32.const 144) - ) - (get_local $2) - ) - (return) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1376) - ) - ) - (func $_ZN5eosio12market_state12cover_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetE (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i32) (param $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 i64) - (local $13 i64) - (local $14 i64) - (local $15 f64) - (local $16 i32) - (local $17 i32) - (local $18 f64) - (local $19 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $19 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 704) - ) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $17 - (i32.load - (i32.add - (get_local $2) - (i32.const 28) - ) - ) - ) - (tee_local $10 - (i32.load offset=24 - (get_local $2) - ) - ) - ) - ) - (set_local $16 - (i32.add - (get_local $17) - (i32.const -24) - ) - ) - (set_local $5 - (i32.sub - (i32.const 0) - (get_local $10) - ) - ) - (loop $label$1 - (br_if $label$0 - (i64.eq - (i64.load - (i32.load - (get_local $16) - ) - ) - (get_local $1) - ) - ) - (set_local $17 - (get_local $16) - ) - (set_local $16 - (tee_local $6 - (i32.add - (get_local $16) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $6) - (get_local $5) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $17) - (get_local $10) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (tee_local $16 - (i32.load - (i32.add - (get_local $17) - (i32.const -24) - ) - ) - ) - ) - (get_local $2) - ) - (i32.const 224) - ) - (br $label$2) - ) - (set_local $16 - (i32.const 0) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $6 - (call $db_find_i64 - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (get_local $2) - ) - (i64.const -7949197150146002944) - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (tee_local $16 - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorEl - (get_local $2) - (get_local $6) - ) - ) - ) - (get_local $2) - ) - (i32.const 224) - ) - ) - (call $eosio_assert - (tee_local $7 - (i32.ne - (get_local $16) - (i32.const 0) - ) - ) - (i32.const 1408) - ) - (call $eosio_assert - (i64.ge_s - (i64.load offset=8 - (get_local $16) - ) - (i64.load - (get_local $4) - ) - ) - (i32.const 1440) - ) - (drop - (call $memcpy - (i32.add - (get_local $19) - (i32.const 360) - ) - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (i32.const 232) - ) - ) - (i64.store - (tee_local $8 - (i32.add - (i32.add - (get_local $19) - (i32.const 312) - ) - (i32.const 16) - ) - ) - (i64.load - (tee_local $17 - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - ) - (i64.store - (tee_local $9 - (i32.add - (i32.add - (get_local $19) - (i32.const 312) - ) - (i32.const 8) - ) - ) - (i64.load - (tee_local $5 - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - ) - (i64.store offset=312 - (get_local $19) - (i64.load - (get_local $4) - ) - ) - (set_local $14 - (i64.load - (tee_local $10 - (i32.add - (get_local $16) - (i32.const 48) - ) - ) - ) - ) - (i64.store offset=296 - (get_local $19) - (i64.load - (tee_local $11 - (i32.add - (get_local $16) - (i32.const 40) - ) - ) - ) - ) - (i64.store offset=304 - (get_local $19) - (get_local $14) - ) - (i64.store - (i32.add - (i32.add - (get_local $19) - (i32.const 120) - ) - (i32.const 16) - ) - (i64.load - (get_local $8) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $19) - (i32.const 120) - ) - (i32.const 8) - ) - (i64.load - (get_local $9) - ) - ) - (i64.store offset=120 - (get_local $19) - (i64.load offset=312 - (get_local $19) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $19) - (i32.const 104) - ) - (i32.const 8) - ) - (i64.load offset=304 - (get_local $19) - ) - ) - (i64.store offset=104 - (get_local $19) - (i64.load offset=296 - (get_local $19) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (i32.add - (get_local $19) - (i32.const 336) - ) - (i32.add - (get_local $19) - (i32.const 360) - ) - (i32.add - (get_local $19) - (i32.const 120) - ) - (i32.add - (get_local $19) - (i32.const 104) - ) - ) - (i64.store - (tee_local $8 - (i32.add - (i32.add - (get_local $19) - (i32.const 248) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $19) - (i32.const 336) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (tee_local $9 - (i32.add - (i32.add - (get_local $19) - (i32.const 248) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $19) - (i32.const 336) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=248 - (get_local $19) - (i64.load offset=336 - (get_local $19) - ) - ) - (set_local $14 - (i64.load - (get_local $17) - ) - ) - (i64.store offset=232 - (get_local $19) - (i64.load - (get_local $5) - ) - ) - (i64.store offset=240 - (get_local $19) - (get_local $14) - ) - (i64.store - (i32.add - (i32.add - (get_local $19) - (i32.const 80) - ) - (i32.const 16) - ) - (i64.load - (get_local $8) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $19) - (i32.const 80) - ) - (i32.const 8) - ) - (i64.load - (get_local $9) - ) - ) - (i64.store offset=80 - (get_local $19) - (i64.load offset=248 - (get_local $19) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $19) - (i32.const 64) - ) - (i32.const 8) - ) - (i64.load offset=240 - (get_local $19) - ) - ) - (i64.store offset=64 - (get_local $19) - (i64.load offset=232 - (get_local $19) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (i32.add - (get_local $19) - (i32.const 272) - ) - (get_local $6) - (i32.add - (get_local $19) - (i32.const 80) - ) - (i32.add - (get_local $19) - (i32.const 64) - ) - ) - (call $eosio_assert - (i64.ge_s - (tee_local $14 - (i64.load offset=272 - (get_local $19) - ) - ) - (i64.load - (get_local $4) - ) - ) - (i32.const 1488) - ) - (call $eosio_assert - (i64.eq - (tee_local $12 - (i64.load offset=288 - (get_local $19) - ) - ) - (i64.load - (get_local $17) - ) - ) - (i32.const 800) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $5) - ) - (tee_local $13 - (i64.load offset=280 - (get_local $19) - ) - ) - ) - (i32.const 816) - ) - (call $eosio_assert - (i64.gt_s - (tee_local $14 - (i64.sub - (get_local $14) - (i64.load - (get_local $4) - ) - ) - ) - (i64.const -4611686018427387904) - ) - (i32.const 864) - ) - (call $eosio_assert - (i64.lt_s - (get_local $14) - (i64.const 4611686018427387904) - ) - (i32.const 896) - ) - (i64.store offset=192 - (get_local $19) - (get_local $13) - ) - (i64.store offset=184 - (get_local $19) - (get_local $14) - ) - (i64.store offset=200 - (get_local $19) - (get_local $12) - ) - (i64.store offset=176 - (get_local $19) - (i64.load - (get_local $10) - ) - ) - (i64.store offset=168 - (get_local $19) - (i64.load - (get_local $11) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $19) - (i32.const 40) - ) - (i32.const 8) - ) - (i64.load offset=192 - (get_local $19) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $19) - (i32.const 40) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (i32.add - (get_local $19) - (i32.const 184) - ) - (i32.const 20) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $19) - (i32.const 40) - ) - (i32.const 16) - ) - (i32.load offset=200 - (get_local $19) - ) - ) - (i64.store offset=40 - (get_local $19) - (i64.load offset=184 - (get_local $19) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $19) - (i32.const 24) - ) - (i32.const 8) - ) - (i64.load offset=176 - (get_local $19) - ) - ) - (i64.store offset=24 - (get_local $19) - (i64.load offset=168 - (get_local $19) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (i32.add - (get_local $19) - (i32.const 208) - ) - (get_local $6) - (i32.add - (get_local $19) - (i32.const 40) - ) - (i32.add - (get_local $19) - (i32.const 24) - ) - ) - (i64.store offset=336 - (get_local $19) - (tee_local $14 - (i64.sub - (i64.load offset=336 - (get_local $19) - ) - (i64.load offset=208 - (get_local $19) - ) - ) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i64.ne - (i64.load offset=8 - (get_local $16) - ) - (i64.load - (get_local $4) - ) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $10) - ) - (i64.load offset=352 - (get_local $19) - ) - ) - (i32.const 800) - ) - (set_local $13 - (i64.load offset=32 - (get_local $16) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=344 - (get_local $19) - ) - (tee_local $12 - (i64.load - (get_local $11) - ) - ) - ) - (i32.const 816) - ) - (call $eosio_assert - (i64.gt_s - (tee_local $14 - (i64.sub - (get_local $13) - (get_local $14) - ) - ) - (i64.const -4611686018427387904) - ) - (i32.const 864) - ) - (call $eosio_assert - (i64.lt_s - (get_local $14) - (i64.const 4611686018427387904) - ) - (i32.const 896) - ) - (set_local $13 - (i64.load - (get_local $10) - ) - ) - (call $eosio_assert - (get_local $7) - (i32.const 928) - ) - (call $eosio_assert - (get_local $7) - (i32.const 1152) - ) - (block $label$6 - (br_if $label$6 - (i32.lt_s - (tee_local $6 - (call $db_next_i64 - (i32.load offset=68 - (get_local $16) - ) - (i32.add - (get_local $19) - (i32.const 592) - ) - ) - ) - (i32.const 0) - ) - ) - (drop - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorEl - (get_local $2) - (get_local $6) - ) - ) - ) - (call $_ZN5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5eraseERKS1_ - (get_local $2) - (get_local $16) - ) - (set_local $16 - (i32.const 0) - ) - (block $label$7 - (br_if $label$7 - (i32.lt_s - (tee_local $6 - (call $db_lowerbound_i64 - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (get_local $2) - ) - (i64.const -7949197150146002944) - (i64.const 0) - ) - ) - (i32.const 0) - ) - ) - (set_local $16 - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorEl - (get_local $2) - (get_local $6) - ) - ) - ) - (i64.store offset=152 - (get_local $19) - (get_local $12) - ) - (set_local $6 - (i32.load offset=440 - (get_local $0) - ) - ) - (i64.store - (i32.add - (get_local $19) - (i32.const 8) - ) - (get_local $12) - ) - (i64.store offset=160 - (get_local $19) - (get_local $13) - ) - (i64.store - (i32.add - (get_local $19) - (i32.const 16) - ) - (get_local $13) - ) - (i64.store offset=144 - (get_local $19) - (get_local $14) - ) - (i64.store - (get_local $19) - (get_local $14) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $6) - (get_local $1) - (get_local $19) - (get_local $19) - ) - (br $label$4) - ) - (call $eosio_assert - (get_local $7) - (i32.const 352) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (get_local $16) - ) - (get_local $2) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $2) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (i64.store offset=32 - (get_local $16) - (tee_local $14 - (i64.sub - (i64.load offset=32 - (get_local $16) - ) - (get_local $14) - ) - ) - ) - (i64.store offset=680 - (get_local $19) - (i64.trunc_u/f64 - (f64.mul - (f64.load - (tee_local $6 - (i32.add - (get_local $16) - (i32.const 56) - ) - ) - ) - (f64.const 1e6) - ) - ) - ) - (set_local $1 - (i64.load - (get_local $16) - ) - ) - (i64.store offset=8 - (get_local $16) - (tee_local $12 - (i64.sub - (i64.load offset=8 - (get_local $16) - ) - (i64.load - (get_local $4) - ) - ) - ) - ) - (f64.store - (get_local $6) - (f64.div - (f64.convert_s/i64 - (get_local $12) - ) - (f64.convert_s/i64 - (get_local $14) - ) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 544) - ) - (i32.store offset=672 - (get_local $19) - (i32.add - (i32.add - (get_local $19) - (i32.const 592) - ) - (i32.const 64) - ) - ) - (i32.store offset=668 - (get_local $19) - (i32.add - (get_local $19) - (i32.const 592) - ) - ) - (i32.store offset=664 - (get_local $19) - (i32.add - (get_local $19) - (i32.const 592) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_15margin_positionE - (i32.add - (get_local $19) - (i32.const 664) - ) - (get_local $16) - ) - ) - (call $db_update_i64 - (i32.load offset=68 - (get_local $16) - ) - (i64.const 0) - (i32.add - (get_local $19) - (i32.const 592) - ) - (i32.const 64) - ) - (block $label$8 - (br_if $label$8 - (i64.lt_u - (get_local $1) - (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 $1) - (i64.const 1) - ) - (i64.gt_u - (get_local $1) - (i64.const -3) - ) - ) - ) - ) - (i64.store offset=696 - (get_local $19) - (i64.trunc_u/f64 - (f64.mul - (f64.load - (get_local $6) - ) - (f64.const 1e6) - ) - ) - ) - (br_if $label$4 - (i32.eqz - (call $memcmp - (i32.add - (get_local $19) - (i32.const 680) - ) - (i32.add - (get_local $19) - (i32.const 696) - ) - (i32.const 8) - ) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.gt_s - (tee_local $6 - (i32.load - (tee_local $17 - (i32.add - (get_local $16) - (i32.const 72) - ) - ) - ) - ) - (i32.const -1) - ) - ) - (i32.store - (get_local $17) - (tee_local $6 - (call $db_idx64_find_primary - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (get_local $2) - ) - (i64.const -7949197150146002944) - (i32.add - (get_local $19) - (i32.const 688) - ) - (get_local $1) - ) - ) - ) - ) - (call $db_idx64_update - (get_local $6) - (i64.const 0) - (i32.add - (get_local $19) - (i32.const 696) - ) - ) - ) - (i64.store - (tee_local $6 - (i32.add - (get_local $3) - (i32.const 56) - ) - ) - (i64.sub - (i64.load - (get_local $6) - ) - (i64.load - (get_local $4) - ) - ) - ) - (block $label$10 - (block $label$11 - (block $label$12 - (br_if $label$12 - (i32.eqz - (get_local $16) - ) - ) - (br_if $label$11 - (i32.eqz - (i32.or - (f64.ge - (tee_local $18 - (f64.load offset=56 - (get_local $16) - ) - ) - (tee_local $15 - (f64.load - (tee_local $16 - (i32.add - (get_local $3) - (i32.const 80) - ) - ) - ) - ) - ) - (i32.or - (f64.ne - (get_local $18) - (get_local $18) - ) - (f64.ne - (get_local $15) - (get_local $15) - ) - ) - ) - ) - ) - (br $label$10) - ) - (set_local $16 - (i32.add - (get_local $3) - (i32.const 80) - ) - ) - (set_local $18 - (f64.const 1797693134862315708145274e284) - ) - ) - (f64.store - (get_local $16) - (get_local $18) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $19) - (i32.const 704) - ) - ) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_15margin_positionE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (get_local $1) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 40) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 48) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 56) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (get_local $0) - ) - (func $_ZN5eosio12market_state13update_marginEyRKNS_14extended_assetES3_ (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i32) - (local $4 i64) - (local $5 i64) - (set_local $5 - (i64.load offset=16 - (get_local $2) - ) - ) - (block $label$0 - (br_if $label$0 - (i64.ne - (tee_local $4 - (i64.load offset=8 - (get_local $2) - ) - ) - (i64.load - (i32.add - (get_local $0) - (i32.const 56) - ) - ) - ) - ) - (br_if $label$0 - (i64.ne - (get_local $5) - (i64.load - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - ) - (call $_ZN5eosio12market_state13adjust_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetESG_ - (get_local $0) - (get_local $1) - (i32.add - (get_local $0) - (i32.const 280) - ) - (i32.add - (get_local $0) - (i32.const 48) - ) - (get_local $2) - (get_local $3) - ) - (return) - ) - (block $label$1 - (br_if $label$1 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (get_local $0) - (i32.const 152) - ) - ) - ) - ) - (br_if $label$1 - (i64.ne - (get_local $5) - (i64.load - (i32.add - (get_local $0) - (i32.const 160) - ) - ) - ) - ) - (call $_ZN5eosio12market_state13adjust_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetESG_ - (get_local $0) - (get_local $1) - (i32.add - (get_local $0) - (i32.const 320) - ) - (i32.add - (get_local $0) - (i32.const 144) - ) - (get_local $2) - (get_local $3) - ) - (return) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1376) - ) - ) - (func $_ZN5eosio12market_state13adjust_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetESG_ (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 f64) - (local $11 i64) - (local $12 f64) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $15 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $14 - (i32.load - (i32.add - (get_local $2) - (i32.const 28) - ) - ) - ) - (tee_local $6 - (i32.load offset=24 - (get_local $2) - ) - ) - ) - ) - (set_local $13 - (i32.add - (get_local $14) - (i32.const -24) - ) - ) - (set_local $7 - (i32.sub - (i32.const 0) - (get_local $6) - ) - ) - (loop $label$1 - (br_if $label$0 - (i64.eq - (i64.load - (i32.load - (get_local $13) - ) - ) - (get_local $1) - ) - ) - (set_local $14 - (get_local $13) - ) - (set_local $13 - (tee_local $8 - (i32.add - (get_local $13) - (i32.const -24) - ) - ) - ) - (br_if $label$1 - (i32.ne - (i32.add - (get_local $8) - (get_local $7) - ) - (i32.const -24) - ) - ) - ) - ) - (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.eq - (get_local $14) - (get_local $6) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (tee_local $8 - (i32.load - (i32.add - (get_local $14) - (i32.const -24) - ) - ) - ) - ) - (get_local $2) - ) - (i32.const 224) - ) - (br_if $label$7 - (get_local $8) - ) - (br $label$6) - ) - (br_if $label$6 - (i32.lt_s - (tee_local $13 - (call $db_find_i64 - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (get_local $2) - ) - (i64.const -7949197150146002944) - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (tee_local $8 - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorEl - (get_local $2) - (get_local $13) - ) - ) - ) - (get_local $2) - ) - (i32.const 224) - ) - ) - (br_if $label$5 - (i64.ne - (i64.load offset=8 - (get_local $8) - ) - (i64.sub - (i64.const 0) - (i64.load - (get_local $4) - ) - ) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=32 - (get_local $8) - ) - (i64.sub - (i64.const 0) - (i64.load - (get_local $5) - ) - ) - ) - (i32.const 1584) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 928) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1152) - ) - (set_local $13 - (i32.const 0) - ) - (block $label$9 - (br_if $label$9 - (i32.lt_s - (tee_local $14 - (call $db_next_i64 - (i32.load offset=68 - (get_local $8) - ) - (get_local $15) - ) - ) - (i32.const 0) - ) - ) - (drop - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorEl - (get_local $2) - (get_local $14) - ) - ) - ) - (call $_ZN5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE5eraseERKS1_ - (get_local $2) - (get_local $8) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $8 - (call $db_lowerbound_i64 - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (get_local $2) - ) - (i64.const -7949197150146002944) - (i64.const 0) - ) - ) - (i32.const 0) - ) - ) - (set_local $13 - (call $_ZNK5eosio11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS1_yXadL_ZNKS1_8get_callEvEEEEEEEE31load_object_by_primary_iteratorEl - (get_local $2) - (get_local $8) - ) - ) - (br $label$2) - ) - (call $eosio_assert - (i64.gt_s - (i64.load - (get_local $4) - ) - (i64.const 0) - ) - (i32.const 1520) - ) - (call $eosio_assert - (i64.gt_s - (i64.load - (get_local $5) - ) - (i64.const 0) - ) - (i32.const 1552) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $2) - ) - (call $current_receiver) - ) - (i32.const 288) - ) - (set_local $8 - (call $_ZN5eosio15margin_positionC2Ev - (tee_local $13 - (call $_Znwj - (i32.const 80) - ) - ) - ) - ) - (i32.store offset=64 - (get_local $13) - (get_local $2) - ) - (i64.store - (get_local $13) - (get_local $1) - ) - (i32.store - (i32.add - (get_local $13) - (i32.const 28) - ) - (i32.load - (i32.add - (get_local $4) - (i32.const 20) - ) - ) - ) - (i32.store - (i32.add - (get_local $13) - (i32.const 24) - ) - (i32.load - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $13) - (i32.const 20) - ) - (i32.load - (i32.add - (get_local $4) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $13) - (i32.const 16) - ) - (i32.load - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - (i32.store - (i32.add - (get_local $13) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $4) - (i32.const 4) - ) - ) - ) - (i32.store offset=8 - (get_local $13) - (i32.load - (get_local $4) - ) - ) - (i64.store - (i32.add - (get_local $13) - (i32.const 48) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $13) - (i32.const 40) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (i64.store offset=32 - (get_local $13) - (i64.load - (get_local $5) - ) - ) - (f64.store offset=56 - (get_local $13) - (f64.div - (f64.convert_s/i64 - (i64.load offset=8 - (get_local $13) - ) - ) - (f64.convert_s/i64 - (i64.load offset=32 - (get_local $13) - ) - ) - ) - ) - (i32.store offset=80 - (get_local $15) - (i32.add - (get_local $15) - (i32.const 64) - ) - ) - (i32.store offset=76 - (get_local $15) - (get_local $15) - ) - (i32.store offset=72 - (get_local $15) - (get_local $15) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_15margin_positionE - (i32.add - (get_local $15) - (i32.const 72) - ) - (get_local $8) - ) - ) - (i32.store offset=68 - (get_local $13) - (call $db_store_i64 - (i64.load offset=8 - (get_local $2) - ) - (i64.const -7949197150146002944) - (get_local $1) - (tee_local $9 - (i64.load - (get_local $13) - ) - ) - (get_local $15) - (i32.const 64) - ) - ) - (block $label$10 - (br_if $label$10 - (i64.lt_u - (get_local $9) - (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 $9) - (i64.const 1) - ) - (i64.gt_u - (get_local $9) - (i64.const -3) - ) - ) - ) - ) - (set_local $9 - (i64.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (set_local $11 - (i64.load - (get_local $13) - ) - ) - (i64.store offset=104 - (get_local $15) - (i64.trunc_u/f64 - (f64.mul - (f64.load - (i32.add - (get_local $13) - (i32.const 56) - ) - ) - (f64.const 1e6) - ) - ) - ) - (i32.store offset=72 - (get_local $13) - (call $db_idx64_store - (get_local $9) - (i64.const -7949197150146002944) - (get_local $1) - (get_local $11) - (i32.add - (get_local $15) - (i32.const 104) - ) - ) - ) - (i32.store offset=72 - (get_local $15) - (get_local $13) - ) - (i64.store - (get_local $15) - (tee_local $1 - (i64.load - (get_local $13) - ) - ) - ) - (i32.store offset=104 - (get_local $15) - (tee_local $14 - (i32.load - (i32.add - (get_local $13) - (i32.const 68) - ) - ) - ) - ) - (br_if $label$4 - (i32.ge_u - (tee_local $8 - (i32.load - (i32.add - (get_local $2) - (i32.const 28) - ) - ) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $8) - (get_local $1) - ) - (i32.store offset=16 - (get_local $8) - (get_local $14) - ) - (i32.store offset=72 - (get_local $15) - (i32.const 0) - ) - (i32.store - (get_local $8) - (get_local $13) - ) - (i32.store - (i32.add - (get_local $2) - (i32.const 28) - ) - (i32.add - (get_local $8) - (i32.const 24) - ) - ) - (br $label$3) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 352) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=64 - (get_local $8) - ) - (get_local $2) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $2) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (i64.store offset=88 - (get_local $15) - (i64.trunc_u/f64 - (f64.mul - (f64.load - (tee_local $13 - (i32.add - (get_local $8) - (i32.const 56) - ) - ) - ) - (f64.const 1e6) - ) - ) - ) - (set_local $1 - (i64.load - (get_local $8) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $4) - ) - (i64.load - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - (i32.const 1632) - ) - (i64.store offset=8 - (get_local $8) - (tee_local $9 - (i64.add - (i64.load offset=8 - (get_local $8) - ) - (i64.load - (get_local $4) - ) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $9) - (i64.const -4611686018427387904) - ) - (i32.const 1680) - ) - (call $eosio_assert - (i64.lt_s - (i64.load offset=8 - (get_local $8) - ) - (i64.const 4611686018427387904) - ) - (i32.const 1712) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $5) - ) - (i64.load - (i32.add - (get_local $8) - (i32.const 40) - ) - ) - ) - (i32.const 1632) - ) - (i64.store offset=32 - (get_local $8) - (tee_local $9 - (i64.add - (i64.load offset=32 - (get_local $8) - ) - (i64.load - (get_local $5) - ) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $9) - (i64.const -4611686018427387904) - ) - (i32.const 1680) - ) - (call $eosio_assert - (i64.lt_s - (i64.load offset=32 - (get_local $8) - ) - (i64.const 4611686018427387904) - ) - (i32.const 1712) - ) - (f64.store - (get_local $13) - (f64.div - (f64.convert_s/i64 - (i64.load offset=8 - (get_local $8) - ) - ) - (f64.convert_s/i64 - (i64.load offset=32 - (get_local $8) - ) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $1) - (i64.load - (get_local $8) - ) - ) - (i32.const 544) - ) - (i32.store offset=80 - (get_local $15) - (i32.add - (get_local $15) - (i32.const 64) - ) - ) - (i32.store offset=76 - (get_local $15) - (get_local $15) - ) - (i32.store offset=72 - (get_local $15) - (get_local $15) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_15margin_positionE - (i32.add - (get_local $15) - (i32.const 72) - ) - (get_local $8) - ) - ) - (call $db_update_i64 - (i32.load offset=68 - (get_local $8) - ) - (i64.const 0) - (get_local $15) - (i32.const 64) - ) - (block $label$11 - (br_if $label$11 - (i64.lt_u - (get_local $1) - (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 $1) - (i64.const 1) - ) - (i64.gt_u - (get_local $1) - (i64.const -3) - ) - ) - ) - ) - (i64.store offset=104 - (get_local $15) - (i64.trunc_u/f64 - (f64.mul - (f64.load - (get_local $13) - ) - (f64.const 1e6) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (call $memcmp - (i32.add - (get_local $15) - (i32.const 88) - ) - (i32.add - (get_local $15) - (i32.const 104) - ) - (i32.const 8) - ) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.gt_s - (tee_local $13 - (i32.load - (tee_local $14 - (i32.add - (get_local $8) - (i32.const 72) - ) - ) - ) - ) - (i32.const -1) - ) - ) - (i32.store - (get_local $14) - (tee_local $13 - (call $db_idx64_find_primary - (i64.load - (get_local $2) - ) - (i64.load offset=8 - (get_local $2) - ) - (i64.const -7949197150146002944) - (i32.add - (get_local $15) - (i32.const 96) - ) - (get_local $1) - ) - ) - ) - ) - (call $db_idx64_update - (get_local $13) - (i64.const 0) - (i32.add - (get_local $15) - (i32.const 104) - ) - ) - ) - (set_local $13 - (get_local $8) - ) - (br $label$2) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy10497546923563548672ENS1_15margin_positionEJNS1_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS3_yXadL_ZNKS3_8get_callEvEEEEEEEE8item_ptrENS_9allocatorISB_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINSA_4itemENS_14default_deleteISH_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $2) - (i32.const 24) - ) - (i32.add - (get_local $15) - (i32.const 72) - ) - (get_local $15) - (i32.add - (get_local $15) - (i32.const 104) - ) - ) - ) - (set_local $8 - (i32.load offset=72 - (get_local $15) - ) - ) - (i32.store offset=72 - (get_local $15) - (i32.const 0) - ) - (br_if $label$2 - (i32.eqz - (get_local $8) - ) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $4) - ) - (i64.load - (i32.add - (get_local $3) - (i32.const 64) - ) - ) - ) - (i32.const 1632) - ) - (i64.store - (tee_local $8 - (i32.add - (get_local $3) - (i32.const 56) - ) - ) - (tee_local $1 - (i64.add - (i64.load - (get_local $8) - ) - (i64.load - (get_local $4) - ) - ) - ) - ) - (call $eosio_assert - (i64.gt_s - (get_local $1) - (i64.const -4611686018427387904) - ) - (i32.const 1680) - ) - (call $eosio_assert - (i64.lt_s - (i64.load - (get_local $8) - ) - (i64.const 4611686018427387904) - ) - (i32.const 1712) - ) - (call $eosio_assert - (i64.le_s - (i64.load - (get_local $8) - ) - (i64.load offset=32 - (get_local $3) - ) - ) - (i32.const 1744) - ) - (block $label$14 - (block $label$15 - (br_if $label$15 - (i32.eqz - (get_local $13) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.or - (f64.ge - (tee_local $10 - (f64.load offset=56 - (get_local $13) - ) - ) - (tee_local $12 - (f64.load - (tee_local $13 - (i32.add - (get_local $3) - (i32.const 80) - ) - ) - ) - ) - ) - (i32.or - (f64.ne - (get_local $10) - (get_local $10) - ) - (f64.ne - (get_local $12) - (get_local $12) - ) - ) - ) - ) - (f64.store - (get_local $13) - (get_local $10) - ) - ) - (call $eosio_assert - (i32.xor - (call $_ZNK5eosio14exchange_state20requires_margin_callERKNS0_9connectorE - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $3) - ) - (i32.const 1) - ) - (i32.const 1792) - ) - (br $label$14) - ) - (i64.store - (i32.add - (get_local $3) - (i32.const 80) - ) - (i64.const 9218868437227405311) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $15) - (i32.const 112) - ) - ) - ) - (func $_ZN5eosio12market_state4saveEv (param $0 i32) - (local $1 i64) - (local $2 i32) - (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 240) - ) - ) - ) - (call $eosio_assert - (i32.ne - (tee_local $2 - (i32.load - (i32.add - (get_local $0) - (i32.const 448) - ) - ) - ) - (i32.const 0) - ) - (i32.const 352) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=232 - (get_local $2) - ) - (i32.add - (get_local $0) - (i32.const 240) - ) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=240 - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (set_local $1 - (i64.load - (tee_local $3 - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - ) - (drop - (call $memcpy - (get_local $2) - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.const 232) - ) - ) - (call $eosio_assert - (i64.eq - (tee_local $1 - (i64.shr_u - (get_local $1) - (i64.const 8) - ) - ) - (i64.shr_u - (i64.load - (get_local $3) - ) - (i64.const 8) - ) - ) - (i32.const 544) - ) - (i32.store offset=232 - (get_local $4) - (i32.add - (get_local $4) - (i32.const 220) - ) - ) - (i32.store offset=228 - (get_local $4) - (get_local $4) - ) - (i32.store offset=224 - (get_local $4) - (get_local $4) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_14exchange_stateE - (i32.add - (get_local $4) - (i32.const 224) - ) - (get_local $2) - ) - ) - (call $db_update_i64 - (i32.load offset=236 - (get_local $2) - ) - (i64.const 0) - (get_local $4) - (i32.const 220) - ) - (block $label$0 - (br_if $label$0 - (i64.lt_u - (get_local $1) - (i64.load - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 256) - ) - ) - ) - ) - ) - (i64.store - (get_local $0) - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $4) - (i32.const 240) - ) - ) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_14exchange_stateE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (get_local $1) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 3) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_14exchange_state9connectorE - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_14exchange_state9connectorE - (get_local $0) - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (i32.add - (get_local $1) - (i32.const 136) - ) - ) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_14exchange_state9connectorE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (get_local $1) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 3) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 40) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 48) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 56) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 64) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 72) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 80) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 88) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (get_local $0) - ) - (func $_ZN5eosio8exchange7depositEyNS_14extended_assetE (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $11 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 128) - ) - ) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (i64.load - (get_local $2) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $8 - (i64.shr_u - (i64.load offset=8 - (get_local $2) - ) - (i64.const 8) - ) - ) - (set_local $6 - (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 $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 $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $4 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 1840) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 20) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 16) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 8) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i32.store offset=108 - (get_local $11) - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (i32.store offset=104 - (get_local $11) - (i32.load - (get_local $2) - ) - ) - (set_local $3 - (i64.load - (get_local $0) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=88 - (get_local $11) - (i64.const 0) - ) - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.ge_u - (tee_local $6 - (call $strlen - (i32.const 1872) - ) - ) - (i32.const -16) - ) - ) - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.ge_u - (get_local $6) - (i32.const 11) - ) - ) - (i32.store8 offset=88 - (get_local $11) - (i32.shl - (get_local $6) - (i32.const 1) - ) - ) - (set_local $4 - (i32.or - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.const 1) - ) - ) - (br_if $label$8 - (get_local $6) - ) - (br $label$7) - ) - (set_local $4 - (call $_Znwj - (tee_local $5 - (i32.and - (i32.add - (get_local $6) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=88 - (get_local $11) - (i32.or - (get_local $5) - (i32.const 1) - ) - ) - (i32.store offset=96 - (get_local $11) - (get_local $4) - ) - (i32.store offset=92 - (get_local $11) - (get_local $6) - ) - ) - (drop - (call $memcpy - (get_local $4) - (i32.const 1872) - (get_local $6) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $4) - (get_local $6) - ) - (i32.const 0) - ) - (set_local $8 - (i64.const 0) - ) - (set_local $7 - (i64.const 59) - ) - (set_local $6 - (i32.const 1888) - ) - (set_local $9 - (i64.const 0) - ) - (loop $label$10 - (block $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (br_if $label$15 - (i64.gt_u - (get_local $8) - (i64.const 5) - ) - ) - (br_if $label$14 - (i32.gt_u - (i32.and - (i32.add - (tee_local $4 - (i32.load8_s - (get_local $6) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 165) - ) - ) - (br $label$13) - ) - (set_local $10 - (i64.const 0) - ) - (br_if $label$12 - (i64.le_u - (get_local $8) - (i64.const 11) - ) - ) - (br $label$11) - ) - (set_local $4 - (select - (i32.add - (get_local $4) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $4) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $10 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $4) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $10 - (i64.shl - (i64.and - (get_local $10) - (i64.const 31) - ) - (i64.and - (get_local $7) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (set_local $8 - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - (set_local $9 - (i64.or - (get_local $10) - (get_local $9) - ) - ) - (br_if $label$10 - (i64.ne - (tee_local $7 - (i64.add - (get_local $7) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=24 - (get_local $11) - (i64.load offset=104 - (get_local $11) - ) - ) - (call $_ZN5eosio8currency15inline_transferEyyNS_14extended_assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEy - (get_local $1) - (get_local $3) - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.add - (get_local $11) - (i32.const 88) - ) - (get_local $9) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (i32.and - (i32.load8_u offset=88 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=96 - (get_local $11) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 64) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 64) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i64.store offset=64 - (get_local $11) - (i64.load - (get_local $2) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 48) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=48 - (get_local $11) - (i64.const 0) - ) - (br_if $label$5 - (i32.ge_u - (tee_local $6 - (call $strlen - (i32.const 1872) - ) - ) - (i32.const -16) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (block $label$17 - (block $label$18 - (block $label$19 - (br_if $label$19 - (i32.ge_u - (get_local $6) - (i32.const 11) - ) - ) - (i32.store8 offset=48 - (get_local $11) - (i32.shl - (get_local $6) - (i32.const 1) - ) - ) - (set_local $4 - (i32.or - (i32.add - (get_local $11) - (i32.const 48) - ) - (i32.const 1) - ) - ) - (br_if $label$18 - (get_local $6) - ) - (br $label$17) - ) - (set_local $4 - (call $_Znwj - (tee_local $0 - (i32.and - (i32.add - (get_local $6) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=48 - (get_local $11) - (i32.or - (get_local $0) - (i32.const 1) - ) - ) - (i32.store offset=56 - (get_local $11) - (get_local $4) - ) - (i32.store offset=52 - (get_local $11) - (get_local $6) - ) - ) - (drop - (call $memcpy - (get_local $4) - (i32.const 1872) - (get_local $6) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $4) - (get_local $6) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $11) - (i32.const 64) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $11) - (i32.const 64) - ) - (i32.const 8) - ) - ) - ) - (i64.store - (get_local $11) - (i64.load offset=64 - (get_local $11) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $2) - (get_local $1) - (get_local $11) - (get_local $6) - ) - (block $label$20 - (br_if $label$20 - (i32.eqz - (i32.and - (i32.load8_u offset=48 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=56 - (get_local $11) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 128) - ) - ) - (return) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $11) - (i32.const 88) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $11) - (i32.const 48) - ) - ) - (unreachable) - ) - (func $_ZN5eosio8currency15inline_transferEyyNS_14extended_assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEy (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (param $4 i64) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i64) - (local $12 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $12 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (set_local $5 - (i64.load offset=16 - (get_local $2) - ) - ) - (set_local $9 - (i64.const 0) - ) - (set_local $8 - (i64.const 59) - ) - (set_local $7 - (i32.const 1904) - ) - (set_local $10 - (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 $9) - (i64.const 7) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $6 - (i32.load8_s - (get_local $7) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $11 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $9) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $6 - (select - (i32.add - (get_local $6) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $6) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $11 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $6) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $11 - (i64.shl - (i64.and - (get_local $11) - (i64.const 31) - ) - (i64.and - (get_local $8) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (set_local $9 - (i64.add - (get_local $9) - (i64.const 1) - ) - ) - (set_local $10 - (i64.or - (get_local $11) - (get_local $10) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $8 - (i64.add - (get_local $8) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 28) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 24) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (i64.store offset=16 - (get_local $12) - (get_local $1) - ) - (i64.store offset=8 - (get_local $12) - (get_local $0) - ) - (i32.store offset=24 - (get_local $12) - (i32.load - (get_local $2) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 32) - ) - (get_local $3) - ) - ) - (i64.store offset=64 - (get_local $12) - (get_local $10) - ) - (i64.store offset=56 - (get_local $12) - (get_local $5) - ) - (i64.store - (tee_local $7 - (call $_Znwj - (i32.const 16) - ) - ) - (get_local $0) - ) - (i64.store offset=8 - (get_local $7) - (get_local $4) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 24) - ) - (tee_local $6 - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 20) - ) - (get_local $6) - ) - (i32.store offset=72 - (get_local $12) - (get_local $7) - ) - (i32.store offset=84 - (get_local $12) - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 36) - ) - (i32.const 0) - ) - (set_local $7 - (i32.add - (tee_local $6 - (select - (i32.load - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 36) - ) - ) - (i32.shr_u - (tee_local $7 - (i32.load8_u offset=40 - (get_local $12) - ) - ) - (i32.const 1) - ) - (i32.and - (get_local $7) - (i32.const 1) - ) - ) - ) - (i32.const 32) - ) - ) - (set_local $9 - (i64.extend_u/i32 - (get_local $6) - ) - ) - (set_local $6 - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 28) - ) - ) - (loop $label$6 - (set_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $9 - (i64.shr_u - (get_local $9) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$7 - (block $label$8 - (br_if $label$8 - (i32.eqz - (get_local $7) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $6) - (get_local $7) - ) - (set_local $6 - (i32.load - (i32.add - (get_local $12) - (i32.const 88) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $12) - (i32.const 84) - ) - ) - ) - (br $label$7) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $7 - (i32.const 0) - ) - ) - (i32.store offset=100 - (get_local $12) - (get_local $7) - ) - (i32.store offset=96 - (get_local $12) - (get_local $7) - ) - (i32.store offset=104 - (get_local $12) - (get_local $6) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_8currency8transferE - (i32.add - (get_local $12) - (i32.const 96) - ) - (i32.add - (get_local $12) - (i32.const 8) - ) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.and - (i32.load8_u - (i32.add - (get_local $12) - (i32.const 40) - ) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $12) - (i32.const 48) - ) - ) - ) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.add - (get_local $12) - (i32.const 56) - ) - ) - (call $send_inline - (tee_local $7 - (i32.load offset=8 - (get_local $12) - ) - ) - (i32.sub - (i32.load offset=12 - (get_local $12) - ) - (get_local $7) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $7 - (i32.load offset=8 - (get_local $12) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $12) - (get_local $7) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (tee_local $7 - (i32.load offset=84 - (get_local $12) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 88) - ) - (get_local $7) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $7 - (i32.load offset=72 - (get_local $12) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 76) - ) - (get_local $7) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $12) - (i32.const 112) - ) - ) - ) - (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 $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_8currency8transferE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (get_local $1) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE - (get_local $0) - (i32.add - (get_local $1) - (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 608) - ) - (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 608) - ) - (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 608) - ) - (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 608) - ) - (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 608) - ) - (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 608) - ) - (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 608) - ) - (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 608) - ) - (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 608) - ) - (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 $_ZN5eosio8exchange8withdrawEyNS_14extended_assetE (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (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) - ) - ) - ) - (call $require_auth - (get_local $1) - ) - (set_local $9 - (i64.load offset=8 - (get_local $2) - ) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (tee_local $6 - (i64.load - (get_local $2) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $7 - (i64.shr_u - (get_local $9) - (i64.const 8) - ) - ) - (set_local $5 - (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 $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 $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $4 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 1840) - ) - (call $eosio_assert - (i32.xor - (i32.wrap/i64 - (i64.shr_u - (get_local $6) - (i64.const 63) - ) - ) - (i32.const 1) - ) - (i32.const 1920) - ) - (i64.store offset=96 - (get_local $10) - (get_local $9) - ) - (set_local $7 - (i64.load offset=16 - (get_local $2) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.const 8) - ) - (get_local $9) - ) - (i64.store offset=104 - (get_local $10) - (get_local $7) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.const 16) - ) - (get_local $7) - ) - (i64.store offset=88 - (get_local $10) - (tee_local $7 - (i64.sub - (i64.const 0) - (get_local $6) - ) - ) - ) - (i64.store offset=24 - (get_local $10) - (get_local $7) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (i32.add - (get_local $0) - (i32.const 16) - ) - (get_local $1) - (i32.add - (get_local $10) - (i32.const 24) - ) - (get_local $5) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 64) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 20) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 64) - ) - (i32.const 16) - ) - (i32.load offset=16 - (get_local $2) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 64) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 64) - ) - (i32.const 8) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i32.store offset=68 - (get_local $10) - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (i32.store offset=64 - (get_local $10) - (i32.load - (get_local $2) - ) - ) - (set_local $3 - (i64.load - (get_local $0) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 48) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=48 - (get_local $10) - (i64.const 0) - ) - (block $label$5 - (br_if $label$5 - (i32.ge_u - (tee_local $5 - (call $strlen - (i32.const 1968) - ) - ) - (i32.const -16) - ) - ) - (block $label$6 - (block $label$7 - (block $label$8 - (br_if $label$8 - (i32.ge_u - (get_local $5) - (i32.const 11) - ) - ) - (i32.store8 offset=48 - (get_local $10) - (i32.shl - (get_local $5) - (i32.const 1) - ) - ) - (set_local $2 - (i32.or - (i32.add - (get_local $10) - (i32.const 48) - ) - (i32.const 1) - ) - ) - (br_if $label$7 - (get_local $5) - ) - (br $label$6) - ) - (set_local $2 - (call $_Znwj - (tee_local $4 - (i32.and - (i32.add - (get_local $5) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=48 - (get_local $10) - (i32.or - (get_local $4) - (i32.const 1) - ) - ) - (i32.store offset=56 - (get_local $10) - (get_local $2) - ) - (i32.store offset=52 - (get_local $10) - (get_local $5) - ) - ) - (drop - (call $memcpy - (get_local $2) - (i32.const 1968) - (get_local $5) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $2) - (get_local $5) - ) - (i32.const 0) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 1888) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$9 - (block $label$10 - (block $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (br_if $label$14 - (i64.gt_u - (get_local $7) - (i64.const 5) - ) - ) - (br_if $label$13 - (i32.gt_u - (i32.and - (i32.add - (tee_local $2 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 165) - ) - ) - (br $label$12) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$11 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$10) - ) - (set_local $2 - (select - (i32.add - (get_local $2) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $2) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $2) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$9 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 64) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 64) - ) - (i32.const 8) - ) - ) - ) - (i64.store - (get_local $10) - (i64.load offset=64 - (get_local $10) - ) - ) - (call $_ZN5eosio8currency15inline_transferEyyNS_14extended_assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEy - (get_local $3) - (get_local $1) - (get_local $10) - (i32.add - (get_local $10) - (i32.const 48) - ) - (get_local $8) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (i32.and - (i32.load8_u offset=48 - (get_local $10) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=56 - (get_local $10) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 112) - ) - ) - (return) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $10) - (i32.const 48) - ) - ) - (unreachable) - ) - (func $_ZN5eosio8exchange2onERKNS0_5tradeE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i64) - (local $14 i64) - (local $15 i64) - (local $16 i64) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - (local $23 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $23 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 1008) - ) - ) - ) - (call $require_auth - (i64.load - (get_local $1) - ) - ) - (set_local $3 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - (set_local $21 - (i32.const 0) - ) - (set_local $22 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (i64.load offset=16 - (get_local $1) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $4 - (i64.shr_u - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - (i64.const 8) - ) - ) - (set_local $20 - (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 $4) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $20 - (i32.add - (get_local $20) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $22 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $20 - (i32.add - (get_local $20) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $22 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $22) - (i32.const 1984) - ) - (call $eosio_assert - (i64.gt_s - (i64.load - (get_local $3) - ) - (i64.const 0) - ) - (i32.const 2016) - ) - (block $label$5 - (br_if $label$5 - (i64.gt_u - (i64.add - (i64.load offset=40 - (get_local $1) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $4 - (i64.shr_u - (i64.load - (i32.add - (get_local $1) - (i32.const 48) - ) - ) - (i64.const 8) - ) - ) - (set_local $20 - (i32.const 0) - ) - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $4) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.ne - (i64.and - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$9 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$9 - (i32.lt_s - (tee_local $20 - (i32.add - (get_local $20) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $21 - (i32.const 1) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $20 - (i32.add - (get_local $20) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$5) - ) - ) - (set_local $21 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $21) - (i32.const 2048) - ) - (call $eosio_assert - (i32.xor - (i32.wrap/i64 - (i64.shr_u - (i64.load - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (i64.const 63) - ) - ) - (i32.const 1) - ) - (i32.const 2080) - ) - (call $eosio_assert - (i32.or - (i64.ne - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - (tee_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 48) - ) - ) - ) - ) - (i64.ne - (i64.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - (tee_local $5 - (i64.load - (i32.add - (get_local $1) - (i32.const 56) - ) - ) - ) - ) - ) - (i32.const 192) - ) - (i64.store offset=552 - (get_local $23) - (i64.shr_u - (i64.load offset=8 - (get_local $1) - ) - (i64.const 8) - ) - ) - (set_local $13 - (i64.load - (get_local $0) - ) - ) - (set_local $20 - (call $_ZN5eosio14exchange_stateC2Ev - (i32.add - (i32.add - (get_local $23) - (i32.const 552) - ) - (i32.const 8) - ) - ) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 808) - ) - (i64.const -1) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 816) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 824) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 800) - ) - (tee_local $14 - (i64.load offset=552 - (get_local $23) - ) - ) - ) - (i64.store offset=792 - (get_local $23) - (get_local $13) - ) - (i64.store offset=832 - (get_local $23) - (get_local $13) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 840) - ) - (tee_local $16 - (i64.or - (tee_local $15 - (i64.shl - (get_local $14) - (i64.const 4) - ) - ) - (i64.const 1) - ) - ) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 848) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 856) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 860) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 864) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $23) - (i32.const 868) - ) - (i32.const 0) - ) - (i64.store offset=872 - (get_local $23) - (get_local $13) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 880) - ) - (tee_local $15 - (i64.or - (get_local $15) - (i64.const 2) - ) - ) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 888) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 896) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 900) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 904) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $23) - (i32.const 908) - ) - (i32.const 0) - ) - (i64.store offset=912 - (get_local $23) - (get_local $13) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 920) - ) - (get_local $16) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 928) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 936) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 940) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 944) - ) - (i32.const 0) - ) - (i64.store offset=952 - (get_local $23) - (get_local $13) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 960) - ) - (get_local $15) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 968) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 976) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 980) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 984) - ) - (i32.const 0) - ) - (i32.store offset=992 - (get_local $23) - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (call $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE4findEy - (i32.add - (get_local $23) - (i32.const 996) - ) - (i32.add - (get_local $23) - (i32.const 792) - ) - (get_local $14) - ) - (call $eosio_assert - (i32.ne - (i32.load - (tee_local $21 - (i32.add - (get_local $23) - (i32.const 1000) - ) - ) - ) - (i32.const 0) - ) - (i32.const 720) - ) - (drop - (call $memcpy - (i32.add - (get_local $23) - (i32.const 320) - ) - (tee_local $2 - (call $memcpy - (get_local $20) - (i32.load - (get_local $21) - ) - (i32.const 232) - ) - ) - (i32.const 232) - ) - ) - (i64.store - (tee_local $20 - (i32.add - (i32.add - (get_local $23) - (i32.const 272) - ) - (i32.const 16) - ) - ) - (i64.load - (tee_local $17 - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - ) - (i64.store - (tee_local $21 - (i32.add - (i32.add - (get_local $23) - (i32.const 272) - ) - (i32.const 8) - ) - ) - (i64.load - (tee_local $18 - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - ) - (i64.store offset=272 - (get_local $23) - (i64.load - (get_local $3) - ) - ) - (i64.store offset=256 - (get_local $23) - (get_local $4) - ) - (i64.store offset=264 - (get_local $23) - (get_local $5) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 104) - ) - (i32.const 8) - ) - (i64.load - (get_local $21) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 104) - ) - (i32.const 16) - ) - (i64.load - (get_local $20) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 88) - ) - (i32.const 8) - ) - (i64.load offset=264 - (get_local $23) - ) - ) - (i64.store offset=104 - (get_local $23) - (i64.load offset=272 - (get_local $23) - ) - ) - (i64.store offset=88 - (get_local $23) - (i64.load offset=256 - (get_local $23) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (i32.add - (get_local $23) - (i32.const 296) - ) - (i32.add - (get_local $23) - (i32.const 320) - ) - (i32.add - (get_local $23) - (i32.const 104) - ) - (i32.add - (get_local $23) - (i32.const 88) - ) - ) - (set_local $12 - (i32.add - (get_local $23) - (i32.const 456) - ) - ) - (set_local $11 - (i32.add - (get_local $23) - (i32.const 872) - ) - ) - (set_local $10 - (i32.add - (get_local $23) - (i32.const 696) - ) - ) - (set_local $9 - (i32.add - (get_local $23) - (i32.const 832) - ) - ) - (set_local $8 - (i32.add - (i32.add - (get_local $23) - (i32.const 552) - ) - (i32.const 48) - ) - ) - (set_local $7 - (i32.add - (i32.add - (get_local $23) - (i32.const 320) - ) - (i32.const 40) - ) - ) - (set_local $19 - (i32.add - (get_local $23) - (i32.const 616) - ) - ) - (block $label$10 - (loop $label$11 - (block $label$12 - (br_if $label$12 - (call $_ZNK5eosio14exchange_state20requires_margin_callERKNS0_9connectorE - (i32.add - (get_local $23) - (i32.const 320) - ) - (get_local $7) - ) - ) - (br_if $label$10 - (i32.eqz - (call $_ZNK5eosio14exchange_state20requires_margin_callERKNS0_9connectorE - (i32.add - (get_local $23) - (i32.const 320) - ) - (get_local $12) - ) - ) - ) - ) - (block $label$13 - (block $label$14 - (br_if $label$14 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 552) - ) - (i32.const 56) - ) - ) - ) - ) - (br_if $label$14 - (i64.ne - (get_local $5) - (i64.load - (get_local $19) - ) - ) - ) - (call $_ZN5eosio12market_state11margin_callERNS_14exchange_state9connectorERNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS5_yXadL_ZNKS5_8get_callEvEEEEEEEEE - (i32.add - (get_local $23) - (i32.const 552) - ) - (get_local $8) - (get_local $9) - ) - (br $label$13) - ) - (call $_ZN5eosio12market_state11margin_callERNS_14exchange_state9connectorERNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS5_yXadL_ZNKS5_8get_callEvEEEEEEEEE - (i32.add - (get_local $23) - (i32.const 552) - ) - (get_local $10) - (get_local $11) - ) - ) - (drop - (call $memcpy - (i32.add - (get_local $23) - (i32.const 320) - ) - (get_local $2) - (i32.const 232) - ) - ) - (i64.store - (tee_local $20 - (i32.add - (i32.add - (get_local $23) - (i32.const 232) - ) - (i32.const 16) - ) - ) - (i64.load - (get_local $17) - ) - ) - (i64.store - (tee_local $21 - (i32.add - (i32.add - (get_local $23) - (i32.const 232) - ) - (i32.const 8) - ) - ) - (i64.load - (get_local $18) - ) - ) - (i64.store offset=232 - (get_local $23) - (i64.load - (get_local $3) - ) - ) - (i64.store offset=216 - (get_local $23) - (get_local $4) - ) - (i64.store - (tee_local $22 - (i32.add - (i32.add - (get_local $23) - (i32.const 216) - ) - (i32.const 8) - ) - ) - (get_local $5) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 16) - ) - (i32.const 8) - ) - (i64.load - (get_local $21) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 16) - ) - (i32.const 16) - ) - (i64.load - (get_local $20) - ) - ) - (i64.store - (i32.add - (get_local $23) - (i32.const 8) - ) - (i64.load - (get_local $22) - ) - ) - (i64.store offset=16 - (get_local $23) - (i64.load offset=232 - (get_local $23) - ) - ) - (i64.store - (get_local $23) - (i64.load offset=216 - (get_local $23) - ) - ) - (call $_ZN5eosio14exchange_state7convertENS_14extended_assetENS_15extended_symbolE - (i32.add - (get_local $23) - (i32.const 128) - ) - (i32.add - (get_local $23) - (i32.const 320) - ) - (i32.add - (get_local $23) - (i32.const 16) - ) - (get_local $23) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 296) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 128) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 296) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 128) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=296 - (get_local $23) - (i64.load offset=128 - (get_local $23) - ) - ) - (br $label$11) - ) - ) - (drop - (call $memcpy - (get_local $2) - (i32.add - (get_local $23) - (i32.const 320) - ) - (i32.const 232) - ) - ) - (call $printn - (i64.load - (get_local $1) - ) - ) - (call $prints - (i32.const 2128) - ) - (call $_ZNK5eosio5asset5printEv - (get_local $3) - ) - (call $prints - (i32.const 1280) - ) - (call $printn - (i64.load - (tee_local $20 - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - ) - (call $prints - (i32.const 2144) - ) - (call $_ZNK5eosio5asset5printEv - (i32.add - (get_local $23) - (i32.const 296) - ) - ) - (call $prints - (i32.const 1280) - ) - (call $printn - (i64.load offset=312 - (get_local $23) - ) - ) - (call $prints - (i32.const 1344) - ) - (block $label$15 - (br_if $label$15 - (i64.eqz - (tee_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - ) - ) - ) - (call $eosio_assert - (i64.le_s - (get_local $4) - (i64.load offset=296 - (get_local $23) - ) - ) - (i32.const 2160) - ) - ) - (i64.store offset=200 - (get_local $23) - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (i64.store offset=192 - (get_local $23) - (i64.sub - (i64.const 0) - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - ) - (set_local $4 - (i64.load - (get_local $1) - ) - ) - (i64.store offset=208 - (get_local $23) - (i64.load - (get_local $20) - ) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 136) - ) - (i32.const 0) - ) - (i64.store offset=128 - (get_local $23) - (i64.const 0) - ) - (block $label$16 - (block $label$17 - (block $label$18 - (br_if $label$18 - (i32.ge_u - (tee_local $20 - (call $strlen - (i32.const 2176) - ) - ) - (i32.const -16) - ) - ) - (block $label$19 - (block $label$20 - (block $label$21 - (br_if $label$21 - (i32.ge_u - (get_local $20) - (i32.const 11) - ) - ) - (i32.store8 offset=128 - (get_local $23) - (i32.shl - (get_local $20) - (i32.const 1) - ) - ) - (set_local $21 - (i32.or - (i32.add - (get_local $23) - (i32.const 128) - ) - (i32.const 1) - ) - ) - (br_if $label$20 - (get_local $20) - ) - (br $label$19) - ) - (set_local $21 - (call $_Znwj - (tee_local $22 - (i32.and - (i32.add - (get_local $20) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=128 - (get_local $23) - (i32.or - (get_local $22) - (i32.const 1) - ) - ) - (i32.store offset=136 - (get_local $23) - (get_local $21) - ) - (i32.store offset=132 - (get_local $23) - (get_local $20) - ) - ) - (drop - (call $memcpy - (get_local $21) - (i32.const 2176) - (get_local $20) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $21) - (get_local $20) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 64) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 192) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 64) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 192) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=64 - (get_local $23) - (i64.load offset=192 - (get_local $23) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $6) - (get_local $4) - (i32.add - (get_local $23) - (i32.const 64) - ) - (get_local $23) - ) - (block $label$22 - (br_if $label$22 - (i32.eqz - (i32.and - (i32.load8_u offset=128 - (get_local $23) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=136 - (get_local $23) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $23) - (i32.const 168) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (i32.add - (get_local $23) - (i32.const 296) - ) - (i32.const 20) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $23) - (i32.const 168) - ) - (i32.const 16) - ) - (i32.load - (i32.add - (i32.add - (get_local $23) - (i32.const 296) - ) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $23) - (i32.const 168) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $23) - (i32.const 296) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $23) - (i32.const 168) - ) - (i32.const 8) - ) - (i32.load - (i32.add - (i32.add - (get_local $23) - (i32.const 296) - ) - (i32.const 8) - ) - ) - ) - (i32.store offset=172 - (get_local $23) - (i32.load offset=300 - (get_local $23) - ) - ) - (i32.store offset=168 - (get_local $23) - (i32.load offset=296 - (get_local $23) - ) - ) - (set_local $4 - (i64.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $23) - (i32.const 128) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=128 - (get_local $23) - (i64.const 0) - ) - (br_if $label$17 - (i32.ge_u - (tee_local $20 - (call $strlen - (i32.const 2192) - ) - ) - (i32.const -16) - ) - ) - (block $label$23 - (block $label$24 - (block $label$25 - (br_if $label$25 - (i32.ge_u - (get_local $20) - (i32.const 11) - ) - ) - (i32.store8 offset=128 - (get_local $23) - (i32.shl - (get_local $20) - (i32.const 1) - ) - ) - (set_local $21 - (i32.or - (i32.add - (get_local $23) - (i32.const 128) - ) - (i32.const 1) - ) - ) - (br_if $label$24 - (get_local $20) - ) - (br $label$23) - ) - (set_local $21 - (call $_Znwj - (tee_local $22 - (i32.and - (i32.add - (get_local $20) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=128 - (get_local $23) - (i32.or - (get_local $22) - (i32.const 1) - ) - ) - (i32.store offset=136 - (get_local $23) - (get_local $21) - ) - (i32.store offset=132 - (get_local $23) - (get_local $20) - ) - ) - (drop - (call $memcpy - (get_local $21) - (i32.const 2192) - (get_local $20) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $21) - (get_local $20) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 40) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 168) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 40) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 168) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=40 - (get_local $23) - (i64.load offset=168 - (get_local $23) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $6) - (get_local $4) - (i32.add - (get_local $23) - (i32.const 40) - ) - (get_local $23) - ) - (block $label$26 - (br_if $label$26 - (i32.eqz - (i32.and - (i32.load8_u offset=128 - (get_local $23) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=136 - (get_local $23) - ) - ) - ) - (block $label$27 - (br_if $label$27 - (i64.eq - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 552) - ) - (i32.const 16) - ) - ) - (i64.load offset=8 - (tee_local $20 - (i32.load - (i32.add - (get_local $23) - (i32.const 1000) - ) - ) - ) - ) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load - (i32.add - (get_local $23) - (i32.const 584) - ) - ) - (i64.load - (i32.add - (get_local $20) - (i32.const 24) - ) - ) - ) - (i32.const 800) - ) - (set_local $4 - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 552) - ) - (i32.const 16) - ) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load - (i32.add - (get_local $20) - (i32.const 16) - ) - ) - (tee_local $5 - (i64.load - (i32.add - (i32.add - (get_local $23) - (i32.const 552) - ) - (i32.const 24) - ) - ) - ) - ) - (i32.const 816) - ) - (call $eosio_assert - (i64.gt_s - (tee_local $4 - (i64.sub - (get_local $4) - (i64.load - (i32.add - (get_local $20) - (i32.const 8) - ) - ) - ) - ) - (i64.const -4611686018427387904) - ) - (i32.const 864) - ) - (call $eosio_assert - (i64.lt_s - (get_local $4) - (i64.const 4611686018427387904) - ) - (i32.const 896) - ) - (i64.store - (i32.add - (i32.add - (get_local $23) - (i32.const 128) - ) - (i32.const 16) - ) - (get_local $5) - ) - (i64.store align=4 - (i32.add - (get_local $23) - (i32.const 156) - ) - (i64.const 0) - ) - (i64.store offset=136 - (get_local $23) - (get_local $4) - ) - (i32.store offset=152 - (get_local $23) - (i32.const 0) - ) - (i64.store offset=128 - (get_local $23) - (i64.load - (get_local $0) - ) - ) - (set_local $21 - (i32.add - (i32.add - (get_local $23) - (i32.const 128) - ) - (i32.const 24) - ) - ) - (br_if $label$16 - (i32.ge_u - (tee_local $20 - (call $strlen - (i32.const 2208) - ) - ) - (i32.const -16) - ) - ) - (set_local $22 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (block $label$28 - (block $label$29 - (block $label$30 - (br_if $label$30 - (i32.ge_u - (get_local $20) - (i32.const 11) - ) - ) - (i32.store8 - (i32.add - (get_local $23) - (i32.const 152) - ) - (i32.shl - (get_local $20) - (i32.const 1) - ) - ) - (set_local $21 - (i32.add - (get_local $21) - (i32.const 1) - ) - ) - (br_if $label$29 - (get_local $20) - ) - (br $label$28) - ) - (set_local $21 - (call $_Znwj - (tee_local $3 - (i32.and - (i32.add - (get_local $20) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 152) - ) - (i32.or - (get_local $3) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 160) - ) - (get_local $21) - ) - (i32.store - (i32.add - (get_local $23) - (i32.const 156) - ) - (get_local $20) - ) - ) - (drop - (call $memcpy - (get_local $21) - (i32.const 2208) - (get_local $20) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $21) - (get_local $20) - ) - (i32.const 0) - ) - (call $_ZN5eosio8currency14issue_currencyERKNS0_5issueE - (get_local $22) - (i32.add - (get_local $23) - (i32.const 128) - ) - ) - (br_if $label$27 - (i32.eqz - (i32.and - (i32.load8_u - (i32.add - (get_local $23) - (i32.const 152) - ) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $23) - (i32.const 160) - ) - ) - ) - ) - (call $_ZN5eosio12market_state4saveEv - (i32.add - (get_local $23) - (i32.const 552) - ) - ) - (drop - (call $_ZN5eosio12market_stateD2Ev - (i32.add - (get_local $23) - (i32.const 552) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $23) - (i32.const 1008) - ) - ) - (return) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $23) - (i32.const 128) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $23) - (i32.const 128) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (get_local $21) - ) - (unreachable) - ) - (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 2352) - ) - (call $prints_l - (get_local $2) - (get_local $3) - ) - (call $prints - (i32.const 2368) - ) - (call $_ZNK5eosio11symbol_type5printEb - (get_local $1) - (i32.const 0) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $10) - ) - ) - (func $_ZN5eosio8currency14issue_currencyERKNS0_5issueE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 80) - ) - ) - ) - (set_local $6 - (i64.load - (tee_local $3 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 72) - ) - (i32.const 0) - ) - (i64.store offset=56 - (get_local $7) - (i64.const -1) - ) - (i64.store offset=64 - (get_local $7) - (i64.const 0) - ) - (i64.store offset=40 - (get_local $7) - (i64.load - (get_local $0) - ) - ) - (i64.store offset=48 - (get_local $7) - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - ) - (set_local $2 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE3getEyPKc - (i32.add - (get_local $7) - (i32.const 40) - ) - (get_local $6) - (i32.const 2224) - ) - ) - (i32.store offset=32 - (get_local $7) - (get_local $1) - ) - (call $_ZN5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE6modifyIZNS1_14issue_currencyERKNS1_5issueEEUlRT_E_EEvRKS2_yOS8_ - (i32.add - (get_local $7) - (i32.const 40) - ) - (get_local $2) - (i64.const 0) - (i32.add - (get_local $7) - (i32.const 32) - ) - ) - (i32.store - (tee_local $4 - (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 12) - ) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - ) - (i32.store - (tee_local $5 - (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.load - (get_local $3) - ) - ) - (i32.store offset=20 - (get_local $7) - (i32.load - (i32.add - (get_local $1) - (i32.const 12) - ) - ) - ) - (i32.store offset=16 - (get_local $7) - (i32.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i64.load offset=32 - (get_local $2) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 12) - ) - (i32.load - (get_local $4) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.load - (get_local $5) - ) - ) - (i32.store offset=4 - (get_local $7) - (i32.load offset=20 - (get_local $7) - ) - ) - (i32.store - (get_local $7) - (i32.load offset=16 - (get_local $7) - ) - ) - (call $_ZN5eosio8currency11add_balanceEyNS_5assetERKNS0_14currency_statsEy - (get_local $0) - (get_local $6) - (get_local $7) - (get_local $2) - (get_local $6) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $0 - (i32.load offset=64 - (get_local $7) - ) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.eq - (tee_local $1 - (i32.load - (tee_local $3 - (i32.add - (get_local $7) - (i32.const 68) - ) - ) - ) - ) - (get_local $0) - ) - ) - (loop $label$3 - (set_local $2 - (i32.load - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (block $label$4 - (br_if $label$4 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$3 - (i32.ne - (get_local $0) - (get_local $1) - ) - ) - ) - (set_local $1 - (i32.load - (i32.add - (get_local $7) - (i32.const 64) - ) - ) - ) - (br $label$1) - ) - (set_local $1 - (get_local $0) - ) - ) - (i32.store - (get_local $3) - (get_local $0) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 80) - ) - ) - ) - (func $_ZN5eosio12market_stateD2Ev (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 424) - ) - ) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.eq - (tee_local $4 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 428) - ) - ) - ) - ) - (get_local $1) - ) - ) - (loop $label$3 - (set_local $2 - (i32.load - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (block $label$4 - (br_if $label$4 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$3 - (i32.ne - (get_local $1) - (get_local $4) - ) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $0) - (i32.const 424) - ) - ) - ) - (br $label$1) - ) - (set_local $4 - (get_local $1) - ) - ) - (i32.store - (get_local $3) - (get_local $1) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 384) - ) - ) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.eq - (tee_local $4 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 388) - ) - ) - ) - ) - (get_local $1) - ) - ) - (loop $label$8 - (set_local $2 - (i32.load - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$8 - (i32.ne - (get_local $1) - (get_local $4) - ) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $0) - (i32.const 384) - ) - ) - ) - (br $label$6) - ) - (set_local $4 - (get_local $1) - ) - ) - (i32.store - (get_local $3) - (get_local $1) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 344) - ) - ) - ) - ) - ) - (block $label$11 - (block $label$12 - (br_if $label$12 - (i32.eq - (tee_local $4 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 348) - ) - ) - ) - ) - (get_local $1) - ) - ) - (loop $label$13 - (set_local $2 - (i32.load - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$13 - (i32.ne - (get_local $1) - (get_local $4) - ) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $0) - (i32.const 344) - ) - ) - ) - (br $label$11) - ) - (set_local $4 - (get_local $1) - ) - ) - (i32.store - (get_local $3) - (get_local $1) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 304) - ) - ) - ) - ) - ) - (block $label$16 - (block $label$17 - (br_if $label$17 - (i32.eq - (tee_local $4 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 308) - ) - ) - ) - ) - (get_local $1) - ) - ) - (loop $label$18 - (set_local $2 - (i32.load - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (block $label$19 - (br_if $label$19 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$18 - (i32.ne - (get_local $1) - (get_local $4) - ) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $0) - (i32.const 304) - ) - ) - ) - (br $label$16) - ) - (set_local $4 - (get_local $1) - ) - ) - (i32.store - (get_local $3) - (get_local $1) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (block $label$20 - (br_if $label$20 - (i32.eqz - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 264) - ) - ) - ) - ) - ) - (block $label$21 - (block $label$22 - (br_if $label$22 - (i32.eq - (tee_local $4 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 268) - ) - ) - ) - ) - (get_local $1) - ) - ) - (loop $label$23 - (set_local $2 - (i32.load - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (block $label$24 - (br_if $label$24 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$23 - (i32.ne - (get_local $1) - (get_local $4) - ) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $0) - (i32.const 264) - ) - ) - ) - (br $label$21) - ) - (set_local $4 - (get_local $1) - ) - ) - (i32.store - (get_local $3) - (get_local $1) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (get_local $0) - ) - (func $_ZNK5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE3getEyPKc (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=48 - (tee_local $6 - (i32.load - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - ) - (get_local $0) - ) - (i32.const 224) - ) - (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=48 - (tee_local $6 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE31load_object_by_primary_iteratorEl - (get_local $0) - (get_local $5) - ) - ) - ) - (get_local $0) - ) - (i32.const 224) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $6) - (i32.const 0) - ) - (get_local $2) - ) - (get_local $6) - ) - (func $_ZN5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE6modifyIZNS1_14issue_currencyERKNS1_5issueEEUlRT_E_EEvRKS2_yOS8_ (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) - (local $4 i64) - (local $5 i64) - (local $6 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $6 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=48 - (get_local $1) - ) - (get_local $0) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (i64.store - (get_local $1) - (tee_local $4 - (i64.add - (i64.load - (get_local $1) - ) - (i64.load offset=8 - (i32.load - (get_local $3) - ) - ) - ) - ) - ) - (set_local $5 - (i64.load offset=8 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.xor - (i32.wrap/i64 - (i64.shr_u - (get_local $4) - (i64.const 63) - ) - ) - (i32.const 1) - ) - (i32.const 1216) - ) - (call $eosio_assert - (i64.eq - (tee_local $4 - (i64.shr_u - (get_local $5) - (i64.const 8) - ) - ) - (i64.shr_u - (i64.load offset=8 - (get_local $1) - ) - (i64.const 8) - ) - ) - (i32.const 544) - ) - (i32.store offset=56 - (get_local $6) - (i32.add - (get_local $6) - (i32.const 45) - ) - ) - (i32.store offset=52 - (get_local $6) - (get_local $6) - ) - (i32.store offset=48 - (get_local $6) - (get_local $6) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_8currency14currency_statsE - (i32.add - (get_local $6) - (i32.const 48) - ) - (get_local $1) - ) - ) - (call $db_update_i64 - (i32.load offset=52 - (get_local $1) - ) - (get_local $2) - (get_local $6) - (i32.const 45) - ) - (block $label$0 - (br_if $label$0 - (i64.lt_u - (get_local $4) - (i64.load offset=16 - (get_local $0) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 64) - ) - ) - ) - (func $_ZN5eosio8currency11add_balanceEyNS_5assetERKNS0_14currency_statsEy (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i32) (param $4 i64) - (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 64) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 56) - ) - (i32.const 0) - ) - (i64.store offset=40 - (get_local $7) - (i64.const -1) - ) - (i64.store offset=48 - (get_local $7) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $7) - (tee_local $5 - (i64.load - (get_local $0) - ) - ) - ) - (i64.store offset=32 - (get_local $7) - (get_local $1) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.le_s - (tee_local $0 - (call $db_find_i64 - (get_local $5) - (get_local $1) - (i64.const 3607749779137757184) - (i64.shr_u - (i64.load offset=8 - (get_local $2) - ) - (i64.const 8) - ) - ) - ) - (i32.const -1) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=20 - (tee_local $0 - (call $_ZNK5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $7) - (i32.const 24) - ) - (get_local $0) - ) - ) - ) - (i32.add - (get_local $7) - (i32.const 24) - ) - ) - (i32.const 224) - ) - (call $eosio_assert - (select - (i32.load8_u offset=17 - (get_local $0) - ) - (i32.const 1) - (i32.load8_u offset=44 - (get_local $3) - ) - ) - (i32.const 2304) - ) - (i32.store offset=8 - (get_local $7) - (get_local $2) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 352) - ) - (call $_ZN5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE6modifyIZNS1_11add_balanceEyNS_5assetERKNS1_14currency_statsEyEUlRT_E0_EEvRKS2_yOS9_ - (i32.add - (get_local $7) - (i32.const 24) - ) - (get_local $0) - (i64.const 0) - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - (br_if $label$1 - (tee_local $3 - (i32.load offset=48 - (get_local $7) - ) - ) - ) - (br $label$0) - ) - (call $eosio_assert - (i32.xor - (i32.load8_u offset=44 - (get_local $3) - ) - (i32.const 1) - ) - (i32.const 2256) - ) - (i32.store offset=16 - (get_local $7) - (get_local $2) - ) - (call $_ZN5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE7emplaceIZNS1_11add_balanceEyNS_5assetERKNS1_14currency_statsEyEUlRT_E_EENS3_14const_iteratorEyOS9_ - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.add - (get_local $7) - (i32.const 24) - ) - (get_local $4) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.load offset=48 - (get_local $7) - ) - ) - ) - ) - ) - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.eq - (tee_local $2 - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const 52) - ) - ) - ) - ) - (get_local $3) - ) - ) - (loop $label$5 - (set_local $0 - (i32.load - (tee_local $2 - (i32.add - (get_local $2) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (block $label$6 - (br_if $label$6 - (i32.eqz - (get_local $0) - ) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (br_if $label$5 - (i32.ne - (get_local $3) - (get_local $2) - ) - ) - ) - (set_local $2 - (i32.load - (i32.add - (get_local $7) - (i32.const 48) - ) - ) - ) - (br $label$3) - ) - (set_local $2 - (get_local $3) - ) - ) - (i32.store - (get_local $6) - (get_local $3) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 64) - ) - ) - ) - (func $_ZN5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE7emplaceIZNS1_11add_balanceEyNS_5assetERKNS1_14currency_statsEyEUlRT_E_EENS3_14const_iteratorEyOS9_ (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 288) - ) - (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=8 - (tee_local $4 - (call $_Znwj - (i32.const 32) - ) - ) - (i64.const 1398362884) - ) - (i64.store - (get_local $4) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (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 80) - ) - (i32.store offset=20 - (get_local $4) - (get_local $1) - ) - (i32.store16 offset=16 - (get_local $4) - (i32.const 256) - ) - (call $_ZZN5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE7emplaceIZNS1_11add_balanceEyNS_5assetERKNS1_14currency_statsEyEUlRT_E_EENS3_14const_iteratorEyOS9_ENKUlSA_E_clINS3_4itemEEEDaSA_ - (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.shr_u - (i64.load - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=12 - (get_local $7) - (tee_local $6 - (i32.load offset=24 - (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_indexILy3607749779137757184ENS1_8currency7accountEJEE8item_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 $_ZNK5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE31load_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 i64) - (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 $6 - (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 $5 - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - (loop $label$1 - (br_if $label$0 - (i32.eq - (i32.load - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - (get_local $1) - ) - ) - (set_local $6 - (get_local $5) - ) - (set_local $5 - (tee_local $4 - (i32.add - (get_local $5) - (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 $6) - (get_local $2) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $6) - (i32.const -24) - ) - ) - ) - (br $label$2) - ) - (call $eosio_assert - (i32.xor - (i32.shr_u - (tee_local $5 - (call $db_get_i64 - (get_local $1) - (i32.const 0) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.const 1) - ) - (i32.const 656) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.lt_u - (get_local $5) - (i32.const 513) - ) - ) - (set_local $4 - (call $malloc - (get_local $5) - ) - ) - (br $label$4) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $4 - (i32.sub - (get_local $9) - (i32.and - (i32.add - (get_local $5) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $db_get_i64 - (get_local $1) - (get_local $4) - (get_local $5) - ) - ) - (i32.store offset=36 - (get_local $8) - (get_local $4) - ) - (i32.store offset=32 - (get_local $8) - (get_local $4) - ) - (i32.store offset=40 - (get_local $8) - (i32.add - (get_local $4) - (get_local $5) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.lt_u - (get_local $5) - (i32.const 513) - ) - ) - (call $free - (get_local $4) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.store offset=8 - (tee_local $4 - (call $_Znwj - (i32.const 32) - ) - ) - (i64.const 1398362884) - ) - (i64.store - (get_local $4) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $7 - (i64.const 5462355) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$7 - (block $label$8 - (loop $label$9 - (br_if $label$8 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $7) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$10 - (br_if $label$10 - (i64.ne - (i64.and - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$11 - (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) - ) - ) - (br_if $label$11 - (i32.lt_s - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $6 - (i32.const 1) - ) - (br_if $label$9 - (i32.lt_s - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$7) - ) - ) - (set_local $6 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 80) - ) - (i32.store offset=20 - (get_local $4) - (get_local $0) - ) - (i32.store16 offset=16 - (get_local $4) - (i32.const 256) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_8currency7accountE - (i32.add - (get_local $8) - (i32.const 32) - ) - (get_local $4) - ) - ) - (i32.store offset=24 - (get_local $4) - (get_local $1) - ) - (i32.store offset=24 - (get_local $8) - (get_local $4) - ) - (i64.store offset=16 - (get_local $8) - (tee_local $7 - (i64.shr_u - (i64.load - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=12 - (get_local $8) - (tee_local $6 - (i32.load offset=24 - (get_local $4) - ) - ) - ) - (block $label$12 - (block $label$13 - (br_if $label$13 - (i32.ge_u - (tee_local $5 - (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 $5) - (get_local $7) - ) - (i32.store offset=16 - (get_local $5) - (get_local $6) - ) - (i32.store offset=24 - (get_local $8) - (i32.const 0) - ) - (i32.store - (get_local $5) - (get_local $4) - ) - (i32.store - (get_local $1) - (i32.add - (get_local $5) - (i32.const 24) - ) - ) - (br $label$12) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy3607749779137757184ENS1_8currency7accountEJEE8item_ptrENS_9allocatorIS6_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS5_4itemENS_14default_deleteISC_EEEERyRlEEEvDpOT_ - (get_local $3) - (i32.add - (get_local $8) - (i32.const 24) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 12) - ) - ) - ) - (set_local $5 - (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 $5) - ) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 48) - ) - ) - (get_local $4) - ) - (func $_ZN5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE6modifyIZNS1_11add_balanceEyNS_5assetERKNS1_14currency_statsEyEUlRT_E0_EEvRKS2_yOS9_ (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) - (local $4 i64) - (local $5 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $5 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - (get_local $0) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (i64.store - (get_local $1) - (i64.add - (i64.load - (get_local $1) - ) - (i64.load - (i32.load - (get_local $3) - ) - ) - ) - ) - (set_local $4 - (i64.load offset=8 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 544) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $1) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.or - (get_local $5) - (i32.const 8) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store8 offset=31 - (get_local $5) - (i32.load8_u offset=16 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.add - (get_local $5) - (i32.const 16) - ) - (i32.add - (get_local $5) - (i32.const 31) - ) - (i32.const 1) - ) - ) - (i32.store8 offset=31 - (get_local $5) - (i32.load8_u offset=17 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.add - (get_local $5) - (i32.const 17) - ) - (i32.add - (get_local $5) - (i32.const 31) - ) - (i32.const 1) - ) - ) - (call $db_update_i64 - (i32.load offset=24 - (get_local $1) - ) - (get_local $2) - (get_local $5) - (i32.const 18) - ) - (block $label$0 - (br_if $label$0 - (i64.lt_u - (tee_local $2 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.load offset=16 - (get_local $0) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (i64.add - (get_local $2) - (i64.const 1) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 32) - ) - ) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_8currency7accountE (param $0 i32) (param $1 i32) (result 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 16) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $1) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 14) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=16 - (get_local $1) - (i32.ne - (i32.load8_u offset=14 - (get_local $3) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store8 offset=17 - (get_local $1) - (i32.ne - (i32.load8_u offset=15 - (get_local $3) - ) - (i32.const 0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy3607749779137757184ENS1_8currency7accountEJEE8item_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 $_ZZN5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE7emplaceIZNS1_11add_balanceEyNS_5assetERKNS1_14currency_statsEyEUlRT_E_EENS3_14const_iteratorEyOS9_ENKUlSA_E_clINS3_4itemEEEDaSA_ (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) - ) - ) - ) - (set_local $2 - (i32.load - (get_local $0) - ) - ) - (i64.store - (get_local $1) - (i64.load - (tee_local $4 - (i32.load - (i32.load offset=4 - (get_local $0) - ) - ) - ) - ) - ) - (i64.store - (tee_local $5 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (get_local $6) - (get_local $1) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.or - (get_local $6) - (i32.const 8) - ) - (get_local $5) - (i32.const 8) - ) - ) - (i32.store8 offset=31 - (get_local $6) - (i32.load8_u offset=16 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.add - (get_local $6) - (i32.const 16) - ) - (i32.add - (get_local $6) - (i32.const 31) - ) - (i32.const 1) - ) - ) - (i32.store8 offset=31 - (get_local $6) - (i32.load8_u offset=17 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.add - (get_local $6) - (i32.const 17) - ) - (i32.add - (get_local $6) - (i32.const 31) - ) - (i32.const 1) - ) - ) - (i32.store offset=24 - (get_local $1) - (call $db_store_i64 - (i64.load offset=8 - (get_local $2) - ) - (i64.const 3607749779137757184) - (i64.load - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $3 - (i64.shr_u - (i64.load - (get_local $5) - ) - (i64.const 8) - ) - ) - (get_local $6) - (i32.const 18) - ) - ) - (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) - ) - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 32) - ) - ) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_8currency14currency_statsE (param $0 i32) (param $1 i32) (result 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 16) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (get_local $1) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (i32.store8 offset=11 - (get_local $3) - (i32.load8_u offset=40 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 0) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $3) - (i32.const 11) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=12 - (get_local $3) - (i32.load8_u offset=41 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 0) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $3) - (i32.const 12) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=13 - (get_local $3) - (i32.load8_u offset=42 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 0) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $3) - (i32.const 13) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=14 - (get_local $3) - (i32.load8_u offset=43 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 0) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $3) - (i32.const 14) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=15 - (get_local $3) - (i32.load8_u offset=44 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 0) - ) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZNK5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE31load_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 656) - ) - (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=36 - (get_local $8) - (get_local $4) - ) - (i32.store offset=32 - (get_local $8) - (get_local $4) - ) - (i32.store offset=40 - (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) - ) - ) - (set_local $4 - (call $_ZN5eosio8currency14currency_statsC2Ev - (tee_local $6 - (call $_Znwj - (i32.const 64) - ) - ) - ) - ) - (i32.store offset=48 - (get_local $6) - (get_local $0) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_8currency14currency_statsE - (i32.add - (get_local $8) - (i32.const 32) - ) - (get_local $4) - ) - ) - (i32.store offset=52 - (get_local $6) - (get_local $1) - ) - (i32.store offset=24 - (get_local $8) - (get_local $6) - ) - (i64.store offset=16 - (get_local $8) - (tee_local $5 - (i64.shr_u - (i64.load offset=8 - (get_local $6) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=12 - (get_local $8) - (tee_local $7 - (i32.load offset=52 - (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_8currency14currency_statsEJEE8item_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 16) - ) - (i32.add - (get_local $8) - (i32.const 12) - ) - ) - ) - (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 $_ZN5eosio8currency14currency_statsC2Ev (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 16) - ) - (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 80) - ) - (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 16) - ) - (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 80) - ) - (i32.store8 offset=44 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=40 - (get_local $0) - (i32.const 65793) - ) - (get_local $0) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_8currency14currency_statsE (param $0 i32) (param $1 i32) (result 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 16) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $1) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 11) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=40 - (get_local $1) - (i32.ne - (i32.load8_u offset=11 - (get_local $3) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 12) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=41 - (get_local $1) - (i32.ne - (i32.load8_u offset=12 - (get_local $3) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 13) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=42 - (get_local $1) - (i32.ne - (i32.load8_u offset=13 - (get_local $3) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 14) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (i32.store8 offset=43 - (get_local $1) - (i32.ne - (i32.load8_u offset=14 - (get_local $3) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store8 offset=44 - (get_local $1) - (i32.ne - (i32.load8_u offset=15 - (get_local $3) - ) - (i32.const 0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZNSt3__16vectorIN5eosio11multi_indexILy14289235522390851584ENS1_8currency14currency_statsEJEE8item_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 $_ZN5eosio8exchange2onERKNS0_8upmarginE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $10 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 576) - ) - ) - ) - (call $require_auth - (i64.load - (get_local $1) - ) - ) - (set_local $9 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (i64.load offset=16 - (get_local $1) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $6 - (i64.shr_u - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - (i64.const 8) - ) - ) - (set_local $7 - (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 $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 $8 - (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 $8 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $8) - (i32.const 2384) - ) - (set_local $2 - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - (block $label$5 - (br_if $label$5 - (i64.gt_u - (i64.add - (i64.load offset=40 - (get_local $1) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $6 - (i64.shr_u - (i64.load - (i32.add - (get_local $1) - (i32.const 48) - ) - ) - (i64.const 8) - ) - ) - (set_local $7 - (i32.const 0) - ) - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $6) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.ne - (i64.and - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$9 - (br_if $label$6 - (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$9 - (i32.lt_s - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $9 - (i32.const 1) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$5) - ) - ) - (set_local $9 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $9) - (i32.const 2416) - ) - (i64.store offset=120 - (get_local $10) - (i64.shr_u - (i64.load offset=8 - (get_local $1) - ) - (i64.const 8) - ) - ) - (set_local $6 - (i64.load - (get_local $0) - ) - ) - (set_local $7 - (call $_ZN5eosio14exchange_stateC2Ev - (i32.add - (get_local $10) - (i32.const 128) - ) - ) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 376) - ) - (i64.const -1) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 384) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 392) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 368) - ) - (tee_local $3 - (i64.load offset=120 - (get_local $10) - ) - ) - ) - (i64.store offset=360 - (get_local $10) - (get_local $6) - ) - (i64.store offset=400 - (get_local $10) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 408) - ) - (tee_local $5 - (i64.or - (tee_local $4 - (i64.shl - (get_local $3) - (i64.const 4) - ) - ) - (i64.const 1) - ) - ) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 416) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 424) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 428) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 432) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $10) - (i32.const 436) - ) - (i32.const 0) - ) - (i64.store offset=440 - (get_local $10) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 448) - ) - (tee_local $4 - (i64.or - (get_local $4) - (i64.const 2) - ) - ) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 456) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 464) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 468) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 472) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $10) - (i32.const 476) - ) - (i32.const 0) - ) - (i64.store offset=480 - (get_local $10) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 488) - ) - (get_local $5) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 496) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 504) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 508) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 512) - ) - (i32.const 0) - ) - (i64.store offset=520 - (get_local $10) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 528) - ) - (get_local $4) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 536) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 544) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 548) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 552) - ) - (i32.const 0) - ) - (i32.store offset=560 - (get_local $10) - (tee_local $8 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (call $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE4findEy - (i32.add - (get_local $10) - (i32.const 564) - ) - (i32.add - (get_local $10) - (i32.const 360) - ) - (get_local $3) - ) - (call $eosio_assert - (i32.ne - (i32.load - (tee_local $9 - (i32.add - (get_local $10) - (i32.const 568) - ) - ) - ) - (i32.const 0) - ) - (i32.const 720) - ) - (drop - (call $memcpy - (get_local $7) - (i32.load - (get_local $9) - ) - (i32.const 232) - ) - ) - (call $eosio_assert - (i64.ne - (i64.or - (i64.load - (get_local $2) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i64.const 0) - ) - (i32.const 2448) - ) - (call $eosio_assert - (i32.or - (i64.ne - (i64.load - (tee_local $7 - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 48) - ) - ) - ) - (i64.ne - (i64.load - (tee_local $9 - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 56) - ) - ) - ) - ) - (i32.const 2464) - ) - (set_local $6 - (i64.load - (get_local $9) - ) - ) - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.ne - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 120) - ) - (i32.const 56) - ) - ) - (tee_local $3 - (i64.load - (get_local $7) - ) - ) - ) - ) - (br_if $label$11 - (i64.ne - (i64.load - (i32.add - (get_local $10) - (i32.const 184) - ) - ) - (get_local $6) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2480) - ) - (br $label$10) - ) - (call $eosio_assert - (i32.and - (i64.eq - (i64.load - (i32.add - (get_local $10) - (i32.const 272) - ) - ) - (get_local $3) - ) - (i64.eq - (i64.load - (i32.add - (get_local $10) - (i32.const 280) - ) - ) - (get_local $6) - ) - ) - (i32.const 2480) - ) - ) - (set_local $6 - (i64.load - (i32.add - (get_local $1) - (i32.const 56) - ) - ) - ) - (block $label$12 - (block $label$13 - (br_if $label$13 - (i64.ne - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 120) - ) - (i32.const 56) - ) - ) - (tee_local $3 - (i64.load - (i32.add - (get_local $1) - (i32.const 48) - ) - ) - ) - ) - ) - (br_if $label$13 - (i64.ne - (i64.load - (i32.add - (get_local $10) - (i32.const 184) - ) - ) - (get_local $6) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2480) - ) - (br $label$12) - ) - (call $eosio_assert - (i32.and - (i64.eq - (i64.load - (i32.add - (get_local $10) - (i32.const 272) - ) - ) - (get_local $3) - ) - (i64.eq - (i64.load - (i32.add - (get_local $10) - (i32.const 280) - ) - ) - (get_local $6) - ) - ) - (i32.const 2480) - ) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - (set_local $6 - (i64.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - (set_local $3 - (i64.load - (get_local $1) - ) - ) - (block $label$14 - (block $label$15 - (br_if $label$15 - (i64.ne - (tee_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const 176) - ) - ) - ) - ) - (br_if $label$15 - (i64.ne - (get_local $6) - (i64.load - (i32.add - (get_local $10) - (i32.const 184) - ) - ) - ) - ) - (call $_ZN5eosio12market_state13adjust_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetESG_ - (i32.add - (get_local $10) - (i32.const 120) - ) - (get_local $3) - (i32.add - (get_local $10) - (i32.const 400) - ) - (i32.add - (get_local $10) - (i32.const 168) - ) - (get_local $7) - (get_local $2) - ) - (br $label$14) - ) - (block $label$16 - (br_if $label$16 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (get_local $10) - (i32.const 272) - ) - ) - ) - ) - (br_if $label$16 - (i64.ne - (get_local $6) - (i64.load - (i32.add - (get_local $10) - (i32.const 280) - ) - ) - ) - ) - (call $_ZN5eosio12market_state13adjust_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetESG_ - (i32.add - (get_local $10) - (i32.const 120) - ) - (get_local $3) - (i32.add - (get_local $10) - (i32.const 440) - ) - (i32.add - (get_local $10) - (i32.const 264) - ) - (get_local $7) - (get_local $2) - ) - (br $label$14) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1376) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 96) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 20) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 96) - ) - (i32.const 16) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 96) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 96) - ) - (i32.const 8) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i32.store offset=96 - (get_local $10) - (i32.load - (get_local $7) - ) - ) - (i32.store offset=100 - (get_local $10) - (i32.load - (i32.add - (get_local $7) - (i32.const 4) - ) - ) - ) - (set_local $6 - (i64.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 80) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=80 - (get_local $10) - (i64.const 0) - ) - (block $label$17 - (block $label$18 - (br_if $label$18 - (i32.ge_u - (tee_local $7 - (call $strlen - (i32.const 2512) - ) - ) - (i32.const -16) - ) - ) - (block $label$19 - (block $label$20 - (block $label$21 - (br_if $label$21 - (i32.ge_u - (get_local $7) - (i32.const 11) - ) - ) - (i32.store8 offset=80 - (get_local $10) - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - (set_local $9 - (i32.or - (i32.add - (get_local $10) - (i32.const 80) - ) - (i32.const 1) - ) - ) - (br_if $label$20 - (get_local $7) - ) - (br $label$19) - ) - (set_local $9 - (call $_Znwj - (tee_local $0 - (i32.and - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=80 - (get_local $10) - (i32.or - (get_local $0) - (i32.const 1) - ) - ) - (i32.store offset=88 - (get_local $10) - (get_local $9) - ) - (i32.store offset=84 - (get_local $10) - (get_local $7) - ) - ) - (drop - (call $memcpy - (get_local $9) - (i32.const 2512) - (get_local $7) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $9) - (get_local $7) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 32) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 96) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 32) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 96) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=32 - (get_local $10) - (i64.load offset=96 - (get_local $10) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $8) - (get_local $6) - (i32.add - (get_local $10) - (i32.const 32) - ) - (get_local $10) - ) - (block $label$22 - (br_if $label$22 - (i32.eqz - (i32.and - (i32.load8_u offset=80 - (get_local $10) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=88 - (get_local $10) - ) - ) - ) - (i64.store offset=64 - (get_local $10) - (i64.load - (i32.add - (get_local $1) - (i32.const 48) - ) - ) - ) - (i64.store offset=56 - (get_local $10) - (i64.sub - (i64.const 0) - (i64.load - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - ) - ) - (set_local $6 - (i64.load - (get_local $1) - ) - ) - (i64.store offset=72 - (get_local $10) - (i64.load - (i32.add - (get_local $1) - (i32.const 56) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $10) - (i32.const 80) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=80 - (get_local $10) - (i64.const 0) - ) - (br_if $label$17 - (i32.ge_u - (tee_local $7 - (call $strlen - (i32.const 2528) - ) - ) - (i32.const -16) - ) - ) - (block $label$23 - (block $label$24 - (block $label$25 - (br_if $label$25 - (i32.ge_u - (get_local $7) - (i32.const 11) - ) - ) - (i32.store8 offset=80 - (get_local $10) - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - (set_local $1 - (i32.or - (i32.add - (get_local $10) - (i32.const 80) - ) - (i32.const 1) - ) - ) - (br_if $label$24 - (get_local $7) - ) - (br $label$23) - ) - (set_local $1 - (call $_Znwj - (tee_local $9 - (i32.and - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=80 - (get_local $10) - (i32.or - (get_local $9) - (i32.const 1) - ) - ) - (i32.store offset=88 - (get_local $10) - (get_local $1) - ) - (i32.store offset=84 - (get_local $10) - (get_local $7) - ) - ) - (drop - (call $memcpy - (get_local $1) - (i32.const 2528) - (get_local $7) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $1) - (get_local $7) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 8) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 56) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 8) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 56) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=8 - (get_local $10) - (i64.load offset=56 - (get_local $10) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $8) - (get_local $6) - (i32.add - (get_local $10) - (i32.const 8) - ) - (get_local $10) - ) - (block $label$26 - (br_if $label$26 - (i32.eqz - (i32.and - (i32.load8_u offset=80 - (get_local $10) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=88 - (get_local $10) - ) - ) - ) - (call $_ZN5eosio12market_state4saveEv - (i32.add - (get_local $10) - (i32.const 120) - ) - ) - (drop - (call $_ZN5eosio12market_stateD2Ev - (i32.add - (get_local $10) - (i32.const 120) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 576) - ) - ) - (return) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $10) - (i32.const 80) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $10) - (i32.const 80) - ) - ) - (unreachable) - ) - (func $_ZN5eosio8exchange2onERKNS0_11covermarginE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (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 464) - ) - ) - ) - (call $require_auth - (i64.load - (get_local $1) - ) - ) - (set_local $2 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - (set_local $8 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (i64.load offset=16 - (get_local $1) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $6 - (i64.shr_u - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - (i64.const 8) - ) - ) - (set_local $7 - (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 $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 $8 - (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 $8 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $8) - (i32.const 2544) - ) - (call $eosio_assert - (i64.gt_s - (i64.load - (get_local $2) - ) - (i64.const 0) - ) - (i32.const 2576) - ) - (i64.store offset=8 - (get_local $9) - (i64.shr_u - (i64.load offset=8 - (get_local $1) - ) - (i64.const 8) - ) - ) - (set_local $6 - (i64.load - (get_local $0) - ) - ) - (set_local $7 - (call $_ZN5eosio14exchange_stateC2Ev - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 264) - ) - (i64.const -1) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 272) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 280) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 256) - ) - (tee_local $3 - (i64.load offset=8 - (get_local $9) - ) - ) - ) - (i64.store offset=248 - (get_local $9) - (get_local $6) - ) - (i64.store offset=288 - (get_local $9) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 296) - ) - (tee_local $5 - (i64.or - (tee_local $4 - (i64.shl - (get_local $3) - (i64.const 4) - ) - ) - (i64.const 1) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 304) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 312) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 316) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 320) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $9) - (i32.const 324) - ) - (i32.const 0) - ) - (i64.store offset=328 - (get_local $9) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 336) - ) - (tee_local $4 - (i64.or - (get_local $4) - (i64.const 2) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 344) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 352) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 356) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 360) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $9) - (i32.const 364) - ) - (i32.const 0) - ) - (i64.store offset=368 - (get_local $9) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 376) - ) - (get_local $5) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 384) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 392) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 396) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 400) - ) - (i32.const 0) - ) - (i64.store offset=408 - (get_local $9) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 416) - ) - (get_local $4) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 424) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 432) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 436) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 440) - ) - (i32.const 0) - ) - (i32.store offset=448 - (get_local $9) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (call $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE4findEy - (i32.add - (get_local $9) - (i32.const 452) - ) - (i32.add - (get_local $9) - (i32.const 248) - ) - (get_local $3) - ) - (call $eosio_assert - (i32.ne - (i32.load - (tee_local $8 - (i32.add - (get_local $9) - (i32.const 456) - ) - ) - ) - (i32.const 0) - ) - (i32.const 720) - ) - (drop - (call $memcpy - (get_local $7) - (i32.load - (get_local $8) - ) - (i32.const 232) - ) - ) - (set_local $6 - (i64.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - (set_local $3 - (i64.load - (get_local $1) - ) - ) - (block $label$5 - (block $label$6 - (br_if $label$6 - (i64.ne - (tee_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (i64.load - (i32.add - (get_local $9) - (i32.const 64) - ) - ) - ) - ) - (br_if $label$6 - (i64.ne - (get_local $6) - (i64.load - (i32.add - (get_local $9) - (i32.const 72) - ) - ) - ) - ) - (call $_ZN5eosio12market_state12cover_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetE - (i32.add - (get_local $9) - (i32.const 8) - ) - (get_local $3) - (i32.add - (get_local $9) - (i32.const 288) - ) - (i32.add - (get_local $9) - (i32.const 56) - ) - (get_local $2) - ) - (br $label$5) - ) - (block $label$7 - (br_if $label$7 - (i64.ne - (get_local $4) - (i64.load - (i32.add - (get_local $9) - (i32.const 160) - ) - ) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $6) - (i64.load - (i32.add - (get_local $9) - (i32.const 168) - ) - ) - ) - ) - (call $_ZN5eosio12market_state12cover_marginEyRNS_11multi_indexILy10497546923563548672ENS_15margin_positionEJNS_10indexed_byILy4729653573519933440EN5boost11multi_index13const_mem_funIS2_yXadL_ZNKS2_8get_callEvEEEEEEEEERNS_14exchange_state9connectorERKNS_14extended_assetE - (i32.add - (get_local $9) - (i32.const 8) - ) - (get_local $3) - (i32.add - (get_local $9) - (i32.const 328) - ) - (i32.add - (get_local $9) - (i32.const 152) - ) - (get_local $2) - ) - (br $label$5) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1376) - ) - ) - (call $_ZN5eosio12market_state4saveEv - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosio12market_stateD2Ev - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 464) - ) - ) - ) - (func $_ZN5eosio8exchange7createxEyNS_5assetEmNS_14extended_assetES2_ (type $FUNCSIG$vijiiii) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i64) - (local $12 i32) - (local $13 i32) - (local $14 i64) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $17 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 464) - ) - ) - ) - (call $require_auth - (get_local $1) - ) - (set_local $16 - (i32.const 0) - ) - (set_local $13 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (tee_local $6 - (i64.load - (get_local $2) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $14 - (i64.shr_u - (i64.load offset=8 - (get_local $2) - ) - (i64.const 8) - ) - ) - (set_local $15 - (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 $14) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $14 - (i64.shr_u - (get_local $14) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $14 - (i64.shr_u - (get_local $14) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $15 - (i32.add - (get_local $15) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $13 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $15 - (i32.add - (get_local $15) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $13 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $13) - (i32.const 2608) - ) - (call $eosio_assert - (i64.gt_s - (get_local $6) - (i64.const 0) - ) - (i32.const 2640) - ) - (block $label$5 - (br_if $label$5 - (i64.gt_u - (i64.add - (tee_local $6 - (i64.load - (get_local $4) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $14 - (i64.shr_u - (i64.load offset=8 - (get_local $4) - ) - (i64.const 8) - ) - ) - (set_local $15 - (i32.const 0) - ) - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $14) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.ne - (i64.and - (tee_local $14 - (i64.shr_u - (get_local $14) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$9 - (br_if $label$6 - (i64.ne - (i64.and - (tee_local $14 - (i64.shr_u - (get_local $14) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$9 - (i32.lt_s - (tee_local $15 - (i32.add - (get_local $15) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $16 - (i32.const 1) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $15 - (i32.add - (get_local $15) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$5) - ) - ) - (set_local $16 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $16) - (i32.const 2672) - ) - (call $eosio_assert - (i64.gt_s - (get_local $6) - (i64.const 0) - ) - (i32.const 2704) - ) - (set_local $6 - (i64.load offset=8 - (get_local $5) - ) - ) - (set_local $13 - (i32.const 0) - ) - (set_local $16 - (i32.const 0) - ) - (block $label$10 - (br_if $label$10 - (i64.gt_u - (i64.add - (tee_local $7 - (i64.load - (get_local $5) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $14 - (i64.shr_u - (get_local $6) - (i64.const 8) - ) - ) - (set_local $15 - (i32.const 0) - ) - (block $label$11 - (loop $label$12 - (br_if $label$11 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $14) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$13 - (br_if $label$13 - (i64.ne - (i64.and - (tee_local $14 - (i64.shr_u - (get_local $14) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$14 - (br_if $label$11 - (i64.ne - (i64.and - (tee_local $14 - (i64.shr_u - (get_local $14) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$14 - (i32.lt_s - (tee_local $15 - (i32.add - (get_local $15) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $16 - (i32.const 1) - ) - (br_if $label$12 - (i32.lt_s - (tee_local $15 - (i32.add - (get_local $15) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$10) - ) - ) - (set_local $16 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $16) - (i32.const 2736) - ) - (call $eosio_assert - (i64.gt_s - (get_local $7) - (i64.const 0) - ) - (i32.const 2768) - ) - (call $eosio_assert - (i32.or - (i64.ne - (tee_local $14 - (i64.load offset=8 - (get_local $4) - ) - ) - (get_local $6) - ) - (i64.ne - (tee_local $7 - (i64.load offset=16 - (get_local $4) - ) - ) - (tee_local $8 - (i64.load offset=16 - (get_local $5) - ) - ) - ) - ) - (i32.const 2800) - ) - (i64.store offset=216 - (get_local $17) - (get_local $7) - ) - (i64.store offset=208 - (get_local $17) - (get_local $14) - ) - (call $prints - (i32.const 2848) - ) - (call $_ZNK5eosio11symbol_type5printEb - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 1) - ) - (call $prints - (i32.const 1280) - ) - (call $printn - (i64.load offset=216 - (get_local $17) - ) - ) - (i64.store offset=216 - (get_local $17) - (get_local $8) - ) - (i64.store offset=208 - (get_local $17) - (get_local $6) - ) - (call $prints - (i32.const 2864) - ) - (call $_ZNK5eosio11symbol_type5printEb - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 1) - ) - (call $prints - (i32.const 1280) - ) - (call $printn - (i64.load offset=216 - (get_local $17) - ) - ) - (set_local $9 - (i64.load offset=8 - (get_local $2) - ) - ) - (call $prints - (i32.const 2880) - ) - (call $printui - (tee_local $10 - (i64.shr_u - (get_local $9) - (i64.const 8) - ) - ) - ) - (call $prints - (i32.const 2896) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 200) - ) - (i32.const 0) - ) - (i64.store offset=176 - (get_local $17) - (get_local $10) - ) - (i64.store offset=184 - (get_local $17) - (i64.const -1) - ) - (i64.store offset=192 - (get_local $17) - (i64.const 0) - ) - (i64.store offset=168 - (get_local $17) - (tee_local $11 - (i64.load - (get_local $0) - ) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.lt_s - (tee_local $15 - (call $db_find_i64 - (get_local $11) - (get_local $10) - (i64.const -7949128877345865728) - (get_local $10) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=232 - (tee_local $13 - (call $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $17) - (i32.const 168) - ) - (get_local $15) - ) - ) - ) - (i32.add - (get_local $17) - (i32.const 168) - ) - ) - (i32.const 224) - ) - ) - (call $eosio_assert - (i32.eqz - (get_local $13) - ) - (i32.const 2912) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=168 - (get_local $17) - ) - (call $current_receiver) - ) - (i32.const 288) - ) - (set_local $16 - (call $_ZN5eosio14exchange_stateC2Ev - (tee_local $15 - (call $_Znwj - (i32.const 248) - ) - ) - ) - ) - (i32.store offset=232 - (get_local $15) - (i32.add - (get_local $17) - (i32.const 168) - ) - ) - (i64.store - (get_local $15) - (get_local $1) - ) - (i64.store - (tee_local $13 - (i32.add - (i32.add - (get_local $17) - (i32.const 432) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i64.store offset=432 - (get_local $17) - (i64.load - (get_local $2) - ) - ) - (set_local $10 - (i64.load - (get_local $0) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 8) - ) - (tee_local $11 - (i64.load - (get_local $13) - ) - ) - ) - (i64.store - (tee_local $13 - (i32.add - (i32.add - (get_local $17) - (i32.const 448) - ) - (i32.const 8) - ) - ) - (get_local $11) - ) - (i64.store offset=208 - (get_local $17) - (tee_local $11 - (i64.load offset=432 - (get_local $17) - ) - ) - ) - (i64.store offset=448 - (get_local $17) - (get_local $11) - ) - (i64.store offset=24 - (get_local $15) - (get_local $10) - ) - (i64.store offset=16 - (get_local $15) - (i64.load - (get_local $13) - ) - ) - (i64.store offset=8 - (get_local $15) - (i64.load offset=448 - (get_local $17) - ) - ) - (i64.store - (i32.add - (get_local $15) - (i32.const 56) - ) - (i64.load - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $15) - (i32.const 48) - ) - (i64.load - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - (i64.store offset=40 - (get_local $15) - (i64.load - (get_local $4) - ) - ) - (i64.store - (i32.add - (get_local $15) - (i32.const 152) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $15) - (i32.const 144) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (i64.store offset=136 - (get_local $15) - (i64.load - (get_local $5) - ) - ) - (i64.store offset=104 - (get_local $15) - (get_local $14) - ) - (i64.store offset=112 - (get_local $15) - (get_local $7) - ) - (i64.store offset=80 - (get_local $15) - (get_local $14) - ) - (i64.store offset=88 - (get_local $15) - (get_local $7) - ) - (i64.store offset=200 - (get_local $15) - (get_local $6) - ) - (i64.store offset=208 - (get_local $15) - (get_local $8) - ) - (i64.store offset=176 - (get_local $15) - (get_local $6) - ) - (i64.store offset=184 - (get_local $15) - (get_local $8) - ) - (i32.store offset=456 - (get_local $17) - (i32.add - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 220) - ) - ) - (i32.store offset=452 - (get_local $17) - (i32.add - (get_local $17) - (i32.const 208) - ) - ) - (i32.store offset=448 - (get_local $17) - (i32.add - (get_local $17) - (i32.const 208) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_14exchange_stateE - (i32.add - (get_local $17) - (i32.const 448) - ) - (get_local $16) - ) - ) - (i32.store offset=236 - (get_local $15) - (tee_local $13 - (call $db_store_i64 - (i64.load - (i32.add - (i32.add - (get_local $17) - (i32.const 168) - ) - (i32.const 8) - ) - ) - (i64.const -7949128877345865728) - (get_local $1) - (tee_local $14 - (i64.shr_u - (i64.load offset=16 - (get_local $15) - ) - (i64.const 8) - ) - ) - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 220) - ) - ) - ) - (block $label$16 - (br_if $label$16 - (i64.lt_u - (get_local $14) - (i64.load - (tee_local $16 - (i32.add - (i32.add - (get_local $17) - (i32.const 168) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i64.store - (get_local $16) - (i64.add - (get_local $14) - (i64.const 1) - ) - ) - ) - (i32.store offset=448 - (get_local $17) - (get_local $15) - ) - (i64.store offset=208 - (get_local $17) - (tee_local $14 - (i64.shr_u - (i64.load - (i32.add - (get_local $15) - (i32.const 16) - ) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=432 - (get_local $17) - (get_local $13) - ) - (block $label$17 - (block $label$18 - (br_if $label$18 - (i32.ge_u - (tee_local $16 - (i32.load - (tee_local $12 - (i32.add - (get_local $17) - (i32.const 196) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $17) - (i32.const 200) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $16) - (get_local $14) - ) - (i32.store offset=16 - (get_local $16) - (get_local $13) - ) - (i32.store offset=448 - (get_local $17) - (i32.const 0) - ) - (i32.store - (get_local $16) - (get_local $15) - ) - (i32.store - (get_local $12) - (i32.add - (get_local $16) - (i32.const 24) - ) - ) - (br $label$17) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy10497615196363685888ENS1_14exchange_stateEJEE8item_ptrENS_9allocatorIS5_EEE24__emplace_back_slow_pathIJNS_10unique_ptrINS4_4itemENS_14default_deleteISB_EEEERyRlEEEvDpOT_ - (i32.add - (get_local $17) - (i32.const 192) - ) - (i32.add - (get_local $17) - (i32.const 448) - ) - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.add - (get_local $17) - (i32.const 432) - ) - ) - ) - (set_local $16 - (i32.load offset=448 - (get_local $17) - ) - ) - (set_local $15 - (i32.const 0) - ) - (i32.store offset=448 - (get_local $17) - (i32.const 0) - ) - (block $label$19 - (br_if $label$19 - (i32.eqz - (get_local $16) - ) - ) - (call $_ZdlPv - (get_local $16) - ) - ) - (i64.store - (tee_local $16 - (i32.add - (get_local $17) - (i32.const 224) - ) - ) - (get_local $9) - ) - (i64.store offset=216 - (get_local $17) - (i64.const 0) - ) - (i64.store offset=208 - (get_local $17) - (i64.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $13 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $14 - (i64.shr_u - (i64.load - (get_local $16) - ) - (i64.const 8) - ) - ) - (block $label$20 - (block $label$21 - (loop $label$22 - (br_if $label$21 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $14) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$23 - (br_if $label$23 - (i64.ne - (i64.and - (tee_local $14 - (i64.shr_u - (get_local $14) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$24 - (br_if $label$21 - (i64.ne - (i64.and - (tee_local $14 - (i64.shr_u - (get_local $14) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$24 - (i32.lt_s - (tee_local $15 - (i32.add - (get_local $15) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $16 - (i32.const 1) - ) - (br_if $label$22 - (i32.lt_s - (tee_local $15 - (i32.add - (get_local $15) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$20) - ) - ) - (set_local $16 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $16) - (i32.const 80) - ) - (i32.store8 offset=234 - (get_local $17) - (i32.const 0) - ) - (i32.store16 offset=232 - (get_local $17) - (i32.const 0) - ) - (call $_ZN5eosio8currency15create_currencyERKNS0_6createE - (get_local $13) - (i32.add - (get_local $17) - (i32.const 208) - ) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 228) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 224) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (i64.store offset=208 - (get_local $17) - (i64.load - (get_local $0) - ) - ) - (i32.store offset=216 - (get_local $17) - (i32.load - (get_local $2) - ) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 240) - ) - (i32.const 0) - ) - (i64.store offset=232 - (get_local $17) - (i64.const 0) - ) - (set_local $16 - (i32.add - (get_local $17) - (i32.const 232) - ) - ) - (block $label$25 - (block $label$26 - (block $label$27 - (block $label$28 - (br_if $label$28 - (i32.ge_u - (tee_local $15 - (call $strlen - (i32.const 2944) - ) - ) - (i32.const -16) - ) - ) - (block $label$29 - (block $label$30 - (block $label$31 - (br_if $label$31 - (i32.ge_u - (get_local $15) - (i32.const 11) - ) - ) - (i32.store8 - (i32.add - (get_local $17) - (i32.const 232) - ) - (i32.shl - (get_local $15) - (i32.const 1) - ) - ) - (set_local $16 - (i32.add - (get_local $16) - (i32.const 1) - ) - ) - (br_if $label$30 - (get_local $15) - ) - (br $label$29) - ) - (set_local $16 - (call $_Znwj - (tee_local $12 - (i32.and - (i32.add - (get_local $15) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 232) - ) - (i32.or - (get_local $12) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 240) - ) - (get_local $16) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 236) - ) - (get_local $15) - ) - ) - (drop - (call $memcpy - (get_local $16) - (i32.const 2944) - (get_local $15) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $16) - (get_local $15) - ) - (i32.const 0) - ) - (call $_ZN5eosio8currency14issue_currencyERKNS0_5issueE - (get_local $13) - (i32.add - (get_local $17) - (i32.const 208) - ) - ) - (block $label$32 - (br_if $label$32 - (i32.eqz - (i32.and - (i32.load8_u - (i32.add - (get_local $17) - (i32.const 232) - ) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $17) - (i32.const 240) - ) - ) - ) - ) - (i64.store - (tee_local $15 - (i32.add - (i32.add - (get_local $17) - (i32.const 128) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i64.store offset=128 - (get_local $17) - (i64.load - (get_local $2) - ) - ) - (set_local $14 - (i64.load - (get_local $0) - ) - ) - (i64.store - (tee_local $2 - (i32.add - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 8) - ) - ) - (tee_local $6 - (i64.load - (get_local $15) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $17) - (i32.const 144) - ) - (i32.const 8) - ) - (get_local $6) - ) - (i64.store offset=208 - (get_local $17) - (tee_local $6 - (i64.load offset=128 - (get_local $17) - ) - ) - ) - (i64.store offset=144 - (get_local $17) - (get_local $6) - ) - (i64.store offset=160 - (get_local $17) - (get_local $14) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i64.store offset=208 - (get_local $17) - (i64.const 0) - ) - (br_if $label$27 - (i32.ge_u - (tee_local $15 - (call $strlen - (i32.const 2976) - ) - ) - (i32.const -16) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (block $label$33 - (block $label$34 - (block $label$35 - (br_if $label$35 - (i32.ge_u - (get_local $15) - (i32.const 11) - ) - ) - (i32.store8 offset=208 - (get_local $17) - (i32.shl - (get_local $15) - (i32.const 1) - ) - ) - (set_local $0 - (i32.or - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 1) - ) - ) - (br_if $label$34 - (get_local $15) - ) - (br $label$33) - ) - (set_local $0 - (call $_Znwj - (tee_local $16 - (i32.and - (i32.add - (get_local $15) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=208 - (get_local $17) - (i32.or - (get_local $16) - (i32.const 1) - ) - ) - (i32.store offset=216 - (get_local $17) - (get_local $0) - ) - (i32.store offset=212 - (get_local $17) - (get_local $15) - ) - ) - (drop - (call $memcpy - (get_local $0) - (i32.const 2976) - (get_local $15) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $0) - (get_local $15) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (i32.add - (get_local $17) - (i32.const 56) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $17) - (i32.const 144) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $17) - (i32.const 56) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $17) - (i32.const 144) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=56 - (get_local $17) - (i64.load offset=144 - (get_local $17) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $2) - (get_local $1) - (i32.add - (get_local $17) - (i32.const 56) - ) - (get_local $17) - ) - (block $label$36 - (br_if $label$36 - (i32.eqz - (i32.and - (i32.load8_u offset=208 - (get_local $17) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=216 - (get_local $17) - ) - ) - ) - (i64.store offset=104 - (get_local $17) - (i64.sub - (i64.const 0) - (i64.load - (get_local $4) - ) - ) - ) - (i64.store offset=112 - (get_local $17) - (i64.load - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - (i64.store offset=120 - (get_local $17) - (i64.load - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=208 - (get_local $17) - (i64.const 0) - ) - (br_if $label$26 - (i32.ge_u - (tee_local $15 - (call $strlen - (i32.const 3008) - ) - ) - (i32.const -16) - ) - ) - (block $label$37 - (block $label$38 - (block $label$39 - (br_if $label$39 - (i32.ge_u - (get_local $15) - (i32.const 11) - ) - ) - (i32.store8 offset=208 - (get_local $17) - (i32.shl - (get_local $15) - (i32.const 1) - ) - ) - (set_local $4 - (i32.or - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 1) - ) - ) - (br_if $label$38 - (get_local $15) - ) - (br $label$37) - ) - (set_local $4 - (call $_Znwj - (tee_local $0 - (i32.and - (i32.add - (get_local $15) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=208 - (get_local $17) - (i32.or - (get_local $0) - (i32.const 1) - ) - ) - (i32.store offset=216 - (get_local $17) - (get_local $4) - ) - (i32.store offset=212 - (get_local $17) - (get_local $15) - ) - ) - (drop - (call $memcpy - (get_local $4) - (i32.const 3008) - (get_local $15) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $4) - (get_local $15) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (i32.add - (get_local $17) - (i32.const 32) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $17) - (i32.const 104) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $17) - (i32.const 32) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $17) - (i32.const 104) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=32 - (get_local $17) - (i64.load offset=104 - (get_local $17) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $2) - (get_local $1) - (i32.add - (get_local $17) - (i32.const 32) - ) - (get_local $17) - ) - (block $label$40 - (br_if $label$40 - (i32.eqz - (i32.and - (i32.load8_u offset=208 - (get_local $17) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=216 - (get_local $17) - ) - ) - ) - (i64.store offset=80 - (get_local $17) - (i64.sub - (i64.const 0) - (i64.load - (get_local $5) - ) - ) - ) - (i64.store offset=88 - (get_local $17) - (i64.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (i64.store offset=96 - (get_local $17) - (i64.load - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=208 - (get_local $17) - (i64.const 0) - ) - (br_if $label$25 - (i32.ge_u - (tee_local $15 - (call $strlen - (i32.const 3008) - ) - ) - (i32.const -16) - ) - ) - (block $label$41 - (block $label$42 - (block $label$43 - (br_if $label$43 - (i32.ge_u - (get_local $15) - (i32.const 11) - ) - ) - (i32.store8 offset=208 - (get_local $17) - (i32.shl - (get_local $15) - (i32.const 1) - ) - ) - (set_local $4 - (i32.or - (i32.add - (get_local $17) - (i32.const 208) - ) - (i32.const 1) - ) - ) - (br_if $label$42 - (get_local $15) - ) - (br $label$41) - ) - (set_local $4 - (call $_Znwj - (tee_local $5 - (i32.and - (i32.add - (get_local $15) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=208 - (get_local $17) - (i32.or - (get_local $5) - (i32.const 1) - ) - ) - (i32.store offset=216 - (get_local $17) - (get_local $4) - ) - (i32.store offset=212 - (get_local $17) - (get_local $15) - ) - ) - (drop - (call $memcpy - (get_local $4) - (i32.const 3008) - (get_local $15) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $4) - (get_local $15) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (i32.add - (get_local $17) - (i32.const 8) - ) - (i32.const 16) - ) - (i64.load - (i32.add - (i32.add - (get_local $17) - (i32.const 80) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $17) - (i32.const 8) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $17) - (i32.const 80) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=8 - (get_local $17) - (i64.load offset=80 - (get_local $17) - ) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (get_local $2) - (get_local $1) - (i32.add - (get_local $17) - (i32.const 8) - ) - (get_local $17) - ) - (block $label$44 - (br_if $label$44 - (i32.eqz - (i32.and - (i32.load8_u offset=208 - (get_local $17) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=216 - (get_local $17) - ) - ) - ) - (block $label$45 - (br_if $label$45 - (i32.eqz - (tee_local $4 - (i32.load offset=192 - (get_local $17) - ) - ) - ) - ) - (block $label$46 - (block $label$47 - (br_if $label$47 - (i32.eq - (tee_local $15 - (i32.load - (tee_local $5 - (i32.add - (get_local $17) - (i32.const 196) - ) - ) - ) - ) - (get_local $4) - ) - ) - (loop $label$48 - (set_local $2 - (i32.load - (tee_local $15 - (i32.add - (get_local $15) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $15) - (i32.const 0) - ) - (block $label$49 - (br_if $label$49 - (i32.eqz - (get_local $2) - ) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$48 - (i32.ne - (get_local $4) - (get_local $15) - ) - ) - ) - (set_local $15 - (i32.load - (i32.add - (get_local $17) - (i32.const 192) - ) - ) - ) - (br $label$46) - ) - (set_local $15 - (get_local $4) - ) - ) - (i32.store - (get_local $5) - (get_local $4) - ) - (call $_ZdlPv - (get_local $15) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $17) - (i32.const 464) - ) - ) - (return) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (get_local $16) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $17) - (i32.const 208) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $17) - (i32.const 208) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $17) - (i32.const 208) - ) - ) - (unreachable) - ) - (func $_ZN5eosio8currency15create_currencyERKNS0_6createE (param $0 i32) (param $1 i32) - (local $2 i64) - (local $3 i32) - (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 64) - ) - ) - ) - (set_local $5 - (i32.const 0) - ) - (set_local $4 - (tee_local $2 - (i64.shr_u - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - (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 $4) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $3 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $3 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $3) - (i32.const 80) - ) - (set_local $5 - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $6) - (i32.const 56) - ) - (i32.const 0) - ) - (i64.store offset=40 - (get_local $6) - (i64.const -1) - ) - (i64.store offset=48 - (get_local $6) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $6) - (tee_local $4 - (i64.load - (get_local $0) - ) - ) - ) - (i64.store offset=32 - (get_local $6) - (get_local $2) - ) - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.lt_s - (tee_local $3 - (call $db_find_i64 - (get_local $4) - (get_local $2) - (i64.const -4157508551318700032) - (get_local $2) - ) - ) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=48 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE31load_object_by_primary_iteratorEl - (i32.add - (get_local $6) - (i32.const 24) - ) - (get_local $3) - ) - ) - (i32.add - (get_local $6) - (i32.const 24) - ) - ) - (i32.const 224) - ) - (br $label$5) - ) - (set_local $5 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 3040) - ) - (set_local $4 - (i64.load - (get_local $1) - ) - ) - (i32.store offset=16 - (get_local $6) - (get_local $1) - ) - (call $_ZN5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE7emplaceIZNS1_15create_currencyERKNS1_6createEEUlRT_E_EENS3_14const_iteratorEyOS8_ - (i32.add - (get_local $6) - (i32.const 8) - ) - (i32.add - (get_local $6) - (i32.const 24) - ) - (get_local $4) - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (tee_local $1 - (i32.load offset=48 - (get_local $6) - ) - ) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eq - (tee_local $5 - (i32.load - (tee_local $0 - (i32.add - (get_local $6) - (i32.const 52) - ) - ) - ) - ) - (get_local $1) - ) - ) - (loop $label$10 - (set_local $3 - (i32.load - (tee_local $5 - (i32.add - (get_local $5) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $5) - (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 $1) - (get_local $5) - ) - ) - ) - (set_local $5 - (i32.load - (i32.add - (get_local $6) - (i32.const 48) - ) - ) - ) - (br $label$8) - ) - (set_local $5 - (get_local $1) - ) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 64) - ) - ) - ) - (func $_ZN5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE7emplaceIZNS1_15create_currencyERKNS1_6createEEUlRT_E_EENS3_14const_iteratorEyOS8_ (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 288) - ) - (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) - ) - ) - (drop - (call $_ZN5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE4itemC2IZNS3_7emplaceIZNS1_15create_currencyERKNS1_6createEEUlRT_E_EENS3_14const_iteratorEyOSA_EUlSB_E_EEPKS3_SE_ - (tee_local $3 - (call $_Znwj - (i32.const 64) - ) - ) - (get_local $1) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - (i32.store offset=32 - (get_local $7) - (get_local $3) - ) - (i64.store offset=16 - (get_local $7) - (tee_local $2 - (i64.shr_u - (i64.load offset=8 - (get_local $3) - ) - (i64.const 8) - ) - ) - ) - (i32.store offset=12 - (get_local $7) - (tee_local $4 - (i32.load offset=52 - (get_local $3) - ) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $5 - (i32.load - (tee_local $6 - (i32.add - (get_local $1) - (i32.const 28) - ) - ) - ) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - ) - (i64.store offset=8 - (get_local $5) - (get_local $2) - ) - (i32.store offset=16 - (get_local $5) - (get_local $4) - ) - (i32.store offset=32 - (get_local $7) - (i32.const 0) - ) - (i32.store - (get_local $5) - (get_local $3) - ) - (i32.store - (get_local $6) - (i32.add - (get_local $5) - (i32.const 24) - ) - ) - (br $label$0) - ) - (call $_ZNSt3__16vectorIN5eosio11multi_indexILy14289235522390851584ENS1_8currency14currency_statsEJEE8item_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 $3) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (set_local $1 - (i32.load offset=32 - (get_local $7) - ) - ) - (i32.store offset=32 - (get_local $7) - (i32.const 0) - ) - (block $label$2 - (br_if $label$2 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 48) - ) - ) - ) - (func $_ZN5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE4itemC2IZNS3_7emplaceIZNS1_15create_currencyERKNS1_6createEEUlRT_E_EENS3_14const_iteratorEyOSA_EUlSB_E_EEPKS3_SE_ (param $0 i32) (param $1 i32) (param $2 i32) (result 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 64) - ) - ) - ) - (set_local $5 - (call $_ZN5eosio8currency14currency_statsC2Ev - (get_local $0) - ) - ) - (i32.store offset=48 - (get_local $0) - (get_local $1) - ) - (i64.store offset=8 - (get_local $0) - (i64.load - (i32.add - (i32.load - (tee_local $1 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - (i32.const 16) - ) - ) - ) - (set_local $3 - (i32.load - (get_local $2) - ) - ) - (i64.store offset=16 - (get_local $0) - (i64.load offset=8 - (tee_local $6 - (i32.load - (get_local $1) - ) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 24) - ) - (i64.load - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - ) - (i64.store offset=32 - (get_local $0) - (i64.load - (i32.load - (get_local $1) - ) - ) - ) - (i32.store8 offset=40 - (get_local $0) - (i32.ne - (i32.load8_u offset=24 - (i32.load - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (i32.store8 offset=41 - (get_local $0) - (i32.ne - (i32.load8_u offset=25 - (i32.load - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (i32.store8 offset=42 - (get_local $0) - (i32.ne - (i32.load8_u offset=26 - (i32.load - (get_local $1) - ) - ) - (i32.const 0) - ) - ) - (i32.store offset=56 - (get_local $7) - (i32.add - (get_local $7) - (i32.const 45) - ) - ) - (i32.store offset=52 - (get_local $7) - (get_local $7) - ) - (i32.store offset=48 - (get_local $7) - (get_local $7) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_8currency14currency_statsE - (i32.add - (get_local $7) - (i32.const 48) - ) - (get_local $5) - ) - ) - (i32.store offset=52 - (get_local $0) - (call $db_store_i64 - (i64.load offset=8 - (get_local $3) - ) - (i64.const -4157508551318700032) - (i64.load - (i32.load offset=8 - (get_local $2) - ) - ) - (tee_local $4 - (i64.shr_u - (i64.load offset=8 - (get_local $0) - ) - (i64.const 8) - ) - ) - (get_local $7) - (i32.const 45) - ) - ) - (block $label$0 - (br_if $label$0 - (i64.lt_u - (get_local $4) - (i64.load offset=16 - (get_local $3) - ) - ) - ) - (i64.store - (i32.add - (get_local $3) - (i32.const 16) - ) - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 64) - ) - ) - (get_local $0) - ) - (func $_ZN5eosio8exchange4lendEyNS_11symbol_typeENS_14extended_assetE (type $FUNCSIG$vijji) (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i32) - (local $4 i64) - (local $5 i64) - (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 464) - ) - ) - ) - (call $require_auth - (get_local $1) - ) - (set_local $8 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (tee_local $4 - (i64.load - (get_local $3) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $6 - (i64.shr_u - (i64.load offset=8 - (get_local $3) - ) - (i64.const 8) - ) - ) - (set_local $7 - (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 $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 $8 - (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 $8 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $8) - (i32.const 1840) - ) - (call $eosio_assert - (i64.gt_s - (get_local $4) - (i64.const 0) - ) - (i32.const 3088) - ) - (i64.store offset=8 - (get_local $9) - (i64.shr_u - (get_local $2) - (i64.const 8) - ) - ) - (set_local $6 - (i64.load - (get_local $0) - ) - ) - (set_local $7 - (call $_ZN5eosio14exchange_stateC2Ev - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 264) - ) - (i64.const -1) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 272) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 280) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 256) - ) - (tee_local $2 - (i64.load offset=8 - (get_local $9) - ) - ) - ) - (i64.store offset=248 - (get_local $9) - (get_local $6) - ) - (i64.store offset=288 - (get_local $9) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 296) - ) - (tee_local $5 - (i64.or - (tee_local $4 - (i64.shl - (get_local $2) - (i64.const 4) - ) - ) - (i64.const 1) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 304) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 312) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 316) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 320) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $9) - (i32.const 324) - ) - (i32.const 0) - ) - (i64.store offset=328 - (get_local $9) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 336) - ) - (tee_local $4 - (i64.or - (get_local $4) - (i64.const 2) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 344) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 352) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 356) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 360) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $9) - (i32.const 364) - ) - (i32.const 0) - ) - (i64.store offset=368 - (get_local $9) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 376) - ) - (get_local $5) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 384) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 392) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 396) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 400) - ) - (i32.const 0) - ) - (i64.store offset=408 - (get_local $9) - (get_local $6) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 416) - ) - (get_local $4) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 424) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 432) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 436) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 440) - ) - (i32.const 0) - ) - (i32.store offset=448 - (get_local $9) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (call $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE4findEy - (i32.add - (get_local $9) - (i32.const 452) - ) - (i32.add - (get_local $9) - (i32.const 248) - ) - (get_local $2) - ) - (call $eosio_assert - (i32.ne - (i32.load - (tee_local $8 - (i32.add - (get_local $9) - (i32.const 456) - ) - ) - ) - (i32.const 0) - ) - (i32.const 720) - ) - (drop - (call $memcpy - (get_local $7) - (i32.load - (get_local $8) - ) - (i32.const 232) - ) - ) - (call $_ZN5eosio12market_state4lendEyRKNS_14extended_assetE - (i32.add - (get_local $9) - (i32.const 8) - ) - (get_local $1) - (get_local $3) - ) - (call $_ZN5eosio12market_state4saveEv - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosio12market_stateD2Ev - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 464) - ) - ) - ) - (func $_ZN5eosio8exchange6unlendEyNS_11symbol_typeEdNS_15extended_symbolE (type $FUNCSIG$vijjdi) (param $0 i32) (param $1 i64) (param $2 i64) (param $3 f64) (param $4 i32) - (local $5 i32) - (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 464) - ) - ) - ) - (call $require_auth - (get_local $1) - ) - (call $eosio_assert - (f64.gt - (get_local $3) - (f64.const 0) - ) - (i32.const 3120) - ) - (i64.store offset=8 - (get_local $9) - (i64.shr_u - (get_local $2) - (i64.const 8) - ) - ) - (set_local $2 - (i64.load - (get_local $0) - ) - ) - (set_local $5 - (call $_ZN5eosio14exchange_stateC2Ev - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 264) - ) - (i64.const -1) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 272) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 280) - ) - (i32.const 0) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 256) - ) - (tee_local $6 - (i64.load offset=8 - (get_local $9) - ) - ) - ) - (i64.store offset=248 - (get_local $9) - (get_local $2) - ) - (i64.store offset=288 - (get_local $9) - (get_local $2) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 296) - ) - (tee_local $8 - (i64.or - (tee_local $7 - (i64.shl - (get_local $6) - (i64.const 4) - ) - ) - (i64.const 1) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 304) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 312) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 316) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 320) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $9) - (i32.const 324) - ) - (i32.const 0) - ) - (i64.store offset=328 - (get_local $9) - (get_local $2) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 336) - ) - (tee_local $7 - (i64.or - (get_local $7) - (i64.const 2) - ) - ) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 344) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 352) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 356) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 360) - ) - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $9) - (i32.const 364) - ) - (i32.const 0) - ) - (i64.store offset=368 - (get_local $9) - (get_local $2) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 376) - ) - (get_local $8) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 384) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 392) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 396) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 400) - ) - (i32.const 0) - ) - (i64.store offset=408 - (get_local $9) - (get_local $2) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 416) - ) - (get_local $7) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 424) - ) - (i64.const -1) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 432) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 436) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 440) - ) - (i32.const 0) - ) - (i32.store offset=448 - (get_local $9) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (call $_ZNK5eosio11multi_indexILy10497615196363685888ENS_14exchange_stateEJEE4findEy - (i32.add - (get_local $9) - (i32.const 452) - ) - (i32.add - (get_local $9) - (i32.const 248) - ) - (get_local $6) - ) - (call $eosio_assert - (i32.ne - (i32.load - (tee_local $0 - (i32.add - (get_local $9) - (i32.const 456) - ) - ) - ) - (i32.const 0) - ) - (i32.const 720) - ) - (drop - (call $memcpy - (get_local $5) - (i32.load - (get_local $0) - ) - (i32.const 232) - ) - ) - (call $_ZN5eosio12market_state6unlendEydRKNS_15extended_symbolE - (i32.add - (get_local $9) - (i32.const 8) - ) - (get_local $1) - (get_local $3) - (get_local $4) - ) - (call $_ZN5eosio12market_state4saveEv - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosio12market_stateD2Ev - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 464) - ) - ) - ) - (func $_ZN5eosio8exchange2onERKNS_8currency8transferEy (param $0 i32) (param $1 i32) (param $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i64) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $12 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (block $label$0 - (br_if $label$0 - (i64.ne - (tee_local $8 - (i64.load - (get_local $0) - ) - ) - (get_local $2) - ) - ) - (call $_ZN5eosio8currency2onERKNS0_8transferE - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $1) - ) - (set_local $8 - (i64.load - (get_local $0) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i64.ne - (i64.load offset=8 - (get_local $1) - ) - (get_local $8) - ) - ) - (set_local $4 - (i64.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (set_local $10 - (i32.const 0) - ) - (block $label$2 - (br_if $label$2 - (i64.gt_u - (i64.add - (tee_local $3 - (i64.load offset=16 - (get_local $1) - ) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $8 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (set_local $9 - (i32.const 0) - ) - (block $label$3 - (loop $label$4 - (br_if $label$3 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $8) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$5 - (br_if $label$5 - (i64.ne - (i64.and - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$6 - (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) - ) - ) - (br_if $label$6 - (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$4 - (i32.lt_s - (tee_local $9 - (i32.add - (get_local $9) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$2) - ) - ) - (set_local $10 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $10) - (i32.const 3152) - ) - (call $eosio_assert - (i64.ne - (get_local $3) - (i64.const 0) - ) - (i32.const 3184) - ) - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i64.lt_s - (get_local $3) - (i64.const 1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3232) - ) - (set_local $11 - (i32.add - (get_local $1) - (i32.const 36) - ) - ) - (set_local $10 - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - (br $label$8) - ) - (set_local $9 - (i32.const 1) - ) - (set_local $10 - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - (set_local $6 - (i32.const 0) - ) - (block $label$10 - (br_if $label$10 - (i32.ne - (tee_local $5 - (call $strlen - (i32.const 1968) - ) - ) - (select - (i32.load - (tee_local $11 - (i32.add - (get_local $1) - (i32.const 36) - ) - ) - ) - (i32.shr_u - (tee_local $7 - (i32.load8_u offset=32 - (get_local $1) - ) - ) - (i32.const 1) - ) - (i32.and - (get_local $7) - (i32.const 1) - ) - ) - ) - ) - (set_local $6 - (i32.eqz - (call $_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj - (get_local $10) - (i32.const 0) - (i32.const -1) - (i32.const 1968) - (get_local $5) - ) - ) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 3232) - ) - (br_if $label$7 - (i64.lt_s - (get_local $3) - (i64.const 0) - ) - ) - ) - (set_local $9 - (i32.const 0) - ) - (br_if $label$7 - (i32.ne - (tee_local $6 - (call $strlen - (i32.const 1872) - ) - ) - (select - (i32.load - (get_local $11) - ) - (i32.shr_u - (tee_local $11 - (i32.load8_u - (get_local $10) - ) - ) - (i32.const 1) - ) - (i32.and - (get_local $11) - (i32.const 1) - ) - ) - ) - ) - (set_local $9 - (i32.eqz - (call $_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj - (get_local $10) - (i32.const 0) - (i32.const -1) - (i32.const 1872) - (get_local $6) - ) - ) - ) - ) - (call $eosio_assert - (get_local $9) - (i32.const 3280) - ) - (i64.store offset=32 - (get_local $12) - (get_local $4) - ) - (set_local $8 - (i64.load - (get_local $1) - ) - ) - (i64.store - (i32.add - (get_local $12) - (i32.const 8) - ) - (get_local $4) - ) - (i64.store offset=40 - (get_local $12) - (get_local $2) - ) - (i64.store - (i32.add - (get_local $12) - (i32.const 16) - ) - (get_local $2) - ) - (i64.store offset=24 - (get_local $12) - (get_local $3) - ) - (i64.store - (get_local $12) - (get_local $3) - ) - (call $_ZN5eosio17exchange_accounts14adjust_balanceEyNS_14extended_assetERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE - (i32.add - (get_local $0) - (i32.const 16) - ) - (get_local $8) - (get_local $12) - (get_local $9) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $12) - (i32.const 48) - ) - ) - ) - (func $_ZN5eosio8currency2onERKNS0_8transferE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i64) - (local $9 i32) - (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 $require_auth - (i64.load - (get_local $1) - ) - ) - (set_local $8 - (i64.load - (tee_local $10 - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - ) - (set_local $9 - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 0) - ) - (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) - ) - ) - (i64.store offset=80 - (get_local $11) - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - ) - (set_local $2 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE3getEyPKc - (i32.add - (get_local $11) - (i32.const 72) - ) - (get_local $8) - (i32.const 2224) - ) - ) - (call $require_recipient - (i64.load offset=8 - (get_local $1) - ) - ) - (set_local $3 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (i64.load offset=16 - (get_local $1) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $8 - (i64.shr_u - (i64.load - (get_local $10) - ) - (i64.const 8) - ) - ) - (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 $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 $10 - (i32.add - (get_local $10) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $9 - (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 $9 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $9) - (i32.const 1840) - ) - (call $eosio_assert - (i64.gt_s - (i64.load - (get_local $3) - ) - (i64.const 0) - ) - (i32.const 3328) - ) - (i32.store - (tee_local $10 - (i32.add - (i32.add - (get_local $11) - (i32.const 56) - ) - (i32.const 12) - ) - ) - (i32.load - (tee_local $9 - (i32.add - (get_local $3) - (i32.const 12) - ) - ) - ) - ) - (i32.store - (tee_local $5 - (i32.add - (i32.add - (get_local $11) - (i32.const 56) - ) - (i32.const 8) - ) - ) - (i32.load - (tee_local $4 - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - ) - (i32.store offset=60 - (get_local $11) - (i32.load - (tee_local $6 - (i32.add - (get_local $3) - (i32.const 4) - ) - ) - ) - ) - (i32.store offset=56 - (get_local $11) - (i32.load - (get_local $3) - ) - ) - (set_local $8 - (i64.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 12) - ) - (i32.load - (get_local $10) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 8) - ) - (i32.load - (get_local $5) - ) - ) - (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 $_ZN5eosio8currency11sub_balanceEyNS_5assetERKNS0_14currency_statsE - (get_local $0) - (get_local $8) - (i32.add - (get_local $11) - (i32.const 24) - ) - (get_local $2) - ) - (i32.store - (i32.add - (i32.add - (get_local $11) - (i32.const 40) - ) - (i32.const 12) - ) - (i32.load - (get_local $9) - ) - ) - (i32.store - (tee_local $10 - (i32.add - (i32.add - (get_local $11) - (i32.const 40) - ) - (i32.const 8) - ) - ) - (i32.load - (get_local $4) - ) - ) - (i32.store offset=44 - (get_local $11) - (i32.load - (get_local $6) - ) - ) - (i32.store offset=40 - (get_local $11) - (i32.load - (get_local $3) - ) - ) - (set_local $8 - (i64.load - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - (set_local $7 - (i64.load - (get_local $1) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.const 8) - ) - (i64.load - (get_local $10) - ) - ) - (i64.store offset=8 - (get_local $11) - (i64.load offset=40 - (get_local $11) - ) - ) - (call $_ZN5eosio8currency11add_balanceEyNS_5assetERKNS0_14currency_statsEy - (get_local $0) - (get_local $8) - (i32.add - (get_local $11) - (i32.const 8) - ) - (get_local $2) - (get_local $7) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (tee_local $3 - (i32.load offset=96 - (get_local $11) - ) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.eq - (tee_local $10 - (i32.load - (tee_local $9 - (i32.add - (get_local $11) - (i32.const 100) - ) - ) - ) - ) - (get_local $3) - ) - ) - (loop $label$8 - (set_local $1 - (i32.load - (tee_local $10 - (i32.add - (get_local $10) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $10) - (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 $3) - (get_local $10) - ) - ) - ) - (set_local $10 - (i32.load - (i32.add - (get_local $11) - (i32.const 96) - ) - ) - ) - (br $label$6) - ) - (set_local $10 - (get_local $3) - ) - ) - (i32.store - (get_local $9) - (get_local $3) - ) - (call $_ZdlPv - (get_local $10) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 112) - ) - ) - ) - (func $_ZN5eosio8currency11sub_balanceEyNS_5assetERKNS0_14currency_statsE (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i32) - (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 48) - ) - ) - ) - (i32.store - (i32.add - (get_local $6) - (i32.const 40) - ) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $6) - (get_local $1) - ) - (i64.store offset=24 - (get_local $6) - (i64.const -1) - ) - (i64.store offset=32 - (get_local $6) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $6) - (i64.load - (get_local $0) - ) - ) - (call $eosio_assert - (i64.ge_s - (i64.load - (tee_local $0 - (call $_ZNK5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE3getEyPKc - (i32.add - (get_local $6) - (i32.const 8) - ) - (i64.shr_u - (i64.load offset=8 - (get_local $2) - ) - (i64.const 8) - ) - (i32.const 2224) - ) - ) - ) - (i64.load - (get_local $2) - ) - ) - (i32.const 3360) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (call $has_auth - (get_local $1) - ) - ) - ) - (set_local $5 - (i32.const 1) - ) - (set_local $4 - (i32.const 1) - ) - (block $label$2 - (br_if $label$2 - (i32.eqz - (i32.load8_u offset=40 - (get_local $3) - ) - ) - ) - (set_local $4 - (i32.xor - (i32.load8_u offset=16 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (call $eosio_assert - (get_local $4) - (i32.const 3392) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (i32.load8_u - (i32.add - (get_local $3) - (i32.const 40) - ) - ) - ) - ) - (set_local $5 - (i32.xor - (i32.load8_u offset=43 - (get_local $3) - ) - (i32.const 1) - ) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 3424) - ) - (call $eosio_assert - (select - (i32.load8_u offset=17 - (get_local $0) - ) - (i32.const 1) - (i32.load8_u offset=44 - (get_local $3) - ) - ) - (i32.const 3472) - ) - (br $label$0) - ) - (block $label$4 - (br_if $label$4 - (i32.eqz - (call $has_auth - (i64.load offset=32 - (get_local $3) - ) - ) - ) - ) - (call $eosio_assert - (i32.load8_u offset=41 - (get_local $3) - ) - (i32.const 3504) - ) - (br $label$0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 3536) - ) - ) - (i32.store - (get_local $6) - (get_local $2) - ) - (call $_ZN5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE6modifyIZNS1_11sub_balanceEyNS_5assetERKNS1_14currency_statsEEUlRT_E_EEvRKS2_yOS9_ - (i32.add - (get_local $6) - (i32.const 8) - ) - (get_local $0) - (get_local $1) - (get_local $6) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (tee_local $0 - (i32.load offset=32 - (get_local $6) - ) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.eq - (tee_local $2 - (i32.load - (tee_local $5 - (i32.add - (get_local $6) - (i32.const 36) - ) - ) - ) - ) - (get_local $0) - ) - ) - (loop $label$8 - (set_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $2) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (get_local $3) - ) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (br_if $label$8 - (i32.ne - (get_local $0) - (get_local $2) - ) - ) - ) - (set_local $2 - (i32.load - (i32.add - (get_local $6) - (i32.const 32) - ) - ) - ) - (br $label$6) - ) - (set_local $2 - (get_local $0) - ) - ) - (i32.store - (get_local $5) - (get_local $0) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 48) - ) - ) - ) - (func $_ZNK5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE3getEyPKc (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 - (i32.add - (tee_local $6 - (i32.load - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - ) - (i32.const 20) - ) - ) - (get_local $0) - ) - (i32.const 224) - ) - (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=20 - (tee_local $6 - (call $_ZNK5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE31load_object_by_primary_iteratorEl - (get_local $0) - (get_local $5) - ) - ) - ) - (get_local $0) - ) - (i32.const 224) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $6) - (i32.const 0) - ) - (get_local $2) - ) - (get_local $6) - ) - (func $_ZN5eosio11multi_indexILy3607749779137757184ENS_8currency7accountEJEE6modifyIZNS1_11sub_balanceEyNS_5assetERKNS1_14currency_statsEEUlRT_E_EEvRKS2_yOS9_ (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) - (local $4 i64) - (local $5 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $5 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - (get_local $0) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (i64.store - (get_local $1) - (i64.sub - (i64.load - (get_local $1) - ) - (i64.load - (i32.load - (get_local $3) - ) - ) - ) - ) - (set_local $4 - (i64.load offset=8 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 544) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $1) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.or - (get_local $5) - (i32.const 8) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store8 offset=31 - (get_local $5) - (i32.load8_u offset=16 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.add - (get_local $5) - (i32.const 16) - ) - (i32.add - (get_local $5) - (i32.const 31) - ) - (i32.const 1) - ) - ) - (i32.store8 offset=31 - (get_local $5) - (i32.load8_u offset=17 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 608) - ) - (drop - (call $memcpy - (i32.add - (get_local $5) - (i32.const 17) - ) - (i32.add - (get_local $5) - (i32.const 31) - ) - (i32.const 1) - ) - ) - (call $db_update_i64 - (i32.load offset=24 - (get_local $1) - ) - (get_local $2) - (get_local $5) - (i32.const 18) - ) - (block $label$0 - (br_if $label$0 - (i64.lt_u - (tee_local $2 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.load offset=16 - (get_local $0) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (i64.add - (get_local $2) - (i64.const 1) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 32) - ) - ) - ) - (func $_ZN5eosio8exchange5applyEyy (param $0 i32) (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 160) - ) - ) - ) - (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$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 7) - ) - ) - (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 - (block $label$7 - (br_if $label$7 - (i64.ne - (get_local $7) - (get_local $2) - ) - ) - (call $_ZN5eosio18unpack_action_dataINS_8currency8transferEEET_v - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (call $_ZN5eosio8exchange2onERKNS_8currency8transferEy - (get_local $0) - (i32.add - (get_local $9) - (i32.const 48) - ) - (get_local $1) - ) - (br_if $label$6 - (i32.eqz - (i32.and - (i32.load8_u offset=80 - (get_local $9) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $9) - (i32.const 88) - ) - ) - ) - (br $label$6) - ) - (br_if $label$6 - (i64.ne - (i64.load - (get_local $0) - ) - (get_local $1) - ) - ) - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (br_if $label$15 - (i64.gt_s - (get_local $2) - (i64.const -2039333636196532225) - ) - ) - (br_if $label$14 - (i64.gt_s - (get_local $2) - (i64.const -3106734271092490241) - ) - ) - (br_if $label$12 - (i64.eq - (get_local $2) - (i64.const -8455912920667127808) - ) - ) - (br_if $label$8 - (i64.ne - (get_local $2) - (i64.const -3617352573452812288) - ) - ) - (call $_ZN5eosio18unpack_action_dataINS_8exchange5tradeEEET_v - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (call $_ZN5eosio8exchange2onERKNS0_5tradeE - (get_local $0) - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (br $label$6) - ) - (br_if $label$13 - (i64.gt_s - (get_local $2) - (i64.const 5031766168059248639) - ) - ) - (br_if $label$11 - (i64.eq - (get_local $2) - (i64.const -2039333636196532224) - ) - ) - (br_if $label$8 - (i64.ne - (get_local $2) - (i64.const 4987362516454843904) - ) - ) - (call $_ZN5eosio18unpack_action_dataINS_8exchange11covermarginEEET_v - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (call $_ZN5eosio8exchange2onERKNS0_11covermarginE - (get_local $0) - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (br $label$6) - ) - (br_if $label$10 - (i64.eq - (get_local $2) - (i64.const -3106734271092490240) - ) - ) - (br_if $label$8 - (i64.ne - (get_local $2) - (i64.const -3070210634466459648) - ) - ) - (call $_ZN5eosio18unpack_action_dataINS_8exchange8upmarginEEET_v - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (call $_ZN5eosio8exchange2onERKNS0_8upmarginE - (get_local $0) - (i32.add - (get_local $9) - (i32.const 48) - ) - ) - (br $label$6) - ) - (br_if $label$9 - (i64.eq - (get_local $2) - (i64.const 5380477996647841792) - ) - ) - (br_if $label$8 - (i64.ne - (get_local $2) - (i64.const 5031766168059248640) - ) - ) - (i32.store offset=156 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=152 - (get_local $9) - (i32.const 1) - ) - (i64.store offset=8 align=4 - (get_local $9) - (i64.load offset=152 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_5assetEmNS_14extended_assetES3_EEEbPT_MT0_FvDpT1_E - (get_local $0) - (i32.add - (get_local $9) - (i32.const 8) - ) - ) - ) - (br $label$8) - ) - (i32.store offset=132 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=128 - (get_local $9) - (i32.const 2) - ) - (i64.store offset=32 align=4 - (get_local $9) - (i64.load offset=128 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_11symbol_typeENS_14extended_assetEEEEbPT_MT0_FvDpT1_E - (get_local $0) - (i32.add - (get_local $9) - (i32.const 32) - ) - ) - ) - (br $label$8) - ) - (i32.store offset=140 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=136 - (get_local $9) - (i32.const 3) - ) - (i64.store offset=24 align=4 - (get_local $9) - (i64.load offset=136 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_14extended_assetEEEEbPT_MT0_FvDpT1_E - (get_local $0) - (i32.add - (get_local $9) - (i32.const 24) - ) - ) - ) - (br $label$8) - ) - (i32.store offset=124 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=120 - (get_local $9) - (i32.const 4) - ) - (i64.store offset=40 align=4 - (get_local $9) - (i64.load offset=120 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_11symbol_typeEdNS_15extended_symbolEEEEbPT_MT0_FvDpT1_E - (get_local $0) - (i32.add - (get_local $9) - (i32.const 40) - ) - ) - ) - (br $label$8) - ) - (i32.store offset=148 - (get_local $9) - (i32.const 0) - ) - (i32.store offset=144 - (get_local $9) - (i32.const 5) - ) - (i64.store offset=16 align=4 - (get_local $9) - (i64.load offset=144 - (get_local $9) - ) - ) - (drop - (call $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_14extended_assetEEEEbPT_MT0_FvDpT1_E - (get_local $0) - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - ) - (drop - (call $_ZN5eosio8currency5applyEyy - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $1) - (get_local $2) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 160) - ) - ) - ) - (func $_ZN5eosio18unpack_action_dataINS_8currency8transferEEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (set_local $6 - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $4) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $2 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (get_local $4) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $2) - (get_local $1) - ) - ) - (i64.store - (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 16) - ) - (set_local $3 - (i64.const 5462355) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$2 - (block $label$3 - (loop $label$4 - (br_if $label$3 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$5 - (br_if $label$5 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$6 - (br_if $label$3 - (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$6 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $5 - (i32.const 1) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$2) - ) - ) - (set_local $5 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 80) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 40) - ) - (i32.const 0) - ) - (i64.store offset=32 align=4 - (get_local $0) - (i64.const 0) - ) - (i32.store offset=4 - (get_local $6) - (get_local $2) - ) - (i32.store - (get_local $6) - (get_local $2) - ) - (i32.store offset=8 - (get_local $6) - (i32.add - (get_local $2) - (get_local $1) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_8currency8transferE - (get_local $6) - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_5assetEmNS_14extended_assetES3_EEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (set_local $10 - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 336) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $8) - ) - (set_local $2 - (i32.load offset=4 - (get_local $1) - ) - ) - (set_local $9 - (i32.load - (get_local $1) - ) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (call $action_data_size) - ) - ) - ) - (br_if $label$2 - (i32.lt_u - (get_local $1) - (i32.const 513) - ) - ) - (set_local $8 - (call $malloc - (get_local $1) - ) - ) - (br $label$1) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (get_local $8) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $8) - (get_local $1) - ) - ) - ) - (call $_ZN5eosio6unpackINSt3__15tupleIJyNS_5assetEmNS_14extended_assetES4_EEEEET_PKcj - (i32.add - (get_local $10) - (i32.const 64) - ) - (get_local $8) - (get_local $1) - ) - (block $label$4 - (br_if $label$4 - (i32.lt_u - (get_local $1) - (i32.const 513) - ) - ) - (call $free - (get_local $8) - ) - ) - (i64.store - (tee_local $1 - (i32.add - (i32.add - (get_local $10) - (i32.const 192) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 64) - ) - (i32.const 16) - ) - ) - ) - (set_local $3 - (i64.load offset=64 - (get_local $10) - ) - ) - (i64.store offset=192 - (get_local $10) - (i64.load offset=72 - (get_local $10) - ) - ) - (set_local $8 - (i32.load offset=88 - (get_local $10) - ) - ) - (i64.store - (tee_local $4 - (i32.add - (i32.add - (get_local $10) - (i32.const 168) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const 112) - ) - ) - ) - (i64.store - (tee_local $5 - (i32.add - (i32.add - (get_local $10) - (i32.const 168) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const 104) - ) - ) - ) - (i64.store offset=168 - (get_local $10) - (i64.load offset=96 - (get_local $10) - ) - ) - (i64.store - (tee_local $6 - (i32.add - (i32.add - (get_local $10) - (i32.const 144) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const 136) - ) - ) - ) - (i64.store - (tee_local $7 - (i32.add - (i32.add - (get_local $10) - (i32.const 144) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $10) - (i32.const 128) - ) - ) - ) - (i64.store offset=144 - (get_local $10) - (i64.load offset=120 - (get_local $10) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 248) - ) - (i32.const 16) - ) - (i64.load - (get_local $6) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 248) - ) - (i32.const 8) - ) - (i64.load - (get_local $7) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 224) - ) - (i32.const 16) - ) - (i64.load - (get_local $4) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 224) - ) - (i32.const 8) - ) - (i64.load - (get_local $5) - ) - ) - (i64.store offset=248 - (get_local $10) - (i64.load offset=144 - (get_local $10) - ) - ) - (i64.store offset=224 - (get_local $10) - (i64.load offset=168 - (get_local $10) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 8) - ) - (i64.load - (get_local $1) - ) - ) - (i64.store offset=208 - (get_local $10) - (i64.load offset=192 - (get_local $10) - ) - ) - (set_local $1 - (i32.add - (get_local $0) - (i32.shr_s - (get_local $2) - (i32.const 1) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (i32.and - (get_local $2) - (i32.const 1) - ) - ) - ) - (set_local $9 - (i32.load - (i32.add - (i32.load - (get_local $1) - ) - (get_local $9) - ) - ) - ) - ) - (i64.store - (tee_local $2 - (i32.add - (i32.add - (get_local $10) - (i32.const 320) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 8) - ) - ) - ) - (i64.store - (tee_local $0 - (i32.add - (i32.add - (get_local $10) - (i32.const 296) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 224) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (tee_local $4 - (i32.add - (i32.add - (get_local $10) - (i32.const 296) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 224) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=320 - (get_local $10) - (i64.load offset=208 - (get_local $10) - ) - ) - (i64.store offset=296 - (get_local $10) - (i64.load offset=224 - (get_local $10) - ) - ) - (i64.store - (tee_local $5 - (i32.add - (i32.add - (get_local $10) - (i32.const 272) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 248) - ) - (i32.const 16) - ) - ) - ) - (i64.store - (tee_local $6 - (i32.add - (i32.add - (get_local $10) - (i32.const 272) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (i32.add - (get_local $10) - (i32.const 248) - ) - (i32.const 8) - ) - ) - ) - (i64.store offset=272 - (get_local $10) - (i64.load offset=248 - (get_local $10) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 48) - ) - (i32.const 8) - ) - (i64.load - (get_local $2) - ) - ) - (i64.store offset=48 - (get_local $10) - (i64.load offset=320 - (get_local $10) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.const 16) - ) - (i64.load - (get_local $0) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.const 8) - ) - (i64.load - (get_local $4) - ) - ) - (i64.store offset=24 - (get_local $10) - (i64.load offset=296 - (get_local $10) - ) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 16) - ) - (i64.load - (get_local $5) - ) - ) - (i64.store - (i32.add - (get_local $10) - (i32.const 8) - ) - (i64.load - (get_local $6) - ) - ) - (i64.store - (get_local $10) - (i64.load offset=272 - (get_local $10) - ) - ) - (call_indirect (type $FUNCSIG$vijiiii) - (get_local $1) - (get_local $3) - (i32.add - (get_local $10) - (i32.const 48) - ) - (get_local $8) - (i32.add - (get_local $10) - (i32.const 24) - ) - (get_local $10) - (get_local $9) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 336) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_14extended_assetEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $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 i32) - (set_local $11 - (tee_local $9 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 128) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $9) - ) - (set_local $2 - (i32.load offset=4 - (get_local $1) - ) - ) - (set_local $10 - (i32.load - (get_local $1) - ) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $7 - (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 $7 - (call $malloc - (get_local $3) - ) - ) - (br $label$1) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (get_local $9) - (i32.and - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $7) - (get_local $3) - ) - ) - ) - (i64.store - (tee_local $4 - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 40) - ) - (i64.const 1398362884) - ) - (i64.store offset=24 - (get_local $11) - (i64.const 0) - ) - (i64.store offset=32 - (get_local $11) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $8 - (i64.const 5462355) - ) - (block $label$3 - (loop $label$4 - (set_local $9 - (i32.const 0) - ) - (br_if $label$3 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $8) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$5 - (br_if $label$5 - (i64.ne - (i64.and - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$6 - (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) - ) - ) - (br_if $label$6 - (i32.lt_s - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $9 - (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 $9) - (i32.const 80) - ) - (call $eosio_assert - (i32.gt_u - (get_local $3) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $11) - (i32.const 24) - ) - (get_local $7) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (tee_local $9 - (i32.and - (get_local $3) - (i32.const -8) - ) - ) - (i32.const 8) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (tee_local $1 - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $9) - (i32.const 16) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (i32.add - (get_local $11) - (i32.const 24) - ) - (i32.const 16) - ) - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $9) - (i32.const 24) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $4) - (i32.add - (get_local $7) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (block $label$7 - (br_if $label$7 - (i32.lt_u - (get_local $3) - (i32.const 513) - ) - ) - (call $free - (get_local $7) - ) - ) - (i64.store - (tee_local $9 - (i32.add - (i32.add - (get_local $11) - (i32.const 56) - ) - (i32.const 16) - ) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i64.store - (tee_local $7 - (i32.add - (i32.add - (get_local $11) - (i32.const 56) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - (set_local $8 - (i64.load offset=24 - (get_local $11) - ) - ) - (i64.store offset=56 - (get_local $11) - (i64.load - (get_local $1) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 80) - ) - (i32.const 16) - ) - (i64.load - (get_local $9) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 80) - ) - (i32.const 8) - ) - (i64.load - (get_local $7) - ) - ) - (i64.store offset=80 - (get_local $11) - (i64.load offset=56 - (get_local $11) - ) - ) - (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 $10 - (i32.load - (i32.add - (i32.load - (get_local $1) - ) - (get_local $10) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 16) - ) - (tee_local $5 - (i64.load - (i32.add - (i32.add - (get_local $11) - (i32.const 80) - ) - (i32.const 16) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 8) - ) - (tee_local $6 - (i64.load - (i32.add - (i32.add - (get_local $11) - (i32.const 80) - ) - (i32.const 8) - ) - ) - ) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 16) - ) - (get_local $5) - ) - (i64.store - (i32.add - (get_local $11) - (i32.const 8) - ) - (get_local $6) - ) - (i64.store offset=104 - (get_local $11) - (tee_local $5 - (i64.load offset=80 - (get_local $11) - ) - ) - ) - (i64.store - (get_local $11) - (get_local $5) - ) - (call_indirect (type $FUNCSIG$viji) - (get_local $1) - (get_local $8) - (get_local $11) - (get_local $10) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 128) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_11symbol_typeENS_14extended_assetEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (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 144) - ) - ) - ) - (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) - ) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (call $action_data_size) - ) - ) - ) - (br_if $label$2 - (i32.lt_u - (get_local $1) - (i32.const 513) - ) - ) - (set_local $7 - (call $malloc - (get_local $1) - ) - ) - (br $label$1) - ) - (set_local $7 - (i32.const 0) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (get_local $7) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $7) - (get_local $1) - ) - ) - ) - (call $_ZN5eosio6unpackINSt3__15tupleIJyNS_11symbol_typeENS_14extended_assetEEEEEET_PKcj - (i32.add - (get_local $9) - (i32.const 32) - ) - (get_local $7) - (get_local $1) - ) - (block $label$4 - (br_if $label$4 - (i32.lt_u - (get_local $1) - (i32.const 513) - ) - ) - (call $free - (get_local $7) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $9) - (i32.const 72) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (get_local $9) - (i32.const 68) - ) - ) - ) - (i32.store - (tee_local $1 - (i32.add - (i32.add - (get_local $9) - (i32.const 72) - ) - (i32.const 16) - ) - ) - (i32.load - (i32.add - (get_local $9) - (i32.const 64) - ) - ) - ) - (set_local $4 - (i64.load offset=40 - (get_local $9) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 84) - ) - (i32.load - (i32.add - (get_local $9) - (i32.const 60) - ) - ) - ) - (i32.store - (tee_local $7 - (i32.add - (i32.add - (get_local $9) - (i32.const 72) - ) - (i32.const 8) - ) - ) - (i32.load - (i32.add - (get_local $9) - (i32.const 56) - ) - ) - ) - (set_local $3 - (i64.load offset=32 - (get_local $9) - ) - ) - (i32.store offset=72 - (get_local $9) - (i32.load offset=48 - (get_local $9) - ) - ) - (i32.store offset=76 - (get_local $9) - (i32.load - (i32.add - (i32.add - (get_local $9) - (i32.const 32) - ) - (i32.const 20) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 16) - ) - (i64.load - (get_local $1) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 8) - ) - (i64.load - (get_local $7) - ) - ) - (i64.store offset=96 - (get_local $9) - (i64.load offset=72 - (get_local $9) - ) - ) - (set_local $1 - (i32.add - (get_local $0) - (i32.shr_s - (get_local $2) - (i32.const 1) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (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 120) - ) - (i32.const 16) - ) - (tee_local $5 - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 16) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 120) - ) - (i32.const 8) - ) - (tee_local $6 - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.const 8) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 16) - ) - (get_local $5) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 8) - ) - (get_local $6) - ) - (i64.store offset=120 - (get_local $9) - (tee_local $5 - (i64.load offset=96 - (get_local $9) - ) - ) - ) - (i64.store offset=8 - (get_local $9) - (get_local $5) - ) - (call_indirect (type $FUNCSIG$vijji) - (get_local $1) - (get_local $3) - (get_local $4) - (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 144) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosio14execute_actionINS_8exchangeES1_JyNS_11symbol_typeEdNS_15extended_symbolEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i64) - (local $6 f64) - (local $7 i64) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (set_local $9 - (tee_local $10 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $10) - ) - (set_local $2 - (i32.load offset=4 - (get_local $1) - ) - ) - (set_local $8 - (i32.load - (get_local $1) - ) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $3 - (call $action_data_size) - ) - ) - ) - (br_if $label$2 - (i32.lt_u - (get_local $3) - (i32.const 513) - ) - ) - (set_local $1 - (call $malloc - (get_local $3) - ) - ) - (br $label$1) - ) - (set_local $1 - (i32.const 0) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $1 - (i32.sub - (get_local $10) - (i32.and - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $1) - (get_local $3) - ) - ) - ) - (i64.store - (tee_local $10 - (i32.add - (get_local $9) - (i32.const 56) - ) - ) - (i64.const 0) - ) - (i64.store offset=40 - (get_local $9) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $9) - (i64.const 0) - ) - (i64.store offset=48 - (get_local $9) - (i64.const 0) - ) - (i32.store offset=100 - (get_local $9) - (get_local $1) - ) - (i32.store offset=96 - (get_local $9) - (get_local $1) - ) - (i32.store offset=104 - (get_local $9) - (i32.add - (get_local $1) - (get_local $3) - ) - ) - (i32.store offset=64 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 96) - ) - ) - (i32.store offset=80 - (get_local $9) - (i32.add - (get_local $9) - (i32.const 24) - ) - ) - (call $_ZN5boost6fusion6detail17for_each_unrolledILi4EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyN5eosio11symbol_typeEdNS8_15extended_symbolEEEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyS9_dSA_EEERT_SJ_RNS7_IJDpT0_EEEEUlSJ_E_EEvRKSI_RKT0_ - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.add - (get_local $9) - (i32.const 64) - ) - ) - (block $label$4 - (br_if $label$4 - (i32.lt_u - (get_local $3) - (i32.const 513) - ) - ) - (call $free - (get_local $1) - ) - ) - (set_local $5 - (i64.load offset=32 - (get_local $9) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 76) - ) - (i32.load - (i32.add - (get_local $9) - (i32.const 60) - ) - ) - ) - (i32.store - (tee_local $1 - (i32.add - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 8) - ) - ) - (i32.load - (get_local $10) - ) - ) - (set_local $4 - (i64.load offset=24 - (get_local $9) - ) - ) - (i32.store offset=64 - (get_local $9) - (i32.load offset=48 - (get_local $9) - ) - ) - (i32.store offset=68 - (get_local $9) - (i32.load - (i32.add - (get_local $9) - (i32.const 52) - ) - ) - ) - (set_local $6 - (f64.load - (i32.add - (get_local $9) - (i32.const 40) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 8) - ) - (i64.load - (get_local $1) - ) - ) - (i64.store offset=80 - (get_local $9) - (i64.load offset=64 - (get_local $9) - ) - ) - (set_local $1 - (i32.add - (get_local $0) - (i32.shr_s - (get_local $2) - (i32.const 1) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (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 96) - ) - (i32.const 8) - ) - (tee_local $7 - (i64.load - (i32.add - (i32.add - (get_local $9) - (i32.const 80) - ) - (i32.const 8) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $9) - (i32.const 8) - ) - (i32.const 8) - ) - (get_local $7) - ) - (i64.store offset=96 - (get_local $9) - (tee_local $7 - (i64.load offset=80 - (get_local $9) - ) - ) - ) - (i64.store offset=8 - (get_local $9) - (get_local $7) - ) - (call_indirect (type $FUNCSIG$vijjdi) - (get_local $1) - (get_local $4) - (get_local $5) - (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 112) - ) - ) - (i32.const 1) - ) - (func $_ZN5eosio18unpack_action_dataINS_8exchange5tradeEEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (set_local $4 - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $2) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $3 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $3 - (i32.sub - (get_local $2) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $3) - (get_local $1) - ) - ) - (set_local $2 - (call $_ZN5eosio8exchange5tradeC2Ev - (get_local $0) - ) - ) - (i32.store offset=4 - (get_local $4) - (get_local $3) - ) - (i32.store - (get_local $4) - (get_local $3) - ) - (i32.store offset=8 - (get_local $4) - (i32.add - (get_local $3) - (get_local $1) - ) - ) - (i32.store offset=16 - (get_local $4) - (get_local $4) - ) - (i32.store offset=28 - (get_local $4) - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - (i32.store offset=24 - (get_local $4) - (get_local $2) - ) - (i32.store offset=32 - (get_local $4) - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - (i32.store offset=36 - (get_local $4) - (i32.add - (get_local $2) - (i32.const 40) - ) - ) - (i32.store offset=40 - (get_local $4) - (i32.add - (get_local $2) - (i32.const 64) - ) - ) - (i32.store offset=44 - (get_local $4) - (i32.add - (get_local $2) - (i32.const 68) - ) - ) - (call $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRyRN5eosio11symbol_typeERNS6_14extended_assetESA_RmRhEEEZNS6_rsINS6_10datastreamIPKcEENS6_8exchange5tradeELPv0EEERT_SN_RT0_EUlSN_E_JLj0ELj1ELj2ELj3ELj4ELj5EEEEvSN_OSO_NSt3__116integer_sequenceIjJXspT1_EEEENSS_17integral_constantIbLb0EEE - (i32.add - (get_local $4) - (i32.const 24) - ) - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $4) - (i32.const 48) - ) - ) - ) - (func $_ZN5eosio18unpack_action_dataINS_8exchange8upmarginEEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (set_local $3 - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $2) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $2 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (get_local $2) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $2) - (get_local $1) - ) - ) - (set_local $0 - (call $_ZN5eosio8exchange8upmarginC2Ev - (get_local $0) - ) - ) - (i32.store offset=12 - (get_local $3) - (get_local $2) - ) - (i32.store offset=8 - (get_local $3) - (get_local $2) - ) - (i32.store offset=16 - (get_local $3) - (i32.add - (get_local $2) - (get_local $1) - ) - ) - (i32.store offset=24 - (get_local $3) - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - (i32.store offset=36 - (get_local $3) - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (i32.store offset=32 - (get_local $3) - (get_local $0) - ) - (i32.store offset=40 - (get_local $3) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (i32.store offset=44 - (get_local $3) - (i32.add - (get_local $0) - (i32.const 40) - ) - ) - (call $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRyRN5eosio11symbol_typeERNS6_14extended_assetESA_EEEZNS6_rsINS6_10datastreamIPKcEENS6_8exchange8upmarginELPv0EEERT_SL_RT0_EUlSL_E_JLj0ELj1ELj2ELj3EEEEvSL_OSM_NSt3__116integer_sequenceIjJXspT1_EEEENSQ_17integral_constantIbLb0EEE - (i32.add - (get_local $3) - (i32.const 32) - ) - (i32.add - (get_local $3) - (i32.const 24) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 48) - ) - ) - ) - (func $_ZN5eosio18unpack_action_dataINS_8exchange11covermarginEEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (set_local $3 - (tee_local $2 - (i32.load offset=4 - (i32.const 0) - ) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $2 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (get_local $2) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $2) - (get_local $1) - ) - ) - (call $_ZN5eosio6unpackINS_8exchange11covermarginEEET_PKcj - (get_local $0) - (get_local $2) - (get_local $1) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $3) - ) - ) - (func $_ZN5eosio8currency5applyEyy (param $0 i32) (param $1 i64) (param $2 i64) (result i32) - (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 48) - ) - ) - ) - (set_local $3 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i64.ne - (i64.load - (get_local $0) - ) - (get_local $1) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i64.eq - (get_local $2) - (i64.const -3617168760277827584) - ) - ) - (br_if $label$1 - (i64.eq - (get_local $2) - (i64.const 5031766152489992192) - ) - ) - (br_if $label$0 - (i64.ne - (get_local $2) - (i64.const 8516769789752901632) - ) - ) - (call $prints - (i32.const 3568) - ) - (call $_ZN5eosio18unpack_action_dataINS_8currency5issueEEET_v - (get_local $4) - ) - (call $_ZN5eosio8currency2onERKNS0_5issueE - (get_local $0) - (get_local $4) - ) - (set_local $3 - (i32.const 1) - ) - (br_if $label$0 - (i32.eqz - (i32.and - (i32.load8_u offset=24 - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $4) - (i32.const 32) - ) - ) - ) - (br $label$0) - ) - (call $prints - (i32.const 3584) - ) - (call $_ZN5eosio18unpack_action_dataINS_8currency8transferEEET_v - (get_local $4) - ) - (call $_ZN5eosio8currency2onERKNS0_8transferE - (get_local $0) - (get_local $4) - ) - (set_local $3 - (i32.const 1) - ) - (br_if $label$0 - (i32.eqz - (i32.and - (i32.load8_u offset=32 - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $4) - (i32.const 40) - ) - ) - ) - (br $label$0) - ) - (call $prints - (i32.const 3600) - ) - (call $_ZN5eosio18unpack_action_dataINS_8currency6createEEET_v - (get_local $4) - ) - (call $require_auth - (i64.load - (get_local $4) - ) - ) - (call $_ZN5eosio8currency15create_currencyERKNS0_6createE - (get_local $0) - (get_local $4) - ) - (set_local $3 - (i32.const 1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $4) - (i32.const 48) - ) - ) - (get_local $3) - ) - (func $_ZN5eosio18unpack_action_dataINS_8currency5issueEEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (set_local $6 - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $4) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $2 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (get_local $4) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $2) - (get_local $1) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (i64.const 1398362884) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $3 - (i64.const 5462355) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$2 - (block $label$3 - (loop $label$4 - (br_if $label$3 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$5 - (br_if $label$5 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$6 - (br_if $label$3 - (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$6 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $5 - (i32.const 1) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$2) - ) - ) - (set_local $5 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 80) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 32) - ) - (i32.const 0) - ) - (i64.store offset=24 align=4 - (get_local $0) - (i64.const 0) - ) - (i32.store - (get_local $6) - (get_local $2) - ) - (i32.store offset=8 - (get_local $6) - (tee_local $4 - (i32.add - (get_local $2) - (get_local $1) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (get_local $1) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $2) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (get_local $4) - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $5) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (get_local $4) - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 16) - ) - (get_local $5) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $6) - (i32.add - (get_local $2) - (i32.const 24) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE - (get_local $6) - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosio8currency2onERKNS0_5issueE (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i32) - (local $12 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $12 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 128) - ) - ) - ) - (set_local $8 - (i64.load - (tee_local $11 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 88) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i64.store offset=104 - (get_local $12) - (i64.const -1) - ) - (i64.store offset=112 - (get_local $12) - (i64.const 0) - ) - (i64.store offset=88 - (get_local $12) - (i64.load - (get_local $0) - ) - ) - (i64.store offset=96 - (get_local $12) - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 8) - ) - ) - ) - (call $require_auth - (i64.load offset=32 - (tee_local $2 - (call $_ZNK5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE3getEyPKc - (i32.add - (get_local $12) - (i32.const 88) - ) - (get_local $8) - (i32.const 2224) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (block $label$0 - (br_if $label$0 - (i64.gt_u - (i64.add - (i64.load offset=8 - (get_local $1) - ) - (i64.const 4611686018427387903) - ) - (i64.const 9223372036854775806) - ) - ) - (set_local $8 - (i64.shr_u - (i64.load - (get_local $11) - ) - (i64.const 8) - ) - ) - (set_local $11 - (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 $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 $11 - (i32.add - (get_local $11) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $6 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $11 - (i32.add - (get_local $11) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $6 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 1840) - ) - (call $eosio_assert - (i64.gt_s - (i64.load - (get_local $5) - ) - (i64.const 0) - ) - (i32.const 3616) - ) - (i32.store offset=80 - (get_local $12) - (get_local $1) - ) - (call $_ZN5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE6modifyIZNS1_2onERKNS1_5issueEEUlRT_E_EEvRKS2_yOS8_ - (i32.add - (get_local $12) - (i32.const 88) - ) - (get_local $2) - (i64.const 0) - (i32.add - (get_local $12) - (i32.const 80) - ) - ) - (set_local $8 - (i64.load - (tee_local $11 - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - ) - (i64.store - (tee_local $6 - (i32.add - (i32.add - (get_local $12) - (i32.const 64) - ) - (i32.const 8) - ) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (i64.store offset=64 - (get_local $12) - (i64.load - (get_local $5) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $12) - (i32.const 16) - ) - (i32.const 8) - ) - (i64.load - (get_local $6) - ) - ) - (i32.store offset=16 - (get_local $12) - (i32.load offset=64 - (get_local $12) - ) - ) - (i32.store offset=20 - (get_local $12) - (i32.load offset=68 - (get_local $12) - ) - ) - (call $_ZN5eosio8currency11add_balanceEyNS_5assetERKNS0_14currency_statsEy - (get_local $0) - (get_local $8) - (i32.add - (get_local $12) - (i32.const 16) - ) - (get_local $2) - (get_local $8) - ) - (block $label$5 - (br_if $label$5 - (i64.eq - (tee_local $3 - (i64.load - (get_local $1) - ) - ) - (tee_local $4 - (i64.load - (get_local $11) - ) - ) - ) - ) - (i64.store - (i32.add - (i32.add - (get_local $12) - (i32.const 48) - ) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (i64.store offset=48 - (get_local $12) - (i64.load - (get_local $5) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $12) - (i32.const 32) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - (set_local $8 - (i64.const 0) - ) - (set_local $7 - (i64.const 59) - ) - (set_local $11 - (i32.const 1888) - ) - (set_local $9 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $8) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $11) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $10 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $8) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $10 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $10 - (i64.shl - (i64.and - (get_local $10) - (i64.const 31) - ) - (i64.and - (get_local $7) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $11 - (i32.add - (get_local $11) - (i32.const 1) - ) - ) - (set_local $8 - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - (set_local $9 - (i64.or - (get_local $10) - (get_local $9) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $7 - (i64.add - (get_local $7) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store - (i32.add - (get_local $12) - (i32.const 8) - ) - (i64.load - (i32.add - (i32.add - (get_local $12) - (i32.const 48) - ) - (i32.const 8) - ) - ) - ) - (i64.store - (get_local $12) - (i64.load offset=48 - (get_local $12) - ) - ) - (call $_ZN5eosio8currency15inline_transferEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEy - (get_local $0) - (get_local $4) - (get_local $3) - (get_local $12) - (i32.add - (get_local $12) - (i32.const 32) - ) - (get_local $9) - ) - (br_if $label$5 - (i32.eqz - (i32.and - (i32.load8_u offset=32 - (get_local $12) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=40 - (get_local $12) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $5 - (i32.load offset=112 - (get_local $12) - ) - ) - ) - ) - (block $label$13 - (block $label$14 - (br_if $label$14 - (i32.eq - (tee_local $11 - (i32.load - (tee_local $6 - (i32.add - (get_local $12) - (i32.const 116) - ) - ) - ) - ) - (get_local $5) - ) - ) - (loop $label$15 - (set_local $1 - (i32.load - (tee_local $11 - (i32.add - (get_local $11) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (get_local $11) - (i32.const 0) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (br_if $label$15 - (i32.ne - (get_local $5) - (get_local $11) - ) - ) - ) - (set_local $11 - (i32.load - (i32.add - (get_local $12) - (i32.const 112) - ) - ) - ) - (br $label$13) - ) - (set_local $11 - (get_local $5) - ) - ) - (i32.store - (get_local $6) - (get_local $5) - ) - (call $_ZdlPv - (get_local $11) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $12) - (i32.const 128) - ) - ) - ) - (func $_ZN5eosio18unpack_action_dataINS_8currency6createEEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (set_local $6 - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $4) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $2 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (get_local $4) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $2) - (get_local $1) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (i64.const 1398362884) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $3 - (i64.const 5462355) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$2 - (block $label$3 - (loop $label$4 - (br_if $label$3 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$5 - (br_if $label$5 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$6 - (br_if $label$3 - (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$6 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $5 - (i32.const 1) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$2) - ) - ) - (set_local $5 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 80) - ) - (i32.store8 offset=26 - (get_local $0) - (i32.const 1) - ) - (i32.store16 offset=24 - (get_local $0) - (i32.const 257) - ) - (i32.store offset=4 - (get_local $6) - (get_local $2) - ) - (i32.store - (get_local $6) - (get_local $2) - ) - (i32.store offset=8 - (get_local $6) - (i32.add - (get_local $2) - (get_local $1) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_8currency6createE - (get_local $6) - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_8currency6createE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $1) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 25) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 26) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 1) - ) - ) - (get_local $0) - ) - (func $_ZN5eosio11multi_indexILy14289235522390851584ENS_8currency14currency_statsEJEE6modifyIZNS1_2onERKNS1_5issueEEUlRT_E_EEvRKS2_yOS8_ (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) - (local $4 i64) - (local $5 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $5 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=48 - (get_local $1) - ) - (get_local $0) - ) - (i32.const 400) - ) - (call $eosio_assert - (i64.eq - (i64.load - (get_local $0) - ) - (call $current_receiver) - ) - (i32.const 448) - ) - (i64.store - (get_local $1) - (i64.add - (i64.load - (get_local $1) - ) - (i64.load offset=8 - (i32.load - (get_local $3) - ) - ) - ) - ) - (set_local $4 - (i64.load offset=8 - (get_local $1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 544) - ) - (i32.store offset=56 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 45) - ) - ) - (i32.store offset=52 - (get_local $5) - (get_local $5) - ) - (i32.store offset=48 - (get_local $5) - (get_local $5) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_8currency14currency_statsE - (i32.add - (get_local $5) - (i32.const 48) - ) - (get_local $1) - ) - ) - (call $db_update_i64 - (i32.load offset=52 - (get_local $1) - ) - (get_local $2) - (get_local $5) - (i32.const 45) - ) - (block $label$0 - (br_if $label$0 - (i64.lt_u - (tee_local $2 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.load offset=16 - (get_local $0) - ) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (i64.add - (get_local $2) - (i64.const 1) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 64) - ) - ) - ) - (func $_ZN5eosio8currency15inline_transferEyyNS_5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEy (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i32) (param $4 i32) (param $5 i64) - (local $6 i64) - (local $7 i32) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i64) - (local $12 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $12 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (set_local $6 - (i64.load - (get_local $0) - ) - ) - (set_local $9 - (i64.const 0) - ) - (set_local $8 - (i64.const 59) - ) - (set_local $0 - (i32.const 1904) - ) - (set_local $10 - (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 $9) - (i64.const 7) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $7 - (i32.load8_s - (get_local $0) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $11 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $9) - (i64.const 11) - ) - ) - (br $label$1) - ) - (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 $11 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $7) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $11 - (i64.shl - (i64.and - (get_local $11) - (i64.const 31) - ) - (i64.and - (get_local $8) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (set_local $9 - (i64.add - (get_local $9) - (i64.const 1) - ) - ) - (set_local $10 - (i64.or - (get_local $11) - (get_local $10) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $8 - (i64.add - (get_local $8) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 28) - ) - (i32.load - (i32.add - (get_local $3) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 24) - ) - (i32.load - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 20) - ) - (i32.load - (i32.add - (get_local $3) - (i32.const 4) - ) - ) - ) - (i64.store offset=16 - (get_local $12) - (get_local $2) - ) - (i64.store offset=8 - (get_local $12) - (get_local $1) - ) - (i32.store offset=24 - (get_local $12) - (i32.load - (get_local $3) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 32) - ) - (get_local $4) - ) - ) - (i64.store offset=64 - (get_local $12) - (get_local $10) - ) - (i64.store offset=56 - (get_local $12) - (get_local $6) - ) - (i64.store - (tee_local $0 - (call $_Znwj - (i32.const 16) - ) - ) - (get_local $1) - ) - (i64.store offset=8 - (get_local $0) - (get_local $5) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 24) - ) - (tee_local $7 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 20) - ) - (get_local $7) - ) - (i32.store offset=72 - (get_local $12) - (get_local $0) - ) - (i32.store offset=84 - (get_local $12) - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 36) - ) - (i32.const 0) - ) - (set_local $0 - (i32.add - (tee_local $7 - (select - (i32.load - (i32.add - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.const 36) - ) - ) - (i32.shr_u - (tee_local $0 - (i32.load8_u offset=40 - (get_local $12) - ) - ) - (i32.const 1) - ) - (i32.and - (get_local $0) - (i32.const 1) - ) - ) - ) - (i32.const 32) - ) - ) - (set_local $9 - (i64.extend_u/i32 - (get_local $7) - ) - ) - (set_local $7 - (i32.add - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 28) - ) - ) - (loop $label$6 - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $9 - (i64.shr_u - (get_local $9) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$7 - (block $label$8 - (br_if $label$8 - (i32.eqz - (get_local $0) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $7) - (get_local $0) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $12) - (i32.const 88) - ) - ) - ) - (set_local $0 - (i32.load - (i32.add - (get_local $12) - (i32.const 84) - ) - ) - ) - (br $label$7) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - ) - (i32.store offset=100 - (get_local $12) - (get_local $0) - ) - (i32.store offset=96 - (get_local $12) - (get_local $0) - ) - (i32.store offset=104 - (get_local $12) - (get_local $7) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_8currency8transferE - (i32.add - (get_local $12) - (i32.const 96) - ) - (i32.add - (get_local $12) - (i32.const 8) - ) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.and - (i32.load8_u - (i32.add - (get_local $12) - (i32.const 40) - ) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $12) - (i32.const 48) - ) - ) - ) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $12) - (i32.const 8) - ) - (i32.add - (get_local $12) - (i32.const 56) - ) - ) - (call $send_inline - (tee_local $0 - (i32.load offset=8 - (get_local $12) - ) - ) - (i32.sub - (i32.load offset=12 - (get_local $12) - ) - (get_local $0) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $0 - (i32.load offset=8 - (get_local $12) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $12) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (tee_local $0 - (i32.load offset=84 - (get_local $12) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 88) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $0 - (i32.load offset=72 - (get_local $12) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 76) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $12) - (i32.const 112) - ) - ) - ) - (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 $_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 704) - ) - (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 688) - ) - (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 $_ZN5eosio6unpackINS_8exchange11covermarginEEET_PKcj (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 24) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $3 - (i64.const 5462355) - ) - (set_local $4 - (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 $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (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$4 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $5 - (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 $5 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 80) - ) - (call $eosio_assert - (i32.gt_u - (get_local $2) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $1) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (tee_local $4 - (i32.and - (get_local $2) - (i32.const -8) - ) - ) - (i32.const 8) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $4) - (i32.const 16) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 16) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $4) - (i32.const 24) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $4) - (i32.const 32) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 32) - ) - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.const 8) - ) - ) - ) - (func $_ZN5eosio8exchange8upmarginC2Ev (param $0 i32) (result i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $1 - (i64.shr_u - (i64.load - (get_local $2) - ) - (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 80) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 48) - ) - ) - (i64.const 1398362884) - ) - (i64.store offset=40 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (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 80) - ) - (get_local $0) - ) - (func $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRyRN5eosio11symbol_typeERNS6_14extended_assetESA_EEEZNS6_rsINS6_10datastreamIPKcEENS6_8exchange8upmarginELPv0EEERT_SL_RT0_EUlSL_E_JLj0ELj1ELj2ELj3EEEEvSL_OSM_NSt3__116integer_sequenceIjJXspT1_EEEENSQ_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 688) - ) - (drop - (call $memcpy - (get_local $3) - (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 688) - ) - (drop - (call $memcpy - (get_local $3) - (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=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 688) - ) - (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 688) - ) - (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) - (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 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 16) - ) - (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=12 - (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 688) - ) - (drop - (call $memcpy - (get_local $0) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $1 - (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 $1) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $1 - (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 $1) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 16) - ) - (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 $_ZN5eosio8exchange5tradeC2Ev (param $0 i32) (result i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $1 - (i64.shr_u - (i64.load - (get_local $2) - ) - (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 80) - ) - (i64.store - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 48) - ) - ) - (i64.const 1398362884) - ) - (i64.store offset=40 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (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 80) - ) - (i32.store8 offset=68 - (get_local $0) - (i32.const 1) - ) - (i32.store offset=64 - (get_local $0) - (i32.const 0) - ) - (get_local $0) - ) - (func $_ZN5boost3pfr6detail19for_each_field_implINS1_14sequence_tuple5tupleIJRyRN5eosio11symbol_typeERNS6_14extended_assetESA_RmRhEEEZNS6_rsINS6_10datastreamIPKcEENS6_8exchange5tradeELPv0EEERT_SN_RT0_EUlSN_E_JLj0ELj1ELj2ELj3ELj4ELj5EEEEvSN_OSO_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_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 688) - ) - (drop - (call $memcpy - (get_local $3) - (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 688) - ) - (drop - (call $memcpy - (get_local $3) - (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=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 688) - ) - (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 688) - ) - (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) - (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 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 16) - ) - (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=12 - (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 688) - ) - (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 688) - ) - (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) - (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 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $3) - (i32.const 16) - ) - (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=16 - (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 3) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $3) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $2) - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 4) - ) - ) - (set_local $0 - (i32.load offset=20 - (get_local $0) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load offset=8 - (tee_local $2 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $2) - ) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $0) - (i32.load offset=4 - (get_local $2) - ) - (i32.const 1) - ) - ) - (i32.store offset=4 - (get_local $2) - (i32.add - (i32.load offset=4 - (get_local $2) - ) - (i32.const 1) - ) - ) - ) - (func $_ZN5boost6fusion6detail17for_each_unrolledILi4EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyN5eosio11symbol_typeEdNS8_15extended_symbolEEEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyS9_dSA_EEERT_SJ_RNS7_IJDpT0_EEEEUlSJ_E_EEvRKSI_RKT0_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 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 688) - ) - (drop - (call $memcpy - (get_local $3) - (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 $2 - (i32.load - (get_local $0) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $0 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $2) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $0 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $2) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (tee_local $1 - (i32.load - (get_local $1) - ) - ) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $2) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $1) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $1) - (tee_local $0 - (i32.add - (i32.load offset=4 - (get_local $1) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $1) - ) - (get_local $0) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $2) - (i32.const 32) - ) - (i32.load offset=4 - (get_local $1) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $1) - (i32.add - (i32.load offset=4 - (get_local $1) - ) - (i32.const 8) - ) - ) - ) - (func $_ZN5eosio6unpackINSt3__15tupleIJyNS_11symbol_typeENS_14extended_assetEEEEEET_PKcj (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (i64.store - (get_local $0) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (i64.store - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 24) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $4 - (i64.const 5462355) - ) - (set_local $5 - (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 $4) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (i64.ne - (i64.and - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (br_if $label$4 - (i32.lt_s - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $6 - (i32.const 1) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$0) - ) - ) - (set_local $6 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 80) - ) - (call $eosio_assert - (i32.gt_u - (get_local $2) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $1) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (tee_local $5 - (i32.and - (get_local $2) - (i32.const -8) - ) - ) - (i32.const 8) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $5) - (i32.const 16) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 16) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $5) - (i32.const 24) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $5) - (i32.const 32) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $3) - (i32.add - (get_local $1) - (i32.const 32) - ) - (i32.const 8) - ) - ) - ) - (func $_ZN5eosio6unpackINSt3__15tupleIJyNS_5assetEmNS_14extended_assetES4_EEEEET_PKcj (param $0 i32) (param $1 i32) (param $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 offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $3 - (i64.const 5462355) - ) - (set_local $4 - (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 $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$3 - (br_if $label$3 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$4 - (br_if $label$1 - (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$4 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $5 - (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 $5 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 80) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 48) - ) - (i64.const 0) - ) - (i32.store offset=24 - (get_local $0) - (i32.const 0) - ) - (i64.store offset=32 - (get_local $0) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 40) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $3 - (i64.const 5462355) - ) - (set_local $4 - (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 $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$8 - (br_if $label$8 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$9 - (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) - ) - ) - (br_if $label$9 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $5 - (i32.const 1) - ) - (br_if $label$7 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$5) - ) - ) - (set_local $5 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 80) - ) - (i64.store offset=56 - (get_local $0) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 72) - ) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 64) - ) - (i64.const 1398362884) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 16) - ) - (set_local $3 - (i64.const 5462355) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$10 - (block $label$11 - (loop $label$12 - (br_if $label$11 - (i32.gt_u - (i32.add - (i32.shl - (i32.wrap/i64 - (get_local $3) - ) - (i32.const 24) - ) - (i32.const -1073741825) - ) - (i32.const 452984830) - ) - ) - (block $label$13 - (br_if $label$13 - (i64.ne - (i64.and - (tee_local $3 - (i64.shr_u - (get_local $3) - (i64.const 8) - ) - ) - (i64.const 255) - ) - (i64.const 0) - ) - ) - (loop $label$14 - (br_if $label$11 - (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$14 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - ) - ) - (set_local $5 - (i32.const 1) - ) - (br_if $label$12 - (i32.lt_s - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 7) - ) - ) - (br $label$10) - ) - ) - (set_local $5 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $5) - (i32.const 80) - ) - (i32.store offset=4 - (get_local $6) - (get_local $1) - ) - (i32.store - (get_local $6) - (get_local $1) - ) - (i32.store offset=8 - (get_local $6) - (i32.add - (get_local $1) - (get_local $2) - ) - ) - (i32.store offset=16 - (get_local $6) - (get_local $6) - ) - (i32.store offset=24 - (get_local $6) - (get_local $0) - ) - (call $_ZN5boost6fusion6detail17for_each_unrolledILi5EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyN5eosio5assetEmNS8_14extended_assetESA_EEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyS9_mSA_SA_EEERT_SJ_RNS7_IJDpT0_EEEEUlSJ_E_EEvRKSI_RKT0_ - (i32.add - (get_local $6) - (i32.const 24) - ) - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $6) - (i32.const 32) - ) - ) - ) - (func $_ZN5boost6fusion6detail17for_each_unrolledILi5EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyN5eosio5assetEmNS8_14extended_assetESA_EEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyS9_mSA_SA_EEERT_SJ_RNS7_IJDpT0_EEEEUlSJ_E_EEvRKSI_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 688) - ) - (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 688) - ) - (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) - (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 688) - ) - (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 3) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (i32.load offset=4 - (get_local $3) - ) - (i32.const 4) - ) - ) - (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 688) - ) - (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) - (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 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 40) - ) - (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 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 48) - ) - (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 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 56) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (tee_local $1 - (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 $1) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 64) - ) - (i32.load offset=4 - (get_local $3) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $3) - (tee_local $1 - (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 $1) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 72) - ) - (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) - ) - ) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_8currency8transferE (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (get_local $1) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 7) - ) - (i32.const 688) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $0) - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 8) - ) - ) - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE - (get_local $0) - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - ) - (func $apply (param $0 i64) (param $1 i64) (param $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 48) - ) - ) - ) - (i64.store - (i32.add - (get_local $3) - (i32.const 32) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $3) - (i32.const 40) - ) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $3) - (get_local $0) - ) - (i64.store offset=8 - (get_local $3) - (get_local $0) - ) - (i64.store offset=24 - (get_local $3) - (get_local $0) - ) - (call $_ZN5eosio8exchange5applyEyy - (i32.add - (get_local $3) - (i32.const 8) - ) - (get_local $1) - (get_local $2) - ) - (call $eosio_exit - (i32.const 0) - ) - (unreachable) - ) - (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=3648 - (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__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) - (local $5 i32) - (local $6 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (tee_local $5 - (i32.and - (tee_local $6 - (i32.load8_u - (get_local $0) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $6 - (i32.shr_u - (get_local $6) - (i32.const 1) - ) - ) - (br $label$0) - ) - (set_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (block $label$2 - (br_if $label$2 - (i32.eq - (get_local $4) - (i32.const -1) - ) - ) - (br_if $label$2 - (i32.lt_u - (get_local $6) - (get_local $1) - ) - ) - (set_local $6 - (select - (tee_local $6 - (i32.sub - (get_local $6) - (get_local $1) - ) - ) - (get_local $2) - (i32.lt_u - (get_local $6) - (get_local $2) - ) - ) - ) - (block $label$3 - (block $label$4 - (br_if $label$4 - (get_local $5) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (br $label$3) - ) - (set_local $0 - (i32.load offset=8 - (get_local $0) - ) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (tee_local $2 - (select - (get_local $4) - (get_local $6) - (tee_local $5 - (i32.gt_u - (get_local $6) - (get_local $4) - ) - ) - ) - ) - ) - ) - (br_if $label$5 - (i32.eqz - (tee_local $1 - (call $memcmp - (i32.add - (get_local $0) - (get_local $1) - ) - (get_local $3) - (get_local $2) - ) - ) - ) - ) - (return - (get_local $1) - ) - ) - (return - (select - (i32.const -1) - (get_local $5) - (i32.lt_u - (get_local $6) - (get_local $4) - ) - ) - ) - ) - (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 $pow (param $0 f64) (param $1 f64) (result f64) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 f64) - (local $11 i64) - (local $12 f64) - (local $13 f64) - (local $14 f64) - (local $15 f64) - (local $16 f64) - (local $17 f64) - (local $18 f64) - (local $19 i32) - (local $20 f64) - (local $21 f64) - (set_local $21 - (f64.const 1) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (i32.or - (tee_local $8 - (i32.and - (tee_local $5 - (i32.wrap/i64 - (i64.shr_u - (tee_local $4 - (i64.reinterpret/f64 - (get_local $1) - ) - ) - (i64.const 32) - ) - ) - ) - (i32.const 2147483647) - ) - ) - (tee_local $6 - (i32.wrap/i64 - (get_local $4) - ) - ) - ) - ) - ) - (set_local $2 - (i32.wrap/i64 - (i64.shr_u - (tee_local $11 - (i64.reinterpret/f64 - (get_local $0) - ) - ) - (i64.const 32) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (tee_local $3 - (i32.wrap/i64 - (get_local $11) - ) - ) - ) - (br_if $label$0 - (i32.eq - (get_local $2) - (i32.const 1072693248) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $7 - (i32.and - (get_local $2) - (i32.const 2147483647) - ) - ) - (i32.const 2146435072) - ) - ) - (br_if $label$3 - (i32.and - (i32.ne - (get_local $3) - (i32.const 0) - ) - (i32.eq - (get_local $7) - (i32.const 2146435072) - ) - ) - ) - (br_if $label$3 - (i32.gt_u - (get_local $8) - (i32.const 2146435072) - ) - ) - (br_if $label$2 - (i32.eqz - (get_local $6) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $8) - (i32.const 2146435072) - ) - ) - ) - (return - (f64.add - (get_local $0) - (get_local $1) - ) - ) - ) - (set_local $19 - (i32.const 0) - ) - (block $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.gt_s - (get_local $2) - (i32.const -1) - ) - ) - (set_local $19 - (i32.const 2) - ) - (br_if $label$7 - (i32.gt_u - (get_local $8) - (i32.const 1128267775) - ) - ) - (set_local $19 - (i32.const 0) - ) - (br_if $label$7 - (i32.lt_u - (get_local $8) - (i32.const 1072693248) - ) - ) - (br_if $label$6 - (i32.lt_s - (i32.add - (tee_local $9 - (i32.shr_u - (get_local $8) - (i32.const 20) - ) - ) - (i32.const -1023) - ) - (i32.const 21) - ) - ) - (set_local $19 - (select - (i32.sub - (i32.const 2) - (i32.and - (tee_local $9 - (i32.shr_u - (get_local $6) - (tee_local $19 - (i32.sub - (i32.const 1075) - (get_local $9) - ) - ) - ) - ) - (i32.const 1) - ) - ) - (i32.const 0) - (i32.eq - (i32.shl - (get_local $9) - (get_local $19) - ) - (get_local $6) - ) - ) - ) - ) - (br_if $label$5 - (i32.eqz - (get_local $6) - ) - ) - (br $label$4) - ) - (set_local $19 - (i32.const 0) - ) - (br_if $label$4 - (get_local $6) - ) - (set_local $19 - (select - (i32.sub - (i32.const 2) - (i32.and - (tee_local $19 - (i32.shr_u - (get_local $8) - (tee_local $6 - (i32.sub - (i32.const 1043) - (get_local $9) - ) - ) - ) - ) - (i32.const 1) - ) - ) - (i32.const 0) - (i32.eq - (i32.shl - (get_local $19) - (get_local $6) - ) - (get_local $8) - ) - ) - ) - ) - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i32.ne - (get_local $8) - (i32.const 2146435072) - ) - ) - (br_if $label$0 - (i32.eqz - (i32.or - (i32.add - (get_local $7) - (i32.const -1072693248) - ) - (get_local $3) - ) - ) - ) - (br_if $label$10 - (i32.lt_u - (get_local $7) - (i32.const 1072693248) - ) - ) - (return - (select - (get_local $1) - (f64.const 0) - (i32.gt_s - (get_local $5) - (i32.const -1) - ) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.ne - (get_local $8) - (i32.const 1072693248) - ) - ) - (br_if $label$8 - (i32.le_s - (get_local $5) - (i32.const -1) - ) - ) - (return - (get_local $0) - ) - ) - (br_if $label$9 - (i32.ne - (get_local $5) - (i32.const 1073741824) - ) - ) - (return - (f64.mul - (get_local $0) - (get_local $0) - ) - ) - ) - (return - (select - (f64.const 0) - (f64.neg - (get_local $1) - ) - (i32.gt_s - (get_local $5) - (i32.const -1) - ) - ) - ) - ) - (br_if $label$4 - (i32.lt_s - (get_local $2) - (i32.const 0) - ) - ) - (br_if $label$4 - (i32.ne - (get_local $5) - (i32.const 1071644672) - ) - ) - (return - (call $sqrt - (get_local $0) - ) - ) - ) - (return - (f64.div - (f64.const 1) - (get_local $0) - ) - ) - ) - (set_local $21 - (call $fabs - (get_local $0) - ) - ) - (block $label$13 - (block $label$14 - (block $label$15 - (block $label$16 - (block $label$17 - (br_if $label$17 - (get_local $3) - ) - (br_if $label$16 - (i32.eqz - (get_local $7) - ) - ) - (br_if $label$16 - (i32.eq - (i32.or - (get_local $7) - (i32.const 1073741824) - ) - (i32.const 2146435072) - ) - ) - ) - (set_local $10 - (f64.const 1) - ) - (br_if $label$13 - (i32.gt_s - (get_local $2) - (i32.const -1) - ) - ) - (br_if $label$15 - (i32.eq - (get_local $19) - (i32.const 1) - ) - ) - (br_if $label$13 - (get_local $19) - ) - (return - (f64.div - (tee_local $1 - (f64.sub - (get_local $0) - (get_local $0) - ) - ) - (get_local $1) - ) - ) - ) - (set_local $21 - (select - (f64.div - (f64.const 1) - (get_local $21) - ) - (get_local $21) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (br_if $label$0 - (i32.gt_s - (get_local $2) - (i32.const -1) - ) - ) - (br_if $label$14 - (i32.eqz - (i32.or - (get_local $19) - (i32.add - (get_local $7) - (i32.const -1072693248) - ) - ) - ) - ) - (return - (select - (f64.neg - (get_local $21) - ) - (get_local $21) - (i32.eq - (get_local $19) - (i32.const 1) - ) - ) - ) - ) - (set_local $10 - (f64.const -1) - ) - (br $label$13) - ) - (return - (f64.div - (tee_local $1 - (f64.sub - (get_local $21) - (get_local $21) - ) - ) - (get_local $1) - ) - ) - ) - (block $label$18 - (block $label$19 - (block $label$20 - (block $label$21 - (block $label$22 - (block $label$23 - (block $label$24 - (block $label$25 - (block $label$26 - (block $label$27 - (br_if $label$27 - (i32.lt_u - (get_local $8) - (i32.const 1105199105) - ) - ) - (br_if $label$26 - (i32.lt_u - (get_local $8) - (i32.const 1139802113) - ) - ) - (br_if $label$23 - (i32.gt_u - (get_local $7) - (i32.const 1072693247) - ) - ) - (return - (select - (f64.const inf) - (f64.const 0) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - ) - (set_local $8 - (i32.const 0) - ) - (br_if $label$25 - (i32.gt_u - (get_local $7) - (i32.const 1048575) - ) - ) - (set_local $7 - (i32.wrap/i64 - (i64.shr_u - (i64.reinterpret/f64 - (tee_local $21 - (f64.mul - (get_local $21) - (f64.const 9007199254740992) - ) - ) - ) - (i64.const 32) - ) - ) - ) - (set_local $5 - (i32.const -53) - ) - (br $label$24) - ) - (br_if $label$22 - (i32.gt_u - (get_local $7) - (i32.const 1072693246) - ) - ) - (return - (f64.mul - (tee_local $1 - (select - (f64.const 1.e+300) - (f64.const 1e-300) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (f64.mul - (get_local $1) - (get_local $10) - ) - ) - ) - ) - (set_local $5 - (i32.const 0) - ) - ) - (set_local $2 - (i32.or - (tee_local $6 - (i32.and - (get_local $7) - (i32.const 1048575) - ) - ) - (i32.const 1072693248) - ) - ) - (set_local $5 - (i32.add - (i32.add - (i32.shr_s - (get_local $7) - (i32.const 20) - ) - (get_local $5) - ) - (i32.const -1023) - ) - ) - (br_if $label$20 - (i32.lt_u - (get_local $6) - (i32.const 235663) - ) - ) - (br_if $label$21 - (i32.ge_u - (get_local $6) - (i32.const 767610) - ) - ) - (set_local $8 - (i32.const 1) - ) - (br $label$20) - ) - (return - (select - (f64.const inf) - (f64.const 0) - (i32.gt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - ) - (br_if $label$19 - (i32.lt_u - (get_local $7) - (i32.const 1072693249) - ) - ) - (return - (f64.mul - (tee_local $1 - (select - (f64.const 1.e+300) - (f64.const 1e-300) - (i32.gt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (f64.mul - (get_local $1) - (get_local $10) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const -1048576) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - ) - (set_local $20 - (f64.sub - (f64.sub - (f64.sub - (tee_local $0 - (f64.reinterpret/i64 - (i64.and - (i64.reinterpret/f64 - (f64.add - (tee_local $20 - (f64.convert_s/i32 - (get_local $5) - ) - ) - (f64.add - (tee_local $18 - (f64.load - (i32.add - (tee_local $6 - (i32.shl - (get_local $8) - (i32.const 3) - ) - ) - (i32.const 3696) - ) - ) - ) - (f64.add - (tee_local $12 - (f64.mul - (tee_local $0 - (f64.reinterpret/i64 - (i64.and - (i64.reinterpret/f64 - (f64.add - (tee_local $14 - (f64.mul - (tee_local $0 - (f64.reinterpret/i64 - (i64.and - (i64.reinterpret/f64 - (tee_local $21 - (f64.mul - (tee_local $14 - (f64.sub - (tee_local $12 - (f64.reinterpret/i64 - (i64.or - (i64.shl - (i64.extend_u/i32 - (get_local $2) - ) - (i64.const 32) - ) - (i64.and - (i64.reinterpret/f64 - (get_local $21) - ) - (i64.const 4294967295) - ) - ) - ) - ) - (tee_local $13 - (f64.load - (i32.add - (get_local $6) - (i32.const 3664) - ) - ) - ) - ) - ) - (tee_local $15 - (f64.div - (f64.const 1) - (f64.add - (get_local $13) - (get_local $12) - ) - ) - ) - ) - ) - ) - (i64.const -4294967296) - ) - ) - ) - (tee_local $0 - (f64.reinterpret/i64 - (i64.and - (i64.reinterpret/f64 - (f64.add - (f64.add - (tee_local $17 - (f64.mul - (get_local $0) - (get_local $0) - ) - ) - (f64.const 3) - ) - (tee_local $13 - (f64.add - (f64.mul - (f64.add - (get_local $21) - (get_local $0) - ) - (tee_local $12 - (f64.mul - (get_local $15) - (f64.sub - (f64.sub - (get_local $14) - (f64.mul - (get_local $0) - (tee_local $16 - (f64.reinterpret/i64 - (i64.shl - (i64.extend_u/i32 - (i32.add - (i32.add - (i32.or - (i32.shr_s - (get_local $2) - (i32.const 1) - ) - (i32.const 536870912) - ) - (i32.shl - (get_local $8) - (i32.const 18) - ) - ) - (i32.const 524288) - ) - ) - (i64.const 32) - ) - ) - ) - ) - ) - (f64.mul - (get_local $0) - (f64.sub - (get_local $12) - (f64.sub - (get_local $16) - (get_local $13) - ) - ) - ) - ) - ) - ) - ) - (f64.mul - (f64.mul - (tee_local $0 - (f64.mul - (get_local $21) - (get_local $21) - ) - ) - (get_local $0) - ) - (f64.add - (f64.mul - (get_local $0) - (f64.add - (f64.mul - (get_local $0) - (f64.add - (f64.mul - (get_local $0) - (f64.add - (f64.mul - (get_local $0) - (f64.add - (f64.mul - (get_local $0) - (f64.const 0.20697501780033842) - ) - (f64.const 0.23066074577556175) - ) - ) - (f64.const 0.272728123808534) - ) - ) - (f64.const 0.33333332981837743) - ) - ) - (f64.const 0.4285714285785502) - ) - ) - (f64.const 0.5999999999999946) - ) - ) - ) - ) - ) - ) - (i64.const -4294967296) - ) - ) - ) - ) - ) - (tee_local $21 - (f64.add - (f64.mul - (get_local $12) - (get_local $0) - ) - (f64.mul - (get_local $21) - (f64.sub - (get_local $13) - (f64.sub - (f64.add - (get_local $0) - (f64.const -3) - ) - (get_local $17) - ) - ) - ) - ) - ) - ) - ) - (i64.const -4294967296) - ) - ) - ) - (f64.const 0.9617967009544373) - ) - ) - (tee_local $13 - (f64.add - (f64.load - (i32.add - (get_local $6) - (i32.const 3680) - ) - ) - (f64.add - (f64.mul - (f64.sub - (get_local $21) - (f64.sub - (get_local $0) - (get_local $14) - ) - ) - (f64.const 0.9617966939259756) - ) - (f64.mul - (get_local $0) - (f64.const -7.028461650952758e-09) - ) - ) - ) - ) - ) - ) - ) - ) - (i64.const -4294967296) - ) - ) - ) - (get_local $20) - ) - (get_local $18) - ) - (get_local $12) - ) - ) - (br $label$18) - ) - (set_local $20 - (f64.sub - (tee_local $0 - (f64.reinterpret/i64 - (i64.and - (i64.reinterpret/f64 - (f64.add - (tee_local $21 - (f64.mul - (tee_local $0 - (f64.add - (get_local $21) - (f64.const -1) - ) - ) - (f64.const 1.4426950216293335) - ) - ) - (tee_local $13 - (f64.add - (f64.mul - (get_local $0) - (f64.const 1.9259629911266175e-08) - ) - (f64.mul - (f64.mul - (f64.mul - (get_local $0) - (get_local $0) - ) - (f64.sub - (f64.const 0.5) - (f64.mul - (get_local $0) - (f64.add - (f64.mul - (get_local $0) - (f64.const -0.25) - ) - (f64.const 0.3333333333333333) - ) - ) - ) - ) - (f64.const -1.4426950408889634) - ) - ) - ) - ) - ) - (i64.const -4294967296) - ) - ) - ) - (get_local $21) - ) - ) - ) - (set_local $8 - (i32.wrap/i64 - (tee_local $4 - (i64.reinterpret/f64 - (tee_local $0 - (f64.add - (tee_local $21 - (f64.mul - (tee_local $12 - (f64.reinterpret/i64 - (i64.and - (get_local $4) - (i64.const -4294967296) - ) - ) - ) - (get_local $0) - ) - ) - (tee_local $1 - (f64.add - (f64.mul - (f64.sub - (get_local $1) - (get_local $12) - ) - (get_local $0) - ) - (f64.mul - (f64.sub - (get_local $13) - (get_local $20) - ) - (get_local $1) - ) - ) - ) - ) - ) - ) - ) - ) - ) - (block $label$28 - (block $label$29 - (block $label$30 - (block $label$31 - (block $label$32 - (br_if $label$32 - (i32.lt_s - (tee_local $2 - (i32.wrap/i64 - (i64.shr_u - (get_local $4) - (i64.const 32) - ) - ) - ) - (i32.const 1083179008) - ) - ) - (br_if $label$31 - (i32.eqz - (i32.or - (i32.add - (get_local $2) - (i32.const -1083179008) - ) - (get_local $8) - ) - ) - ) - (return - (f64.mul - (f64.mul - (get_local $10) - (f64.const 1.e+300) - ) - (f64.const 1.e+300) - ) - ) - ) - (br_if $label$29 - (i32.lt_u - (i32.and - (get_local $2) - (i32.const 2147482624) - ) - (i32.const 1083231232) - ) - ) - (br_if $label$30 - (i32.eqz - (i32.or - (i32.add - (get_local $2) - (i32.const 1064252416) - ) - (get_local $8) - ) - ) - ) - (return - (f64.mul - (f64.mul - (get_local $10) - (f64.const 1e-300) - ) - (f64.const 1e-300) - ) - ) - ) - (br_if $label$29 - (i32.or - (f64.le - (tee_local $12 - (f64.add - (get_local $1) - (f64.const 8.008566259537294e-17) - ) - ) - (tee_local $0 - (f64.sub - (get_local $0) - (get_local $21) - ) - ) - ) - (i32.or - (f64.ne - (get_local $12) - (get_local $12) - ) - (f64.ne - (get_local $0) - (get_local $0) - ) - ) - ) - ) - (return - (f64.mul - (f64.mul - (get_local $10) - (f64.const 1.e+300) - ) - (f64.const 1.e+300) - ) - ) - ) - (br_if $label$28 - (i32.eqz - (i32.or - (f64.gt - (get_local $1) - (tee_local $0 - (f64.sub - (get_local $0) - (get_local $21) - ) - ) - ) - (i32.or - (f64.ne - (get_local $1) - (get_local $1) - ) - (f64.ne - (get_local $0) - (get_local $0) - ) - ) - ) - ) - ) - ) - (block $label$33 - (block $label$34 - (br_if $label$34 - (i32.lt_u - (tee_local $8 - (i32.and - (get_local $2) - (i32.const 2147483647) - ) - ) - (i32.const 1071644673) - ) - ) - (set_local $2 - (select - (i32.sub - (i32.const 0) - (tee_local $5 - (i32.shr_u - (i32.or - (i32.and - (tee_local $8 - (i32.add - (i32.shr_u - (i32.const 1048576) - (i32.add - (i32.shr_u - (get_local $8) - (i32.const 20) - ) - (i32.const -1022) - ) - ) - (get_local $2) - ) - ) - (i32.const 1048575) - ) - (i32.const 1048576) - ) - (i32.sub - (i32.const 1043) - (tee_local $6 - (i32.and - (i32.shr_u - (get_local $8) - (i32.const 20) - ) - (i32.const 2047) - ) - ) - ) - ) - ) - ) - (get_local $5) - (i32.lt_s - (get_local $2) - (i32.const 0) - ) - ) - ) - (set_local $21 - (f64.sub - (get_local $21) - (f64.reinterpret/i64 - (i64.shl - (i64.extend_u/i32 - (i32.and - (get_local $8) - (i32.xor - (i32.shr_u - (i32.const 1048575) - (i32.add - (get_local $6) - (i32.const -1023) - ) - ) - (i32.const -1) - ) - ) - ) - (i64.const 32) - ) - ) - ) - ) - (br $label$33) - ) - (set_local $2 - (i32.const 0) - ) - ) - (block $label$35 - (br_if $label$35 - (i32.le_s - (i32.shr_s - (tee_local $8 - (i32.add - (i32.wrap/i64 - (i64.shr_u - (tee_local $4 - (i64.reinterpret/f64 - (tee_local $1 - (f64.sub - (f64.const 1) - (f64.sub - (f64.sub - (f64.div - (f64.mul - (tee_local $1 - (f64.add - (tee_local $12 - (f64.mul - (tee_local $0 - (f64.reinterpret/i64 - (i64.and - (i64.reinterpret/f64 - (f64.add - (get_local $1) - (get_local $21) - ) - ) - (i64.const -4294967296) - ) - ) - ) - (f64.const 0.6931471824645996) - ) - ) - (tee_local $21 - (f64.add - (f64.mul - (f64.sub - (get_local $1) - (f64.sub - (get_local $0) - (get_local $21) - ) - ) - (f64.const 0.6931471805599453) - ) - (f64.mul - (get_local $0) - (f64.const -1.904654299957768e-09) - ) - ) - ) - ) - ) - (tee_local $0 - (f64.sub - (get_local $1) - (f64.mul - (tee_local $0 - (f64.mul - (get_local $1) - (get_local $1) - ) - ) - (f64.add - (f64.mul - (get_local $0) - (f64.add - (f64.mul - (get_local $0) - (f64.add - (f64.mul - (get_local $0) - (f64.add - (f64.mul - (get_local $0) - (f64.const 4.1381367970572385e-08) - ) - (f64.const -1.6533902205465252e-06) - ) - ) - (f64.const 6.613756321437934e-05) - ) - ) - (f64.const -2.7777777777015593e-03) - ) - ) - (f64.const 0.16666666666666602) - ) - ) - ) - ) - ) - (f64.add - (get_local $0) - (f64.const -2) - ) - ) - (f64.add - (tee_local $0 - (f64.sub - (get_local $21) - (f64.sub - (get_local $1) - (get_local $12) - ) - ) - ) - (f64.mul - (get_local $1) - (get_local $0) - ) - ) - ) - (get_local $1) - ) - ) - ) - ) - ) - (i64.const 32) - ) - ) - (i32.shl - (get_local $2) - (i32.const 20) - ) - ) - ) - (i32.const 20) - ) - (i32.const 0) - ) - ) - (return - (f64.mul - (get_local $10) - (f64.reinterpret/i64 - (i64.or - (i64.shl - (i64.extend_u/i32 - (get_local $8) - ) - (i64.const 32) - ) - (i64.and - (get_local $4) - (i64.const 4294967295) - ) - ) - ) - ) - ) - ) - (return - (f64.mul - (get_local $10) - (call $scalbn - (get_local $1) - (get_local $2) - ) - ) - ) - ) - (return - (f64.mul - (f64.mul - (get_local $10) - (f64.const 1e-300) - ) - (f64.const 1e-300) - ) - ) - ) - (get_local $21) - ) - (func $sqrt (param $0 f64) (result f64) - (local $1 i64) - (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) - (block $label$0 - (br_if $label$0 - (i32.ne - (i32.and - (tee_local $7 - (i32.wrap/i64 - (i64.shr_u - (tee_local $1 - (i64.reinterpret/f64 - (get_local $0) - ) - ) - (i64.const 32) - ) - ) - ) - (i32.const 2146435072) - ) - (i32.const 2146435072) - ) - ) - (return - (f64.add - (f64.mul - (get_local $0) - (get_local $0) - ) - (get_local $0) - ) - ) - ) - (set_local $2 - (i32.wrap/i64 - (get_local $1) - ) - ) - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.le_s - (get_local $7) - (i32.const 0) - ) - ) - (br_if $label$3 - (tee_local $8 - (i32.wrap/i64 - (i64.shr_u - (get_local $1) - (i64.const 52) - ) - ) - ) - ) - (set_local $8 - (i32.const 1) - ) - (set_local $9 - (get_local $2) - ) - (br $label$4) - ) - (br_if $label$2 - (i32.eqz - (i32.or - (i32.and - (get_local $7) - (i32.const 2147483647) - ) - (get_local $2) - ) - ) - ) - (br_if $label$1 - (i32.lt_s - (get_local $7) - (i32.const 0) - ) - ) - (set_local $8 - (i32.const 1) - ) - (loop $label$6 - (set_local $8 - (i32.add - (get_local $8) - (i32.const -21) - ) - ) - (set_local $7 - (i32.shr_u - (get_local $2) - (i32.const 11) - ) - ) - (set_local $2 - (tee_local $9 - (i32.shl - (get_local $2) - (i32.const 21) - ) - ) - ) - (br_if $label$6 - (i32.eqz - (get_local $7) - ) - ) - ) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$7 - (br_if $label$7 - (i32.and - (get_local $7) - (i32.const 1048576) - ) - ) - (set_local $5 - (i32.const 0) - ) - (loop $label$8 - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (br_if $label$8 - (i32.eqz - (i32.and - (tee_local $7 - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - (i32.const 1048576) - ) - ) - ) - ) - ) - (set_local $2 - (i32.shl - (get_local $9) - (get_local $5) - ) - ) - (set_local $8 - (i32.sub - (get_local $8) - (get_local $5) - ) - ) - (set_local $7 - (i32.or - (i32.shr_u - (get_local $9) - (i32.sub - (i32.const 32) - (get_local $5) - ) - ) - (get_local $7) - ) - ) - ) - (set_local $7 - (i32.or - (i32.and - (get_local $7) - (i32.const 1048575) - ) - (i32.const 1048576) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.and - (tee_local $10 - (i32.add - (get_local $8) - (i32.const -1023) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $7 - (i32.or - (i32.shl - (get_local $7) - (i32.const 1) - ) - (i32.shr_u - (get_local $2) - (i32.const 31) - ) - ) - ) - (set_local $2 - (i32.shl - (get_local $2) - (i32.const 1) - ) - ) - ) - (set_local $7 - (i32.or - (i32.shr_u - (get_local $2) - (i32.const 31) - ) - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - ) - (set_local $5 - (i32.shl - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i32.const 0) - ) - (set_local $9 - (i32.const 2097152) - ) - (set_local $8 - (i32.const 0) - ) - (loop $label$10 - (set_local $6 - (get_local $5) - ) - (block $label$11 - (br_if $label$11 - (i32.lt_s - (get_local $7) - (tee_local $5 - (i32.add - (get_local $9) - (get_local $8) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $9) - (get_local $4) - ) - ) - (set_local $7 - (i32.sub - (get_local $7) - (get_local $5) - ) - ) - (set_local $8 - (i32.add - (get_local $5) - (get_local $9) - ) - ) - ) - (set_local $7 - (i32.or - (i32.shl - (get_local $7) - (i32.const 1) - ) - (i32.and - (i32.shr_u - (get_local $2) - (i32.const 30) - ) - (i32.const 1) - ) - ) - ) - (set_local $5 - (i32.shl - (get_local $6) - (i32.const 1) - ) - ) - (set_local $2 - (get_local $6) - ) - (br_if $label$10 - (tee_local $9 - (i32.shr_u - (get_local $9) - (i32.const 1) - ) - ) - ) - ) - (set_local $3 - (i32.shr_u - (get_local $10) - (i32.const 1) - ) - ) - (set_local $9 - (i32.const -2147483648) - ) - (set_local $10 - (i32.const 0) - ) - (set_local $2 - (i32.const 0) - ) - (loop $label$12 - (set_local $6 - (i32.add - (get_local $2) - (get_local $9) - ) - ) - (block $label$13 - (block $label$14 - (br_if $label$14 - (i32.gt_s - (get_local $7) - (get_local $8) - ) - ) - (br_if $label$13 - (i32.ne - (get_local $7) - (get_local $8) - ) - ) - (br_if $label$13 - (i32.lt_u - (get_local $5) - (get_local $6) - ) - ) - ) - (set_local $7 - (i32.add - (i32.sub - (get_local $7) - (get_local $8) - ) - (select - (i32.const -1) - (i32.const 0) - (i32.lt_u - (get_local $5) - (get_local $6) - ) - ) - ) - ) - (set_local $8 - (i32.add - (i32.and - (i32.lt_s - (get_local $6) - (i32.const 0) - ) - (i32.gt_s - (tee_local $2 - (i32.add - (get_local $6) - (get_local $9) - ) - ) - (i32.const -1) - ) - ) - (get_local $8) - ) - ) - (set_local $10 - (i32.add - (get_local $10) - (get_local $9) - ) - ) - (set_local $5 - (i32.sub - (get_local $5) - (get_local $6) - ) - ) - ) - (set_local $7 - (i32.or - (i32.shr_u - (get_local $5) - (i32.const 31) - ) - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - ) - (set_local $5 - (i32.shl - (get_local $5) - (i32.const 1) - ) - ) - (br_if $label$12 - (tee_local $9 - (i32.shr_u - (get_local $9) - (i32.const 1) - ) - ) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (i32.or - (get_local $5) - (get_local $7) - ) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eq - (get_local $10) - (i32.const -1) - ) - ) - (set_local $10 - (i32.add - (i32.and - (get_local $10) - (i32.const 1) - ) - (get_local $10) - ) - ) - (br $label$15) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $10 - (i32.const 0) - ) - ) - (set_local $0 - (f64.reinterpret/i64 - (i64.or - (i64.shl - (i64.extend_u/i32 - (i32.add - (i32.add - (i32.shl - (get_local $3) - (i32.const 20) - ) - (i32.shr_s - (get_local $4) - (i32.const 1) - ) - ) - (i32.const 1071644672) - ) - ) - (i64.const 32) - ) - (i64.extend_u/i32 - (i32.or - (i32.shr_u - (get_local $10) - (i32.const 1) - ) - (i32.shl - (get_local $4) - (i32.const 31) - ) - ) - ) - ) - ) - ) - ) - (return - (get_local $0) - ) - ) - (f64.div - (tee_local $0 - (f64.sub - (get_local $0) - (get_local $0) - ) - ) - (get_local $0) - ) - ) - (func $fabs (param $0 f64) (result f64) - (f64.reinterpret/i64 - (i64.and - (i64.reinterpret/f64 - (get_local $0) - ) - (i64.const 9223372036854775807) - ) - ) - ) - (func $scalbn (param $0 f64) (param $1 i32) (result f64) - (local $2 i32) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.lt_s - (get_local $1) - (i32.const 1024) - ) - ) - (set_local $0 - (f64.mul - (get_local $0) - (f64.const 8988465674311579538646525e283) - ) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $2 - (i32.add - (get_local $1) - (i32.const -1023) - ) - ) - (i32.const 1024) - ) - ) - (set_local $1 - (select - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -2046) - ) - ) - (i32.const 1023) - (i32.lt_s - (get_local $1) - (i32.const 1023) - ) - ) - ) - (set_local $0 - (f64.mul - (get_local $0) - (f64.const 8988465674311579538646525e283) - ) - ) - (br $label$0) - ) - (br_if $label$0 - (i32.gt_s - (get_local $1) - (i32.const -1023) - ) - ) - (set_local $0 - (f64.mul - (get_local $0) - (f64.const 2.004168360008973e-292) - ) - ) - (br_if $label$1 - (i32.gt_s - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 969) - ) - ) - (i32.const -1023) - ) - ) - (set_local $1 - (select - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1938) - ) - ) - (i32.const -1022) - (i32.gt_s - (get_local $1) - (i32.const -1022) - ) - ) - ) - (set_local $0 - (f64.mul - (get_local $0) - (f64.const 2.004168360008973e-292) - ) - ) - (br $label$0) - ) - (set_local $1 - (get_local $2) - ) - (br $label$0) - ) - (set_local $1 - (get_local $2) - ) - ) - (f64.mul - (get_local $0) - (f64.reinterpret/i64 - (i64.shl - (i64.extend_u/i32 - (i32.add - (get_local $1) - (i32.const 1023) - ) - ) - (i64.const 52) - ) - ) - ) - ) - (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 $strlen (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (set_local $2 - (get_local $0) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (get_local $0) - (i32.const 3) - ) - ) - ) - (set_local $2 - (get_local $0) - ) - (loop $label$2 - (br_if $label$0 - (i32.eqz - (i32.load8_u - (get_local $2) - ) - ) - ) - (br_if $label$2 - (i32.and - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 3) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const -4) - ) - ) - (loop $label$3 - (br_if $label$3 - (i32.eqz - (i32.and - (i32.and - (i32.xor - (tee_local $1 - (i32.load - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - ) - (i32.const -1) - ) - (i32.add - (get_local $1) - (i32.const -16843009) - ) - ) - (i32.const -2139062144) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (i32.and - (get_local $1) - (i32.const 255) - ) - ) - ) - (loop $label$4 - (br_if $label$4 - (i32.load8_u - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (i32.sub - (get_local $2) - (get_local $0) - ) - ) - (func $malloc (param $0 i32) (result i32) - (call $_ZN5eosio14memory_manager6mallocEm - (i32.const 3712) - (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 12112) - ) - (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=12198 - (i32.const 0) - ) - ) - ) - (set_local $7 - (i32.load offset=12200 - (i32.const 0) - ) - ) - (br $label$0) - ) - (set_local $7 - (current_memory) - ) - (i32.store8 offset=12198 - (i32.const 0) - (i32.const 1) - ) - (i32.store offset=12200 - (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=12200 - (i32.const 0) - ) - ) - ) - (set_local $8 - (i32.const 0) - ) - (i32.store offset=12200 - (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=12198 - (i32.const 0) - ) - ) - (set_local $3 - (current_memory) - ) - (i32.store8 offset=12198 - (i32.const 0) - (i32.const 1) - ) - (i32.store offset=12200 - (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=12200 - (i32.const 0) - ) - ) - ) - (i32.store offset=12200 - (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=12096 - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - (set_local $3 - (i32.const 11904) - ) - (set_local $1 - (i32.add - (i32.mul - (get_local $2) - (i32.const 12) - ) - (i32.const 11904) - ) - ) - (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 $__wasm_nullptr (type $FUNCSIG$v) - (unreachable) - ) -) diff --git a/tests/test_contracts/eosio.msig.old/Readme.txt b/tests/test_contracts/old_versions/v1.2.1/eosio.msig/Readme.txt similarity index 100% rename from tests/test_contracts/eosio.msig.old/Readme.txt rename to tests/test_contracts/old_versions/v1.2.1/eosio.msig/Readme.txt diff --git a/tests/test_contracts/eosio.msig.old/eosio.msig.abi b/tests/test_contracts/old_versions/v1.2.1/eosio.msig/eosio.msig.abi similarity index 100% rename from tests/test_contracts/eosio.msig.old/eosio.msig.abi rename to tests/test_contracts/old_versions/v1.2.1/eosio.msig/eosio.msig.abi diff --git a/tests/test_contracts/eosio.msig.old/eosio.msig.wasm b/tests/test_contracts/old_versions/v1.2.1/eosio.msig/eosio.msig.wasm similarity index 100% rename from tests/test_contracts/eosio.msig.old/eosio.msig.wasm rename to tests/test_contracts/old_versions/v1.2.1/eosio.msig/eosio.msig.wasm diff --git a/tests/test_contracts/eosio.system.old/Readme.txt b/tests/test_contracts/old_versions/v1.2.1/eosio.system/README.txt similarity index 100% rename from tests/test_contracts/eosio.system.old/Readme.txt rename to tests/test_contracts/old_versions/v1.2.1/eosio.system/README.txt diff --git a/tests/test_contracts/old_versions/v1.2.1/eosio.system/Readme.txt b/tests/test_contracts/old_versions/v1.2.1/eosio.system/Readme.txt new file mode 100644 index 000000000..a9aa16fb3 --- /dev/null +++ b/tests/test_contracts/old_versions/v1.2.1/eosio.system/Readme.txt @@ -0,0 +1,3 @@ +Compiled with +eosio.contracts: bf28f8bbf9ee753966c95c586906e82d72f9dfac (v1.2.1) +eosio.wasmsdk: 2c106a018f2e69d34325ef2376cf085426068e93, CORE_SYMBOL_NAME = "SYS" diff --git a/tests/test_contracts/eosio.system.old/eosio.system.abi b/tests/test_contracts/old_versions/v1.2.1/eosio.system/eosio.system.abi similarity index 100% rename from tests/test_contracts/eosio.system.old/eosio.system.abi rename to tests/test_contracts/old_versions/v1.2.1/eosio.system/eosio.system.abi diff --git a/tests/test_contracts/eosio.system.old/eosio.system.wasm b/tests/test_contracts/old_versions/v1.2.1/eosio.system/eosio.system.wasm similarity index 100% rename from tests/test_contracts/eosio.system.old/eosio.system.wasm rename to tests/test_contracts/old_versions/v1.2.1/eosio.system/eosio.system.wasm diff --git a/tests/test_contracts/old_versions/v1.8.3/eosio.system/README.txt b/tests/test_contracts/old_versions/v1.8.3/eosio.system/README.txt new file mode 100644 index 000000000..61c7b1688 --- /dev/null +++ b/tests/test_contracts/old_versions/v1.8.3/eosio.system/README.txt @@ -0,0 +1,3 @@ +Compiled with +eosio.contracts: 7109f002fa9afff18edcafce5c32b224a21eef98 (v1.8.3) +eosio.cdt: 263e41cbb3e58dca71117401f43be104f1e58ae4 (v1.6.3) diff --git a/tests/test_contracts/old_versions/v1.8.3/eosio.system/eosio.system.abi b/tests/test_contracts/old_versions/v1.8.3/eosio.system/eosio.system.abi new file mode 100644 index 000000000..65afebada --- /dev/null +++ b/tests/test_contracts/old_versions/v1.8.3/eosio.system/eosio.system.abi @@ -0,0 +1,2097 @@ +{ + "____comment": "This file was generated with eosio-abigen. DO NOT EDIT ", + "version": "eosio::abi/1.1", + "types": [], + "structs": [ + { + "name": "abi_hash", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "hash", + "type": "checksum256" + } + ] + }, + { + "name": "activate", + "base": "", + "fields": [ + { + "name": "feature_digest", + "type": "checksum256" + } + ] + }, + { + "name": "authority", + "base": "", + "fields": [ + { + "name": "threshold", + "type": "uint32" + }, + { + "name": "keys", + "type": "key_weight[]" + }, + { + "name": "accounts", + "type": "permission_level_weight[]" + }, + { + "name": "waits", + "type": "wait_weight[]" + } + ] + }, + { + "name": "bid_refund", + "base": "", + "fields": [ + { + "name": "bidder", + "type": "name" + }, + { + "name": "amount", + "type": "asset" + } + ] + }, + { + "name": "bidname", + "base": "", + "fields": [ + { + "name": "bidder", + "type": "name" + }, + { + "name": "newname", + "type": "name" + }, + { + "name": "bid", + "type": "asset" + } + ] + }, + { + "name": "bidrefund", + "base": "", + "fields": [ + { + "name": "bidder", + "type": "name" + }, + { + "name": "newname", + "type": "name" + } + ] + }, + { + "name": "block_header", + "base": "", + "fields": [ + { + "name": "timestamp", + "type": "uint32" + }, + { + "name": "producer", + "type": "name" + }, + { + "name": "confirmed", + "type": "uint16" + }, + { + "name": "previous", + "type": "checksum256" + }, + { + "name": "transaction_mroot", + "type": "checksum256" + }, + { + "name": "action_mroot", + "type": "checksum256" + }, + { + "name": "schedule_version", + "type": "uint32" + }, + { + "name": "new_producers", + "type": "producer_schedule?" + } + ] + }, + { + "name": "blockchain_parameters", + "base": "", + "fields": [ + { + "name": "max_block_net_usage", + "type": "uint64" + }, + { + "name": "target_block_net_usage_pct", + "type": "uint32" + }, + { + "name": "max_transaction_net_usage", + "type": "uint32" + }, + { + "name": "base_per_transaction_net_usage", + "type": "uint32" + }, + { + "name": "net_usage_leeway", + "type": "uint32" + }, + { + "name": "context_free_discount_net_usage_num", + "type": "uint32" + }, + { + "name": "context_free_discount_net_usage_den", + "type": "uint32" + }, + { + "name": "max_block_cpu_usage", + "type": "uint32" + }, + { + "name": "target_block_cpu_usage_pct", + "type": "uint32" + }, + { + "name": "max_transaction_cpu_usage", + "type": "uint32" + }, + { + "name": "min_transaction_cpu_usage", + "type": "uint32" + }, + { + "name": "max_transaction_lifetime", + "type": "uint32" + }, + { + "name": "deferred_trx_expiration_window", + "type": "uint32" + }, + { + "name": "max_transaction_delay", + "type": "uint32" + }, + { + "name": "max_inline_action_size", + "type": "uint32" + }, + { + "name": "max_inline_action_depth", + "type": "uint16" + }, + { + "name": "max_authority_depth", + "type": "uint16" + } + ] + }, + { + "name": "buyram", + "base": "", + "fields": [ + { + "name": "payer", + "type": "name" + }, + { + "name": "receiver", + "type": "name" + }, + { + "name": "quant", + "type": "asset" + } + ] + }, + { + "name": "buyrambytes", + "base": "", + "fields": [ + { + "name": "payer", + "type": "name" + }, + { + "name": "receiver", + "type": "name" + }, + { + "name": "bytes", + "type": "uint32" + } + ] + }, + { + "name": "buyrex", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "amount", + "type": "asset" + } + ] + }, + { + "name": "canceldelay", + "base": "", + "fields": [ + { + "name": "canceling_auth", + "type": "permission_level" + }, + { + "name": "trx_id", + "type": "checksum256" + } + ] + }, + { + "name": "claimrewards", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + } + ] + }, + { + "name": "closerex", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + } + ] + }, + { + "name": "cnclrexorder", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + } + ] + }, + { + "name": "connector", + "base": "", + "fields": [ + { + "name": "balance", + "type": "asset" + }, + { + "name": "weight", + "type": "float64" + } + ] + }, + { + "name": "consolidate", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + } + ] + }, + { + "name": "defcpuloan", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "loan_num", + "type": "uint64" + }, + { + "name": "amount", + "type": "asset" + } + ] + }, + { + "name": "defnetloan", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "loan_num", + "type": "uint64" + }, + { + "name": "amount", + "type": "asset" + } + ] + }, + { + "name": "delegatebw", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "receiver", + "type": "name" + }, + { + "name": "stake_net_quantity", + "type": "asset" + }, + { + "name": "stake_cpu_quantity", + "type": "asset" + }, + { + "name": "transfer", + "type": "bool" + } + ] + }, + { + "name": "delegated_bandwidth", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "to", + "type": "name" + }, + { + "name": "net_weight", + "type": "asset" + }, + { + "name": "cpu_weight", + "type": "asset" + } + ] + }, + { + "name": "deleteauth", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "permission", + "type": "name" + } + ] + }, + { + "name": "deposit", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "amount", + "type": "asset" + } + ] + }, + { + "name": "eosio_global_state", + "base": "blockchain_parameters", + "fields": [ + { + "name": "max_ram_size", + "type": "uint64" + }, + { + "name": "total_ram_bytes_reserved", + "type": "uint64" + }, + { + "name": "total_ram_stake", + "type": "int64" + }, + { + "name": "last_producer_schedule_update", + "type": "block_timestamp_type" + }, + { + "name": "last_pervote_bucket_fill", + "type": "time_point" + }, + { + "name": "pervote_bucket", + "type": "int64" + }, + { + "name": "perblock_bucket", + "type": "int64" + }, + { + "name": "total_unpaid_blocks", + "type": "uint32" + }, + { + "name": "total_activated_stake", + "type": "int64" + }, + { + "name": "thresh_activated_stake_time", + "type": "time_point" + }, + { + "name": "last_producer_schedule_size", + "type": "uint16" + }, + { + "name": "total_producer_vote_weight", + "type": "float64" + }, + { + "name": "last_name_close", + "type": "block_timestamp_type" + } + ] + }, + { + "name": "eosio_global_state2", + "base": "", + "fields": [ + { + "name": "new_ram_per_block", + "type": "uint16" + }, + { + "name": "last_ram_increase", + "type": "block_timestamp_type" + }, + { + "name": "last_block_num", + "type": "block_timestamp_type" + }, + { + "name": "total_producer_votepay_share", + "type": "float64" + }, + { + "name": "revision", + "type": "uint8" + } + ] + }, + { + "name": "eosio_global_state3", + "base": "", + "fields": [ + { + "name": "last_vpay_state_update", + "type": "time_point" + }, + { + "name": "total_vpay_share_change_rate", + "type": "float64" + } + ] + }, + { + "name": "eosio_global_state4", + "base": "", + "fields": [ + { + "name": "continuous_rate", + "type": "float64" + }, + { + "name": "inflation_pay_factor", + "type": "int64" + }, + { + "name": "votepay_factor", + "type": "int64" + } + ] + }, + { + "name": "exchange_state", + "base": "", + "fields": [ + { + "name": "supply", + "type": "asset" + }, + { + "name": "base", + "type": "connector" + }, + { + "name": "quote", + "type": "connector" + } + ] + }, + { + "name": "fundcpuloan", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "loan_num", + "type": "uint64" + }, + { + "name": "payment", + "type": "asset" + } + ] + }, + { + "name": "fundnetloan", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "loan_num", + "type": "uint64" + }, + { + "name": "payment", + "type": "asset" + } + ] + }, + { + "name": "init", + "base": "", + "fields": [ + { + "name": "version", + "type": "varuint32" + }, + { + "name": "core", + "type": "symbol" + } + ] + }, + { + "name": "key_weight", + "base": "", + "fields": [ + { + "name": "key", + "type": "public_key" + }, + { + "name": "weight", + "type": "uint16" + } + ] + }, + { + "name": "linkauth", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "code", + "type": "name" + }, + { + "name": "type", + "type": "name" + }, + { + "name": "requirement", + "type": "name" + } + ] + }, + { + "name": "mvfrsavings", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "rex", + "type": "asset" + } + ] + }, + { + "name": "mvtosavings", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "rex", + "type": "asset" + } + ] + }, + { + "name": "name_bid", + "base": "", + "fields": [ + { + "name": "newname", + "type": "name" + }, + { + "name": "high_bidder", + "type": "name" + }, + { + "name": "high_bid", + "type": "int64" + }, + { + "name": "last_bid_time", + "type": "time_point" + } + ] + }, + { + "name": "newaccount", + "base": "", + "fields": [ + { + "name": "creator", + "type": "name" + }, + { + "name": "name", + "type": "name" + }, + { + "name": "owner", + "type": "authority" + }, + { + "name": "active", + "type": "authority" + } + ] + }, + { + "name": "onblock", + "base": "", + "fields": [ + { + "name": "header", + "type": "block_header" + } + ] + }, + { + "name": "onerror", + "base": "", + "fields": [ + { + "name": "sender_id", + "type": "uint128" + }, + { + "name": "sent_trx", + "type": "bytes" + } + ] + }, + { + "name": "pair_time_point_sec_int64", + "base": "", + "fields": [ + { + "name": "key", + "type": "time_point_sec" + }, + { + "name": "value", + "type": "int64" + } + ] + }, + { + "name": "permission_level", + "base": "", + "fields": [ + { + "name": "actor", + "type": "name" + }, + { + "name": "permission", + "type": "name" + } + ] + }, + { + "name": "permission_level_weight", + "base": "", + "fields": [ + { + "name": "permission", + "type": "permission_level" + }, + { + "name": "weight", + "type": "uint16" + } + ] + }, + { + "name": "producer_info", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "total_votes", + "type": "float64" + }, + { + "name": "producer_key", + "type": "public_key" + }, + { + "name": "is_active", + "type": "bool" + }, + { + "name": "url", + "type": "string" + }, + { + "name": "unpaid_blocks", + "type": "uint32" + }, + { + "name": "last_claim_time", + "type": "time_point" + }, + { + "name": "location", + "type": "uint16" + } + ] + }, + { + "name": "producer_info2", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "votepay_share", + "type": "float64" + }, + { + "name": "last_votepay_share_update", + "type": "time_point" + } + ] + }, + { + "name": "producer_key", + "base": "", + "fields": [ + { + "name": "producer_name", + "type": "name" + }, + { + "name": "block_signing_key", + "type": "public_key" + } + ] + }, + { + "name": "producer_schedule", + "base": "", + "fields": [ + { + "name": "version", + "type": "uint32" + }, + { + "name": "producers", + "type": "producer_key[]" + } + ] + }, + { + "name": "refund", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + } + ] + }, + { + "name": "refund_request", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "request_time", + "type": "time_point_sec" + }, + { + "name": "net_amount", + "type": "asset" + }, + { + "name": "cpu_amount", + "type": "asset" + } + ] + }, + { + "name": "regproducer", + "base": "", + "fields": [ + { + "name": "producer", + "type": "name" + }, + { + "name": "producer_key", + "type": "public_key" + }, + { + "name": "url", + "type": "string" + }, + { + "name": "location", + "type": "uint16" + } + ] + }, + { + "name": "regproxy", + "base": "", + "fields": [ + { + "name": "proxy", + "type": "name" + }, + { + "name": "isproxy", + "type": "bool" + } + ] + }, + { + "name": "rentcpu", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "receiver", + "type": "name" + }, + { + "name": "loan_payment", + "type": "asset" + }, + { + "name": "loan_fund", + "type": "asset" + } + ] + }, + { + "name": "rentnet", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "receiver", + "type": "name" + }, + { + "name": "loan_payment", + "type": "asset" + }, + { + "name": "loan_fund", + "type": "asset" + } + ] + }, + { + "name": "rex_balance", + "base": "", + "fields": [ + { + "name": "version", + "type": "uint8" + }, + { + "name": "owner", + "type": "name" + }, + { + "name": "vote_stake", + "type": "asset" + }, + { + "name": "rex_balance", + "type": "asset" + }, + { + "name": "matured_rex", + "type": "int64" + }, + { + "name": "rex_maturities", + "type": "pair_time_point_sec_int64[]" + } + ] + }, + { + "name": "rex_fund", + "base": "", + "fields": [ + { + "name": "version", + "type": "uint8" + }, + { + "name": "owner", + "type": "name" + }, + { + "name": "balance", + "type": "asset" + } + ] + }, + { + "name": "rex_loan", + "base": "", + "fields": [ + { + "name": "version", + "type": "uint8" + }, + { + "name": "from", + "type": "name" + }, + { + "name": "receiver", + "type": "name" + }, + { + "name": "payment", + "type": "asset" + }, + { + "name": "balance", + "type": "asset" + }, + { + "name": "total_staked", + "type": "asset" + }, + { + "name": "loan_num", + "type": "uint64" + }, + { + "name": "expiration", + "type": "time_point" + } + ] + }, + { + "name": "rex_order", + "base": "", + "fields": [ + { + "name": "version", + "type": "uint8" + }, + { + "name": "owner", + "type": "name" + }, + { + "name": "rex_requested", + "type": "asset" + }, + { + "name": "proceeds", + "type": "asset" + }, + { + "name": "stake_change", + "type": "asset" + }, + { + "name": "order_time", + "type": "time_point" + }, + { + "name": "is_open", + "type": "bool" + } + ] + }, + { + "name": "rex_pool", + "base": "", + "fields": [ + { + "name": "version", + "type": "uint8" + }, + { + "name": "total_lent", + "type": "asset" + }, + { + "name": "total_unlent", + "type": "asset" + }, + { + "name": "total_rent", + "type": "asset" + }, + { + "name": "total_lendable", + "type": "asset" + }, + { + "name": "total_rex", + "type": "asset" + }, + { + "name": "namebid_proceeds", + "type": "asset" + }, + { + "name": "loan_num", + "type": "uint64" + } + ] + }, + { + "name": "rex_return_buckets", + "base": "", + "fields": [ + { + "name": "version", + "type": "uint8" + }, + { + "name": "return_buckets", + "type": "pair_time_point_sec_int64[]" + } + ] + }, + { + "name": "rex_return_pool", + "base": "", + "fields": [ + { + "name": "version", + "type": "uint8" + }, + { + "name": "last_dist_time", + "type": "time_point_sec" + }, + { + "name": "pending_bucket_time", + "type": "time_point_sec" + }, + { + "name": "oldest_bucket_time", + "type": "time_point_sec" + }, + { + "name": "pending_bucket_proceeds", + "type": "int64" + }, + { + "name": "current_rate_of_increase", + "type": "int64" + }, + { + "name": "proceeds", + "type": "int64" + } + ] + }, + { + "name": "rexexec", + "base": "", + "fields": [ + { + "name": "user", + "type": "name" + }, + { + "name": "max", + "type": "uint16" + } + ] + }, + { + "name": "rmvproducer", + "base": "", + "fields": [ + { + "name": "producer", + "type": "name" + } + ] + }, + { + "name": "sellram", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "bytes", + "type": "int64" + } + ] + }, + { + "name": "sellrex", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "rex", + "type": "asset" + } + ] + }, + { + "name": "setabi", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "abi", + "type": "bytes" + } + ] + }, + { + "name": "setacctcpu", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "cpu_weight", + "type": "int64?" + } + ] + }, + { + "name": "setacctnet", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "net_weight", + "type": "int64?" + } + ] + }, + { + "name": "setacctram", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "ram_bytes", + "type": "int64?" + } + ] + }, + { + "name": "setalimits", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "ram_bytes", + "type": "int64" + }, + { + "name": "net_weight", + "type": "int64" + }, + { + "name": "cpu_weight", + "type": "int64" + } + ] + }, + { + "name": "setcode", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "vmtype", + "type": "uint8" + }, + { + "name": "vmversion", + "type": "uint8" + }, + { + "name": "code", + "type": "bytes" + } + ] + }, + { + "name": "setinflation", + "base": "", + "fields": [ + { + "name": "annual_rate", + "type": "int64" + }, + { + "name": "inflation_pay_factor", + "type": "int64" + }, + { + "name": "votepay_factor", + "type": "int64" + } + ] + }, + { + "name": "setparams", + "base": "", + "fields": [ + { + "name": "params", + "type": "blockchain_parameters" + } + ] + }, + { + "name": "setpriv", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "is_priv", + "type": "uint8" + } + ] + }, + { + "name": "setram", + "base": "", + "fields": [ + { + "name": "max_ram_size", + "type": "uint64" + } + ] + }, + { + "name": "setramrate", + "base": "", + "fields": [ + { + "name": "bytes_per_block", + "type": "uint16" + } + ] + }, + { + "name": "setrex", + "base": "", + "fields": [ + { + "name": "balance", + "type": "asset" + } + ] + }, + { + "name": "undelegatebw", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "receiver", + "type": "name" + }, + { + "name": "unstake_net_quantity", + "type": "asset" + }, + { + "name": "unstake_cpu_quantity", + "type": "asset" + } + ] + }, + { + "name": "unlinkauth", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "code", + "type": "name" + }, + { + "name": "type", + "type": "name" + } + ] + }, + { + "name": "unregprod", + "base": "", + "fields": [ + { + "name": "producer", + "type": "name" + } + ] + }, + { + "name": "unstaketorex", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "receiver", + "type": "name" + }, + { + "name": "from_net", + "type": "asset" + }, + { + "name": "from_cpu", + "type": "asset" + } + ] + }, + { + "name": "updateauth", + "base": "", + "fields": [ + { + "name": "account", + "type": "name" + }, + { + "name": "permission", + "type": "name" + }, + { + "name": "parent", + "type": "name" + }, + { + "name": "auth", + "type": "authority" + } + ] + }, + { + "name": "updaterex", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + } + ] + }, + { + "name": "updtrevision", + "base": "", + "fields": [ + { + "name": "revision", + "type": "uint8" + } + ] + }, + { + "name": "user_resources", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "net_weight", + "type": "asset" + }, + { + "name": "cpu_weight", + "type": "asset" + }, + { + "name": "ram_bytes", + "type": "int64" + } + ] + }, + { + "name": "voteproducer", + "base": "", + "fields": [ + { + "name": "voter", + "type": "name" + }, + { + "name": "proxy", + "type": "name" + }, + { + "name": "producers", + "type": "name[]" + } + ] + }, + { + "name": "voter_info", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "proxy", + "type": "name" + }, + { + "name": "producers", + "type": "name[]" + }, + { + "name": "staked", + "type": "int64" + }, + { + "name": "last_vote_weight", + "type": "float64" + }, + { + "name": "proxied_vote_weight", + "type": "float64" + }, + { + "name": "is_proxy", + "type": "bool" + }, + { + "name": "flags1", + "type": "uint32" + }, + { + "name": "reserved2", + "type": "uint32" + }, + { + "name": "reserved3", + "type": "asset" + } + ] + }, + { + "name": "wait_weight", + "base": "", + "fields": [ + { + "name": "wait_sec", + "type": "uint32" + }, + { + "name": "weight", + "type": "uint16" + } + ] + }, + { + "name": "withdraw", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "amount", + "type": "asset" + } + ] + } + ], + "actions": [ + { + "name": "activate", + "type": "activate", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Activate Protocol Feature\nsummary: 'Activate protocol feature {{nowrap feature_digest}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} activates the protocol feature with a digest of {{feature_digest}}." + }, + { + "name": "bidname", + "type": "bidname", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Bid On a Premium Account Name\nsummary: '{{nowrap bidder}} bids on the premium account name {{nowrap newname}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\n{{bidder}} bids {{bid}} on an auction to own the premium account name {{newname}}.\n\n{{bidder}} transfers {{bid}} to the system to cover the cost of the bid, which will be returned to {{bidder}} only if {{bidder}} is later outbid in the auction for {{newname}} by another account.\n\nIf the auction for {{newname}} closes with {{bidder}} remaining as the highest bidder, {{bidder}} will be authorized to create the account with name {{newname}}.\n\n## Bid refund behavior\n\nIf {{bidder}}’s bid on {{newname}} is later outbid by another account, {{bidder}} will be able to claim back the transferred amount of {{bid}}. The system will attempt to automatically do this on behalf of {{bidder}}, but the automatic refund may occasionally fail which will then require {{bidder}} to manually claim the refund with the bidrefund action.\n\n## Auction close criteria\n\nThe system should automatically close the auction for {{newname}} if it satisfies the condition that over a period of two minutes the following two properties continuously hold:\n\n- no one has bid on {{newname}} within the last 24 hours;\n- and, the value of the latest bid on {{newname}} is greater than the value of the bids on each of the other open auctions.\n\nBe aware that the condition to close the auction described above are sufficient but not necessary. The auction for {{newname}} cannot close unless both of the properties are simultaneously satisfied, but it may be closed without requiring the properties to hold for a period of 2 minutes." + }, + { + "name": "bidrefund", + "type": "bidrefund", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Claim Refund on Name Bid\nsummary: 'Claim refund on {{nowrap newname}} bid'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\n{{bidder}} claims refund on {{newname}} bid after being outbid by someone else." + }, + { + "name": "buyram", + "type": "buyram", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Buy RAM\nsummary: '{{nowrap payer}} buys RAM on behalf of {{nowrap receiver}} by paying {{nowrap quant}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/resource.png#3830f1ce8cb07f7757dbcf383b1ec1b11914ac34a1f9d8b065f07600fa9dac19\n---\n\n{{payer}} buys RAM on behalf of {{receiver}} by paying {{quant}}. This transaction will incur a 0.5% fee out of {{quant}} and the amount of RAM delivered will depend on market rates." + }, + { + "name": "buyrambytes", + "type": "buyrambytes", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Buy RAM\nsummary: '{{nowrap payer}} buys {{nowrap bytes}} bytes of RAM on behalf of {{nowrap receiver}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/resource.png#3830f1ce8cb07f7757dbcf383b1ec1b11914ac34a1f9d8b065f07600fa9dac19\n---\n\n{{payer}} buys approximately {{bytes}} bytes of RAM on behalf of {{receiver}} by paying market rates for RAM. This transaction will incur a 0.5% fee and the cost will depend on market rates." + }, + { + "name": "buyrex", + "type": "buyrex", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Buy REX Tokens\nsummary: '{{nowrap from}} buys REX tokens in exchange for {{nowrap amount}} and their vote stake increases by {{nowrap amount}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{amount}} is taken out of {{from}}’s REX fund and used to purchase REX tokens at the current market exchange rate. In order for the action to succeed, {{from}} must have voted for a proxy or at least 21 block producers. {{amount}} is added to {{from}}’s vote stake.\n\nA sell order of the purchased amount can only be initiated after waiting for the maturity period of 4 to 5 days to pass. Even then, depending on the market conditions, the initiated sell order may not be executed immediately." + }, + { + "name": "canceldelay", + "type": "canceldelay", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Cancel Delayed Transaction\nsummary: '{{nowrap canceling_auth.actor}} cancels a delayed transaction'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\n{{canceling_auth.actor}} cancels the delayed transaction with id {{trx_id}}." + }, + { + "name": "claimrewards", + "type": "claimrewards", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Claim Block Producer Rewards\nsummary: '{{nowrap owner}} claims block and vote rewards'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{owner}} claims block and vote rewards from the system." + }, + { + "name": "closerex", + "type": "closerex", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Cleanup Unused REX Data\nsummary: 'Delete REX related DB entries and free associated RAM'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\nDelete REX related DB entries and free associated RAM for {{owner}}.\n\nTo fully delete all REX related DB entries, {{owner}} must ensure that their REX balance and REX fund amounts are both zero and they have no outstanding loans." + }, + { + "name": "cnclrexorder", + "type": "cnclrexorder", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Cancel Scheduled REX Sell Order\nsummary: '{{nowrap owner}} cancels a scheduled sell order if not yet filled'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{owner}} cancels their open sell order." + }, + { + "name": "consolidate", + "type": "consolidate", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Consolidate REX Maturity Buckets Into One\nsummary: 'Consolidate REX maturity buckets into one'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\nConsolidate REX maturity buckets into one bucket that {{owner}} will not be able to sell until 4 to 5 days later." + }, + { + "name": "defcpuloan", + "type": "defcpuloan", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Withdraw from the Fund of a Specific CPU Loan\nsummary: '{{nowrap from}} transfers {{nowrap amount}} from the fund of CPU loan number {{nowrap loan_num}} back to REX fund'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{from}} transfers {{amount}} from the fund of CPU loan number {{loan_num}} back to REX fund." + }, + { + "name": "defnetloan", + "type": "defnetloan", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Withdraw from the Fund of a Specific NET Loan\nsummary: '{{nowrap from}} transfers {{nowrap amount}} from the fund of NET loan number {{nowrap loan_num}} back to REX fund'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{from}} transfers {{amount}} from the fund of NET loan number {{loan_num}} back to REX fund." + }, + { + "name": "delegatebw", + "type": "delegatebw", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Stake Tokens for NET and/or CPU\nsummary: 'Stake tokens for NET and/or CPU and optionally transfer ownership'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/resource.png#3830f1ce8cb07f7757dbcf383b1ec1b11914ac34a1f9d8b065f07600fa9dac19\n---\n\n{{#if transfer}} {{from}} stakes on behalf of {{receiver}} {{stake_net_quantity}} for NET bandwidth and {{stake_cpu_quantity}} for CPU bandwidth.\n\nStaked tokens will also be transferred to {{receiver}}. The sum of these two quantities will be deducted from {{from}}’s liquid balance and add to the vote weight of {{receiver}}.\n{{else}}\n{{from}} stakes to self and delegates to {{receiver}} {{stake_net_quantity}} for NET bandwidth and {{stake_cpu_quantity}} for CPU bandwidth.\n\nThe sum of these two quantities add to the vote weight of {{from}}.\n{{/if}}" + }, + { + "name": "deleteauth", + "type": "deleteauth", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Delete Account Permission\nsummary: 'Delete the {{nowrap permission}} permission of {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\nDelete the {{permission}} permission of {{account}}." + }, + { + "name": "deposit", + "type": "deposit", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Deposit Into REX Fund\nsummary: 'Add to {{nowrap owner}}’s REX fund by transferring {{nowrap amount}} from {{nowrap owner}}’s liquid balance'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\nTransfer {{amount}} from {{owner}}’s liquid balance to {{owner}}’s REX fund. All proceeds and expenses related to REX are added to or taken out of this fund." + }, + { + "name": "fundcpuloan", + "type": "fundcpuloan", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Deposit into the Fund of a Specific CPU Loan\nsummary: '{{nowrap from}} funds a CPU loan'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{from}} transfers {{payment}} from REX fund to the fund of CPU loan number {{loan_num}} in order to be used in loan renewal at expiry. {{from}} can withdraw the total balance of the loan fund at any time." + }, + { + "name": "fundnetloan", + "type": "fundnetloan", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Deposit into the Fund of a Specific NET Loan\nsummary: '{{nowrap from}} funds a NET loan'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{from}} transfers {{payment}} from REX fund to the fund of NET loan number {{loan_num}} in order to be used in loan renewal at expiry. {{from}} can withdraw the total balance of the loan fund at any time." + }, + { + "name": "init", + "type": "init", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Initialize System Contract\nsummary: 'Initialize system contract'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\nInitialize system contract. The core token symbol will be set to {{core}}." + }, + { + "name": "linkauth", + "type": "linkauth", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Link Action to Permission\nsummary: '{{nowrap account}} sets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract to {{nowrap requirement}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\n{{account}} sets the minimum required permission for the {{#if type}}{{type}} action of the{{/if}} {{code}} contract to {{requirement}}.\n\n{{#if type}}{{else}}Any links explicitly associated to specific actions of {{code}} will take precedence.{{/if}}" + }, + { + "name": "mvfrsavings", + "type": "mvfrsavings", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Unlock REX Tokens\nsummary: '{{nowrap owner}} unlocks REX Tokens'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{owner}} unlocks {{rex}} by moving it out of the REX savings bucket. The unlocked REX tokens cannot be sold until 4 to 5 days later." + }, + { + "name": "mvtosavings", + "type": "mvtosavings", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Lock REX Tokens\nsummary: '{{nowrap owner}} locks REX Tokens'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{owner}} locks {{rex}} by moving it into the REX savings bucket. The locked REX tokens cannot be sold directly and will have to be unlocked explicitly before selling." + }, + { + "name": "newaccount", + "type": "newaccount", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Create New Account\nsummary: '{{nowrap creator}} creates a new account with the name {{nowrap name}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\n{{creator}} creates a new account with the name {{name}} and the following permissions:\n\nowner permission with authority:\n{{to_json owner}}\n\nactive permission with authority:\n{{to_json active}}" + }, + { + "name": "onblock", + "type": "onblock", + "ricardian_contract": "" + }, + { + "name": "onerror", + "type": "onerror", + "ricardian_contract": "" + }, + { + "name": "refund", + "type": "refund", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Claim Unstaked Tokens\nsummary: 'Return previously unstaked tokens to {{nowrap owner}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\nReturn previously unstaked tokens to {{owner}} after the unstaking period has elapsed." + }, + { + "name": "regproducer", + "type": "regproducer", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Register as a Block Producer Candidate\nsummary: 'Register {{nowrap producer}} account as a block producer candidate'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/voting.png#db28cd3db6e62d4509af3644ce7d377329482a14bb4bfaca2aa5f1400d8e8a84\n---\n\nRegister {{producer}} account as a block producer candidate.\n\n{{$clauses.BlockProducerAgreement}}" + }, + { + "name": "regproxy", + "type": "regproxy", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Register/unregister as a Proxy\nsummary: 'Register/unregister {{nowrap proxy}} as a proxy account'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/voting.png#db28cd3db6e62d4509af3644ce7d377329482a14bb4bfaca2aa5f1400d8e8a84\n---\n\n{{#if isproxy}}\n{{proxy}} registers as a proxy that can vote on behalf of accounts that appoint it as their proxy.\n{{else}}\n{{proxy}} unregisters as a proxy that can vote on behalf of accounts that appoint it as their proxy.\n{{/if}}" + }, + { + "name": "rentcpu", + "type": "rentcpu", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Rent CPU Bandwidth for 30 Days\nsummary: '{{nowrap from}} pays {{nowrap loan_payment}} to rent CPU bandwidth for {{nowrap receiver}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{from}} pays {{loan_payment}} to rent CPU bandwidth on behalf of {{receiver}} for a period of 30 days.\n\n{{loan_payment}} is taken out of {{from}}’s REX fund. The market price determines the number of tokens to be staked to {{receiver}}’s CPU resources. In addition, {{from}} provides {{loan_fund}}, which is also taken out of {{from}}’s REX fund, to be used for automatic renewal of the loan.\n\nAt expiration, if the loan has less funds than {{loan_payment}}, it is closed and lent tokens that have been staked are taken out of {{receiver}}’s CPU bandwidth. Otherwise, it is renewed at the market price at the time of renewal, that is, the number of staked tokens is recalculated and {{receiver}}’s CPU bandwidth is updated accordingly. {{from}} can fund or defund a loan at any time before expiration. When the loan is closed, {{from}} is refunded any tokens remaining in the loan fund." + }, + { + "name": "rentnet", + "type": "rentnet", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Rent NET Bandwidth for 30 Days\nsummary: '{{nowrap from}} pays {{nowrap loan_payment}} to rent NET bandwidth for {{nowrap receiver}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{from}} pays {{loan_payment}} to rent NET bandwidth on behalf of {{receiver}} for a period of 30 days.\n\n{{loan_payment}} is taken out of {{from}}’s REX fund. The market price determines the number of tokens to be staked to {{receiver}}’s NET resources for 30 days. In addition, {{from}} provides {{loan_fund}}, which is also taken out of {{from}}’s REX fund, to be used for automatic renewal of the loan.\n\nAt expiration, if the loan has less funds than {{loan_payment}}, it is closed and lent tokens that have been staked are taken out of {{receiver}}’s NET bandwidth. Otherwise, it is renewed at the market price at the time of renewal, that is, the number of staked tokens is recalculated and {{receiver}}’s NET bandwidth is updated accordingly. {{from}} can fund or defund a loan at any time before expiration. When the loan is closed, {{from}} is refunded any tokens remaining in the loan fund." + }, + { + "name": "rexexec", + "type": "rexexec", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Perform REX Maintenance\nsummary: 'Process sell orders and expired loans'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\nPerforms REX maintenance by processing a maximum of {{max}} REX sell orders and expired loans. Any account can execute this action." + }, + { + "name": "rmvproducer", + "type": "rmvproducer", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Forcibly Unregister a Block Producer Candidate\nsummary: '{{nowrap producer}} is unregistered as a block producer candidate'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} unregisters {{producer}} as a block producer candidate. {{producer}} account will retain its votes and those votes can change based on voter stake changes or votes removed from {{producer}}. However new voters will not be able to vote for {{producer}} while it remains unregistered." + }, + { + "name": "sellram", + "type": "sellram", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Sell RAM From Account\nsummary: 'Sell unused RAM from {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/resource.png#3830f1ce8cb07f7757dbcf383b1ec1b11914ac34a1f9d8b065f07600fa9dac19\n---\n\nSell {{bytes}} bytes of unused RAM from account {{account}} at market price. This transaction will incur a 0.5% fee on the proceeds which depend on market rates." + }, + { + "name": "sellrex", + "type": "sellrex", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Sell REX Tokens in Exchange for EOS\nsummary: '{{nowrap from}} sells {{nowrap rex}} tokens'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{from}} initiates a sell order to sell {{rex}} tokens at the market exchange rate during the time at which the order is ultimately executed. If {{from}} already has an open sell order in the sell queue, {{rex}} will be added to the amount of the sell order without change the position of the sell order within the queue. Once the sell order is executed, proceeds are added to {{from}}’s REX fund, the value of sold REX tokens is deducted from {{from}}’s vote stake, and votes are updated accordingly.\n\nDepending on the market conditions, it may not be possible to fill the entire sell order immediately. In such a case, the sell order is added to the back of a sell queue. A sell order at the front of the sell queue will automatically be executed when the market conditions allow for the entire order to be filled. Regardless of the market conditions, the system is designed to execute this sell order within 30 days. {{from}} can cancel the order at any time before it is filled using the cnclrexorder action." + }, + { + "name": "setabi", + "type": "setabi", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Deploy Contract ABI\nsummary: 'Deploy contract ABI on account {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\nDeploy the ABI file associated with the contract on account {{account}}." + }, + { + "name": "setacctcpu", + "type": "setacctcpu", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Explicitly Manage the CPU Quota of Account\nsummary: 'Explicitly manage the CPU bandwidth quota of account {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{#if_has_value cpu_weight}}\nExplicitly manage the CPU bandwidth quota of account {{account}} by pinning it to a weight of {{cpu_weight}}.\n\n{{account}} can stake and unstake, however, it will not change their CPU bandwidth quota as long as it remains pinned.\n{{else}}\nUnpin the CPU bandwidth quota of account {{account}}. The CPU bandwidth quota of {{account}} will be driven by the current tokens staked for CPU bandwidth by {{account}}.\n{{/if_has_value}}" + }, + { + "name": "setacctnet", + "type": "setacctnet", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Explicitly Manage the NET Quota of Account\nsummary: 'Explicitly manage the NET bandwidth quota of account {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{#if_has_value net_weight}}\nExplicitly manage the network bandwidth quota of account {{account}} by pinning it to a weight of {{net_weight}}.\n\n{{account}} can stake and unstake, however, it will not change their NET bandwidth quota as long as it remains pinned.\n{{else}}\nUnpin the NET bandwidth quota of account {{account}}. The NET bandwidth quota of {{account}} will be driven by the current tokens staked for NET bandwidth by {{account}}.\n{{/if_has_value}}" + }, + { + "name": "setacctram", + "type": "setacctram", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Explicitly Manage the RAM Quota of Account\nsummary: 'Explicitly manage the RAM quota of account {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{#if_has_value ram_bytes}}\nExplicitly manage the RAM quota of account {{account}} by pinning it to {{ram_bytes}} bytes.\n\n{{account}} can buy and sell RAM, however, it will not change their RAM quota as long as it remains pinned.\n{{else}}\nUnpin the RAM quota of account {{account}}. The RAM quota of {{account}} will be driven by the current RAM holdings of {{account}}.\n{{/if_has_value}}" + }, + { + "name": "setalimits", + "type": "setalimits", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Adjust Resource Limits of Account\nsummary: 'Adjust resource limits of account {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} updates {{account}}’s resource limits to have a RAM quota of {{ram_bytes}} bytes, a NET bandwidth quota of {{net_weight}} and a CPU bandwidth quota of {{cpu_weight}}." + }, + { + "name": "setcode", + "type": "setcode", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Deploy Contract Code\nsummary: 'Deploy contract code on account {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\nDeploy compiled contract code to the account {{account}}." + }, + { + "name": "setinflation", + "type": "setinflation", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Set Inflation Parameters\nsummary: 'Set inflation parameters'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} sets the inflation parameters as follows:\n\n* Annual inflation rate (in units of a hundredth of a percent): {{annual_rate}}\n* Fraction of inflation used to reward block producers: 10000/{{inflation_pay_factor}}\n* Fraction of block producer rewards to be distributed proportional to blocks produced: 10000/{{votepay_factor}}" + }, + { + "name": "setparams", + "type": "setparams", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Set System Parameters\nsummary: 'Set System Parameters'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} sets system parameters to:\n{{to_json params}}" + }, + { + "name": "setpriv", + "type": "setpriv", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Make an Account Privileged or Unprivileged\nsummary: '{{#if is_priv}}Make {{nowrap account}} privileged{{else}}Remove privileged status of {{nowrap account}}{{/if}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{#if is_priv}}\n{{$action.account}} makes {{account}} privileged.\n{{else}}\n{{$action.account}} removes privileged status of {{account}}.\n{{/if}}" + }, + { + "name": "setram", + "type": "setram", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Configure the Available RAM\nsummary: 'Configure the available RAM'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} configures the available RAM to {{max_ram_size}} bytes." + }, + { + "name": "setramrate", + "type": "setramrate", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Set the Rate of Increase of RAM\nsummary: 'Set the rate of increase of RAM per block'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} sets the rate of increase of RAM to {{bytes_per_block}} bytes/block." + }, + { + "name": "setrex", + "type": "setrex", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Adjust REX Pool Virtual Balance\nsummary: 'Adjust REX Pool Virtual Balance'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} adjusts REX loan rate by setting REX pool virtual balance to {{balance}}. No token transfer or issue is executed in this action." + }, + { + "name": "undelegatebw", + "type": "undelegatebw", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Unstake Tokens for NET and/or CPU\nsummary: 'Unstake tokens for NET and/or CPU from {{nowrap receiver}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/resource.png#3830f1ce8cb07f7757dbcf383b1ec1b11914ac34a1f9d8b065f07600fa9dac19\n---\n\n{{from}} unstakes from {{receiver}} {{unstake_net_quantity}} for NET bandwidth and {{unstake_cpu_quantity}} for CPU bandwidth.\n\nThe sum of these two quantities will be removed from the vote weight of {{receiver}} and will be made available to {{from}} after an uninterrupted 3 day period without further unstaking by {{from}}. After the uninterrupted 3 day period passes, the system will attempt to automatically return the funds to {{from}}’s regular token balance. However, this automatic refund may occasionally fail which will then require {{from}} to manually claim the funds with the refund action." + }, + { + "name": "unlinkauth", + "type": "unlinkauth", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Unlink Action from Permission\nsummary: '{{nowrap account}} unsets the minimum required permission for the {{#if type}}{{nowrap type}} action of the{{/if}} {{nowrap code}} contract'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\n{{account}} removes the association between the {{#if type}}{{type}} action of the{{/if}} {{code}} contract and its minimum required permission.\n\n{{#if type}}{{else}}This will not remove any links explicitly associated to specific actions of {{code}}.{{/if}}" + }, + { + "name": "unregprod", + "type": "unregprod", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Unregister as a Block Producer Candidate\nsummary: '{{nowrap producer}} unregisters as a block producer candidate'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/voting.png#db28cd3db6e62d4509af3644ce7d377329482a14bb4bfaca2aa5f1400d8e8a84\n---\n\n{{producer}} unregisters as a block producer candidate. {{producer}} account will retain its votes and those votes can change based on voter stake changes or votes removed from {{producer}}. However new voters will not be able to vote for {{producer}} while it remains unregistered." + }, + { + "name": "unstaketorex", + "type": "unstaketorex", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Buy REX Tokens Using Staked Tokens\nsummary: '{{nowrap owner}} buys REX tokens in exchange for tokens currently staked to NET and/or CPU'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\n{{from_net}} and {{from_cpu}} are withdrawn from {{receiver}}’s NET and CPU bandwidths respectively. These funds are used to purchase REX tokens at the current market exchange rate. In order for the action to succeed, {{owner}} must have voted for a proxy or at least 21 block producers.\n\nA sell order of the purchased amount can only be initiated after waiting for the maturity period of 4 to 5 days to pass. Even then, depending on the market conditions, the initiated sell order may not be executed immediately." + }, + { + "name": "updateauth", + "type": "updateauth", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Modify Account Permission\nsummary: 'Add or update the {{nowrap permission}} permission of {{nowrap account}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f\n---\n\nModify, and create if necessary, the {{permission}} permission of {{account}} to have a parent permission of {{parent}} and the following authority:\n{{to_json auth}}" + }, + { + "name": "updaterex", + "type": "updaterex", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Update REX Owner Vote Weight\nsummary: 'Update vote weight to current value of held REX tokens'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\nUpdate vote weight of {{owner}} account to current value of held REX tokens." + }, + { + "name": "updtrevision", + "type": "updtrevision", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Update System Contract Revision Number\nsummary: 'Update system contract revision number'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/admin.png#9bf1cec664863bd6aaac0f814b235f8799fb02c850e9aa5da34e8a004bd6518e\n---\n\n{{$action.account}} advances the system contract revision number to {{revision}}." + }, + { + "name": "voteproducer", + "type": "voteproducer", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Vote for Block Producers\nsummary: '{{nowrap voter}} votes for {{#if proxy}}the proxy {{nowrap proxy}}{{else}}up to 30 block producer candidates{{/if}}'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/voting.png#db28cd3db6e62d4509af3644ce7d377329482a14bb4bfaca2aa5f1400d8e8a84\n---\n\n{{#if proxy}}\n{{voter}} votes for the proxy {{proxy}}.\nAt the time of voting the full weight of voter’s staked (CPU + NET) tokens will be cast towards each of the producers voted by {{proxy}}.\n{{else}}\n{{voter}} votes for the following block producer candidates:\n\n{{#each producers}}\n + {{this}}\n{{/each}}\n\nAt the time of voting the full weight of voter’s staked (CPU + NET) tokens will be cast towards each of the above producers.\n{{/if}}" + }, + { + "name": "withdraw", + "type": "withdraw", + "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Withdraw from REX Fund\nsummary: 'Withdraw {{nowrap amount}} from {{nowrap owner}}’s REX fund by transferring to {{owner}}’s liquid balance'\nicon: http://127.0.0.1/ricardian_assets/eosio.contracts/icons/rex.png#d229837fa62a464b9c71e06060aa86179adf0b3f4e3b8c4f9702f4f4b0c340a8\n---\n\nWithdraws {{amount}} from {{owner}}’s REX fund and transfer them to {{owner}}’s liquid balance." + } + ], + "tables": [ + { + "name": "abihash", + "type": "abi_hash", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "bidrefunds", + "type": "bid_refund", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "cpuloan", + "type": "rex_loan", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "delband", + "type": "delegated_bandwidth", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "global", + "type": "eosio_global_state", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "global2", + "type": "eosio_global_state2", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "global3", + "type": "eosio_global_state3", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "global4", + "type": "eosio_global_state4", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "namebids", + "type": "name_bid", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "netloan", + "type": "rex_loan", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "producers", + "type": "producer_info", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "producers2", + "type": "producer_info2", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "rammarket", + "type": "exchange_state", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "refunds", + "type": "refund_request", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "retbuckets", + "type": "rex_return_buckets", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "rexbal", + "type": "rex_balance", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "rexfund", + "type": "rex_fund", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "rexpool", + "type": "rex_pool", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "rexqueue", + "type": "rex_order", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "rexretpool", + "type": "rex_return_pool", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "userres", + "type": "user_resources", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "voters", + "type": "voter_info", + "index_type": "i64", + "key_names": [], + "key_types": [] + } + ], + "ricardian_clauses": [ + { + "id": "UserAgreement", + "body": "User agreement for the chain can go here." + }, + { + "id": "BlockProducerAgreement", + "body": "I, {{producer}}, hereby nominate myself for consideration as an elected block producer.\n\nIf {{producer}} is selected to produce blocks by the system contract, I will sign blocks with {{producer_key}} and I hereby attest that I will keep this key secret and secure.\n\nIf {{producer}} is unable to perform obligations under this contract I will resign my position by resubmitting this contract with the null producer key.\n\nI acknowledge that a block is 'objectively valid' if it conforms to the deterministic blockchain rules in force at the time of its creation, and is 'objectively invalid' if it fails to conform to those rules.\n\n{{producer}} hereby agrees to only use {{producer_key}} to sign messages under the following scenarios:\n\n* proposing an objectively valid block at the time appointed by the block scheduling algorithm;\n* pre-confirming a block produced by another producer in the schedule when I find said block objectively valid;\n* and, confirming a block for which {{producer}} has received pre-confirmation messages from more than two-thirds of the active block producers.\n\nI hereby accept liability for any and all provable damages that result from my:\n\n* signing two different block proposals with the same timestamp with {{producer_key}};\n* signing two different block proposals with the same block number with {{producer_key}};\n* signing any block proposal which builds off of an objectively invalid block;\n* signing a pre-confirmation for an objectively invalid block;\n* or, signing a confirmation for a block for which I do not possess pre-confirmation messages from more than two-thirds of the active block producers.\n\nI hereby agree that double-signing for a timestamp or block number in concert with two or more other block producers shall automatically be deemed malicious and cause {{producer}} to be subject to:\n\n* a fine equal to the past year of compensation received,\n* immediate disqualification from being a producer,\n* and/or other damages.\n\nAn exception may be made if {{producer}} can demonstrate that the double-signing occurred due to a bug in the reference software; the burden of proof is on {{producer}}.\n\nI hereby agree not to interfere with the producer election process. I agree to process all producer election transactions that occur in blocks I create, to sign all objectively valid blocks I create that contain election transactions, and to sign all pre-confirmations and confirmations necessary to facilitate transfer of control to the next set of producers as determined by the system contract.\n\nI hereby acknowledge that more than two-thirds of the active block producers may vote to disqualify {{producer}} in the event {{producer}} is unable to produce blocks or is unable to be reached, according to criteria agreed to among block producers.\n\nIf {{producer}} qualifies for and chooses to collect compensation due to votes received, {{producer}} will provide a public endpoint allowing at least 100 peers to maintain synchronization with the blockchain and/or submit transactions to be included. {{producer}} shall maintain at least one validating node with full state and signature checking and shall report any objectively invalid blocks produced by the active block producers. Reporting shall be via a method to be agreed to among block producers, said method and reports to be made public.\n\nThe community agrees to allow {{producer}} to authenticate peers as necessary to prevent abuse and denial of service attacks; however, {{producer}} agrees not to discriminate against non-abusive peers.\n\nI agree to process transactions on a FIFO (first in, first out) best-effort basis and to honestly bill transactions for measured execution time.\n\nI {{producer}} agree not to manipulate the contents of blocks in order to derive profit from: the order in which transactions are included, or the hash of the block that is produced.\n\nI, {{producer}}, hereby agree to disclose and attest under penalty of perjury all ultimate beneficial owners of my business entity who own more than 10% and all direct shareholders.\n\nI, {{producer}}, hereby agree to cooperate with other block producers to carry out our respective and mutual obligations under this agreement, including but not limited to maintaining network stability and a valid blockchain.\n\nI, {{producer}}, agree to maintain a website hosted at {{url}} which contains up-to-date information on all disclosures required by this contract.\n\nI, {{producer}}, agree to set the location value of {{location}} such that {{producer}} is scheduled with minimal latency between my previous and next peer.\n\nI, {{producer}}, agree to maintain time synchronization within 10 ms of global atomic clock time, using a method agreed to among block producers.\n\nI, {{producer}}, agree not to produce blocks before my scheduled time unless I have received all blocks produced by the prior block producer.\n\nI, {{producer}}, agree not to publish blocks with timestamps more than 500ms in the future unless the prior block is more than 75% full by either NET or CPU bandwidth metrics.\n\nI, {{producer}}, agree not to set the RAM supply to more RAM than my nodes contain and to resign if I am unable to provide the RAM approved by more than two-thirds of active block producers, as shown in the system parameters." + } + ], + "variants": [] +} \ No newline at end of file diff --git a/tests/test_contracts/old_versions/v1.8.3/eosio.system/eosio.system.wasm b/tests/test_contracts/old_versions/v1.8.3/eosio.system/eosio.system.wasm new file mode 100755 index 000000000..7934a4a97 Binary files /dev/null and b/tests/test_contracts/old_versions/v1.8.3/eosio.system/eosio.system.wasm differ diff --git a/tests/test_contracts/reject_all.wasm b/tests/test_contracts/reject_all.wasm new file mode 100755 index 000000000..ee794557a Binary files /dev/null and b/tests/test_contracts/reject_all.wasm differ diff --git a/tests/test_contracts/test_api.wasm b/tests/test_contracts/test_api.wasm deleted file mode 100644 index 1e1ccf7bd..000000000 Binary files a/tests/test_contracts/test_api.wasm and /dev/null differ diff --git a/tests/test_contracts/test_api.wast b/tests/test_contracts/test_api.wast deleted file mode 100644 index b28b89bb7..000000000 --- a/tests/test_contracts/test_api.wast +++ /dev/null @@ -1,53138 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$j (func (result i64))) - (type $FUNCSIG$vjj (func (param i64 i64))) - (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vijjjj (func (param i32 i64 i64 i64 i64))) - (type $FUNCSIG$ij (func (param i64) (result i32))) - (type $FUNCSIG$ijjjjii (func (param i64 i64 i64 i64 i32 i32) (result i32))) - (type $FUNCSIG$ijjjji (func (param i64 i64 i64 i64 i32) (result i32))) - (type $FUNCSIG$ijjjj (func (param i64 i64 i64 i64) (result i32))) - (type $FUNCSIG$vj (func (param i64))) - (type $FUNCSIG$vijiii (func (param i32 i64 i32 i32 i32))) - (type $FUNCSIG$vij (func (param i32 i64))) - (type $FUNCSIG$vf (func (param f32))) - (type $FUNCSIG$vd (func (param f64))) - (type $FUNCSIG$vijji (func (param i32 i64 i64 i32))) - (type $FUNCSIG$viiiii (func (param i32 i32 i32 i32 i32))) - (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$ijjiiiij (func (param i64 i64 i32 i32 i32 i32 i64) (result i32))) - (type $FUNCSIG$vijii (func (param i32 i64 i32 i32))) - (type $FUNCSIG$jjj (func (param i64 i64) (result i64))) - (type $FUNCSIG$jj (func (param i64) (result i64))) - (import "env" "__ashlti3" (func $__ashlti3 (param i32 i64 i64 i32))) - (import "env" "__ashrti3" (func $__ashrti3 (param i32 i64 i64 i32))) - (import "env" "__divti3" (func $__divti3 (param i32 i64 i64 i64 i64))) - (import "env" "__lshlti3" (func $__lshlti3 (param i32 i64 i64 i32))) - (import "env" "__lshrti3" (func $__lshrti3 (param i32 i64 i64 i32))) - (import "env" "__modti3" (func $__modti3 (param i32 i64 i64 i64 i64))) - (import "env" "__multi3" (func $__multi3 (param i32 i64 i64 i64 i64))) - (import "env" "__udivti3" (func $__udivti3 (param i32 i64 i64 i64 i64))) - (import "env" "__umodti3" (func $__umodti3 (param i32 i64 i64 i64 i64))) - (import "env" "abort" (func $abort)) - (import "env" "action_data_size" (func $action_data_size (result i32))) - (import "env" "activate_feature" (func $activate_feature (param i64))) - (import "env" "assert_recover_key" (func $assert_recover_key (param i32 i32 i32 i32 i32))) - (import "env" "assert_ripemd160" (func $assert_ripemd160 (param i32 i32 i32))) - (import "env" "assert_sha1" (func $assert_sha1 (param i32 i32 i32))) - (import "env" "assert_sha256" (func $assert_sha256 (param i32 i32 i32))) - (import "env" "assert_sha512" (func $assert_sha512 (param i32 i32 i32))) - (import "env" "cancel_deferred" (func $cancel_deferred (param i32) (result i32))) - (import "env" "check_permission_authorization" (func $check_permission_authorization (param i64 i64 i32 i32 i32 i32 i64) (result i32))) - (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_idx64_store" (func $db_idx64_store (param i64 i64 i64 i64 i32) (result i32))) - (import "env" "db_lowerbound_i64" (func $db_lowerbound_i64 (param i64 i64 i64 i64) (result 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" "eosio_assert_code" (func $eosio_assert_code (param i32 i64))) - (import "env" "get_account_creation_time" (func $get_account_creation_time (param i64) (result i64))) - (import "env" "get_action" (func $get_action (param i32 i32 i32 i32) (result i32))) - (import "env" "get_active_producers" (func $get_active_producers (param i32 i32) (result i32))) - (import "env" "get_context_free_data" (func $get_context_free_data (param i32 i32 i32) (result i32))) - (import "env" "get_permission_last_used" (func $get_permission_last_used (param i64 i64) (result i64))) - (import "env" "is_feature_active" (func $is_feature_active (param i64) (result i32))) - (import "env" "is_privileged" (func $is_privileged (param i64) (result i32))) - (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) - (import "env" "memset" (func $memset (param i32 i32 i32) (result i32))) - (import "env" "printdf" (func $printdf (param f64))) - (import "env" "printhex" (func $printhex (param i32 i32))) - (import "env" "printi" (func $printi (param i64))) - (import "env" "printi128" (func $printi128 (param i32))) - (import "env" "printn" (func $printn (param i64))) - (import "env" "printqf" (func $printqf (param i32))) - (import "env" "prints" (func $prints (param i32))) - (import "env" "prints_l" (func $prints_l (param i32 i32))) - (import "env" "printsf" (func $printsf (param f32))) - (import "env" "printui" (func $printui (param i64))) - (import "env" "printui128" (func $printui128 (param i32))) - (import "env" "publication_time" (func $publication_time (result i64))) - (import "env" "read_action_data" (func $read_action_data (param i32 i32) (result i32))) - (import "env" "read_transaction" (func $read_transaction (param i32 i32) (result i32))) - (import "env" "recover_key" (func $recover_key (param i32 i32 i32 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" "ripemd160" (func $ripemd160 (param i32 i32 i32))) - (import "env" "send_context_free_inline" (func $send_context_free_inline (param i32 i32))) - (import "env" "send_deferred" (func $send_deferred (param i32 i64 i32 i32 i32))) - (import "env" "send_inline" (func $send_inline (param i32 i32))) - (import "env" "sha1" (func $sha1 (param i32 i32 i32))) - (import "env" "sha256" (func $sha256 (param i32 i32 i32))) - (import "env" "sha512" (func $sha512 (param i32 i32 i32))) - (import "env" "tapos_block_num" (func $tapos_block_num (result i32))) - (import "env" "tapos_block_prefix" (func $tapos_block_prefix (result i32))) - (import "env" "transaction_size" (func $transaction_size (result i32))) - (table 0 anyfunc) - (memory $0 1) - (data (i32.const 4) "p\93\00\00") - (data (i32.const 16) "\00\00\00\00\00\00\00\00") - (data (i32.const 32) "action_size() == sizeof(dummy_action)\00") - (data (i32.const 80) "read_action(30)\00") - (data (i32.const 96) "read_action(100)\00") - (data (i32.const 128) "read_action(5)\00") - (data (i32.const 144) "read_action(sizeof(dummy_action))\00") - (data (i32.const 192) "dummy13->a == DUMMY_ACTION_DEFAULT_A\00") - (data (i32.const 240) "dummy13->b == DUMMY_ACTION_DEFAULT_B\00") - (data (i32.const 288) "dummy13->c == DUMMY_ACTION_DEFAULT_C\00") - (data (i32.const 336) "get_action failed\00") - (data (i32.const 368) "testapi\00") - (data (i32.const 384) "incorrect permission actor\00") - (data (i32.const 416) "active\00") - (data (i32.const 432) "incorrect permission name\00") - (data (i32.const 464) "pack_size does not match get_action size\00") - (data (i32.const 512) "expected testapi account\00") - (data (i32.const 544) "get_context_free_data() not allowed in non-context free action\00") - (data (i32.const 608) "dum13.a == DUMMY_ACTION_DEFAULT_A\00") - (data (i32.const 656) "dum13.b == DUMMY_ACTION_DEFAULT_B\00") - (data (i32.const 704) "dum13.c == DUMMY_ACTION_DEFAULT_C\00") - (data (i32.const 752) "dummy_action\00") - (data (i32.const 768) "Invalid name\00") - (data (i32.const 784) "Invalid account\00") - (data (i32.const 800) "read\00") - (data (i32.const 816) "get_action size failed\00") - (data (i32.const 848) "get\00") - (data (i32.const 864) "size determination failed\00") - (data (i32.const 896) "get_context_free_data failed\00") - (data (i32.const 928) "invalid value\00") - (data (i32.const 944) "test\00") - (data (i32.const 960) "test\n\00") - (data (i32.const 976) "transaction_size failed\00") - (data (i32.const 1008) "Unable to add float.\00") - (data (i32.const 1040) "verify eosio_assert can be called\00") - (data (i32.const 1088) "privileged_api should not be allowed\00") - (data (i32.const 1136) "producer_api should not be allowed\00") - (data (i32.const 1184) "db_api should not be allowed\00") - (data (i32.const 1216) "action send should not be allowed\00") - (data (i32.const 1264) "authorization_api should not be allowed\00") - (data (i32.const 1312) "system_api should not be allowed\00") - (data (i32.const 1360) "hello\00") - (data (i32.const 1376) "transaction_api should not be allowed\00") - (data (i32.const 1424) "write\00") - (data (i32.const 1440) "cf_action\00") - (data (i32.const 1456) "acc1\00") - (data (i32.const 1472) "acc2\00") - (data (i32.const 1488) "Should\'ve failed\00") - (data (i32.const 1520) "require_auth\00") - (data (i32.const 1536) "acc3\00") - (data (i32.const 1552) "acc4\00") - (data (i32.const 1568) "test_action::assert_false\00") - (data (i32.const 1600) "test_action::assert_true\00") - (data (i32.const 1632) "total == sizeof(uint64_t)\00") - (data (i32.const 1664) "pub_time == publication_time()\00") - (data (i32.const 1696) "the current receiver does not match\00") - (data (i32.const 1744) "tmp == current_time()\00") - (data (i32.const 1776) "ab\00") - (data (i32.const 1792) "c\00test_prints\00") - (data (i32.const 1808) "efg\00") - (data (i32.const 1824) "\n\00") - (data (i32.const 1840) "abcde\00") - (data (i32.const 1856) "abBde\00") - (data (i32.const 1872) "1q1q1qAA\00") - (data (i32.const 1888) "AAAAAA\00") - (data (i32.const 1904) "abcdefghijk\00") - (data (i32.const 1920) "abcdefghijkl\00") - (data (i32.const 1936) "abcdefghijkl1\00") - (data (i32.const 1952) "abcdefghijkl12\00") - (data (i32.const 1968) "abcdefghijkl123\00") - (data (i32.const 1984) "cvalue\00") - (data (i32.const 2000) "value\00") - (data (i32.const 2016) "int64_t size != 8\00") - (data (i32.const 2048) "uint64_t size != 8\00") - (data (i32.const 2080) "uint32_t size != 4\00") - (data (i32.const 2112) "int32_t size != 4\00") - (data (i32.const 2144) "uint128_t size != 16\00") - (data (i32.const 2176) "int128_t size != 16\00") - (data (i32.const 2208) "uint8_t size != 1\00") - (data (i32.const 2240) "account_name size != 8\00") - (data (i32.const 2272) "table_name size != 8\00") - (data (i32.const 2304) "time size != 4\00") - (data (i32.const 2320) "key256 size != 32\00") - (data (i32.const 2352) "eosio::char_to_symbol(\'1\') != 1\00") - (data (i32.const 2400) "eosio::char_to_symbol(\'2\') != 2\00") - (data (i32.const 2448) "eosio::char_to_symbol(\'3\') != 3\00") - (data (i32.const 2496) "eosio::char_to_symbol(\'4\') != 4\00") - (data (i32.const 2544) "eosio::char_to_symbol(\'5\') != 5\00") - (data (i32.const 2592) "eosio::char_to_symbol(\'a\') != 6\00") - (data (i32.const 2640) "eosio::char_to_symbol(\'b\') != 7\00") - (data (i32.const 2688) "eosio::char_to_symbol(\'c\') != 8\00") - (data (i32.const 2736) "eosio::char_to_symbol(\'d\') != 9\00") - (data (i32.const 2784) "eosio::char_to_symbol(\'e\') != 10\00") - (data (i32.const 2832) "eosio::char_to_symbol(\'f\') != 11\00") - (data (i32.const 2880) "eosio::char_to_symbol(\'g\') != 12\00") - (data (i32.const 2928) "eosio::char_to_symbol(\'h\') != 13\00") - (data (i32.const 2976) "eosio::char_to_symbol(\'i\') != 14\00") - (data (i32.const 3024) "eosio::char_to_symbol(\'j\') != 15\00") - (data (i32.const 3072) "eosio::char_to_symbol(\'k\') != 16\00") - (data (i32.const 3120) "eosio::char_to_symbol(\'l\') != 17\00") - (data (i32.const 3168) "eosio::char_to_symbol(\'m\') != 18\00") - (data (i32.const 3216) "eosio::char_to_symbol(\'n\') != 19\00") - (data (i32.const 3264) "eosio::char_to_symbol(\'o\') != 20\00") - (data (i32.const 3312) "eosio::char_to_symbol(\'p\') != 21\00") - (data (i32.const 3360) "eosio::char_to_symbol(\'q\') != 22\00") - (data (i32.const 3408) "eosio::char_to_symbol(\'r\') != 23\00") - (data (i32.const 3456) "eosio::char_to_symbol(\'s\') != 24\00") - (data (i32.const 3504) "eosio::char_to_symbol(\'t\') != 25\00") - (data (i32.const 3552) "eosio::char_to_symbol(\'u\') != 26\00") - (data (i32.const 3600) "eosio::char_to_symbol(\'v\') != 27\00") - (data (i32.const 3648) "eosio::char_to_symbol(\'w\') != 28\00") - (data (i32.const 3696) "eosio::char_to_symbol(\'x\') != 29\00") - (data (i32.const 3744) "eosio::char_to_symbol(\'y\') != 30\00") - (data (i32.const 3792) "eosio::char_to_symbol(\'z\') != 31\00") - (data (i32.const 3840) "a\00") - (data (i32.const 3856) "eosio::string_to_name(a)\00") - (data (i32.const 3888) "ba\00") - (data (i32.const 3904) "eosio::string_to_name(ba)\00") - (data (i32.const 3936) "cba\00") - (data (i32.const 3952) "eosio::string_to_name(cba)\00") - (data (i32.const 3984) "dcba\00") - (data (i32.const 4000) "eosio::string_to_name(dcba)\00") - (data (i32.const 4032) "edcba\00") - (data (i32.const 4048) "eosio::string_to_name(edcba)\00") - (data (i32.const 4080) "fedcba\00") - (data (i32.const 4096) "eosio::string_to_name(fedcba)\00") - (data (i32.const 4128) "gfedcba\00") - (data (i32.const 4144) "eosio::string_to_name(gfedcba)\00") - (data (i32.const 4176) "hgfedcba\00") - (data (i32.const 4192) "eosio::string_to_name(hgfedcba)\00") - (data (i32.const 4224) "ihgfedcba\00") - (data (i32.const 4240) "eosio::string_to_name(ihgfedcba)\00") - (data (i32.const 4288) "jihgfedcba\00") - (data (i32.const 4304) "eosio::string_to_name(jihgfedcba)\00") - (data (i32.const 4352) "kjihgfedcba\00") - (data (i32.const 4368) "eosio::string_to_name(kjihgfedcba)\00") - (data (i32.const 4416) "lkjihgfedcba\00") - (data (i32.const 4432) "eosio::string_to_name(lkjihgfedcba)\00") - (data (i32.const 4480) "mlkjihgfedcba\00") - (data (i32.const 4496) "eosio::string_to_name(mlkjihgfedcba)\00") - (data (i32.const 4544) "mlkjihgfedcba1\00") - (data (i32.const 4560) "mlkjihgfedcba2\00") - (data (i32.const 4576) "eosio::string_to_name(mlkjihgfedcba2)\00") - (data (i32.const 4624) "mlkjihgfedcba55\00") - (data (i32.const 4640) "mlkjihgfedcba14\00") - (data (i32.const 4656) "eosio::string_to_name(mlkjihgfedcba14)\00") - (data (i32.const 4704) "azAA34\00") - (data (i32.const 4720) "azBB34\00") - (data (i32.const 4736) "eosio::string_to_name N(azBB34)\00") - (data (i32.const 4768) "AZaz12Bc34\00") - (data (i32.const 4784) "eosio::string_to_name AZaz12Bc34\00") - (data (i32.const 4832) "AAAAAAAAAAAAAAA\00") - (data (i32.const 4848) "BBBBBBBBBBBBBDDDDDFFFGG\00") - (data (i32.const 4880) "eosio::string_to_name BBBBBBBBBBBBBDDDDDFFFGG\00") - (data (i32.const 4928) "eosio::name != N(azAA34)\00") - (data (i32.const 4960) "eosio::name != N(0)\00") - (data (i32.const 4992) "AA11\00") - (data (i32.const 5008) "eosio::name != N(AA11)\00") - (data (i32.const 5040) "11\00") - (data (i32.const 5056) "eosio::name != N(11)\00") - (data (i32.const 5088) "22\00") - (data (i32.const 5104) "eosio::name != N(22)\00") - (data (i32.const 5136) "AAAbbcccdd\00") - (data (i32.const 5152) "eosio::name == eosio::name\00") - (data (i32.const 5184) "11bbcccdd\00") - (data (i32.const 5200) "N(11bbcccdd) == tmp\00") - (data (i32.const 5232) "fixed_point128 instances comparison with same number of decimals\00") - (data (i32.const 5312) "fixed_point128 instances with different number of decimals\00") - (data (i32.const 5376) "fixed_point64 instances comparison with same number of decimals\00") - (data (i32.const 5440) "fixed_point64 instances with different number of decimals\00") - (data (i32.const 5504) "fixed_point32 instances comparison with same number of decimals\00") - (data (i32.const 5568) "fixed_point32 instances with different number of decimals\00") - (data (i32.const 5632) "fixed_point32 instances addition with zero decmimals\00") - (data (i32.const 5696) "fixed_point64 instances addition with zero decmimals\00") - (data (i32.const 5760) "fixed_point64 instances subtraction with zero decmimals\00") - (data (i32.const 5824) "fixed_point32 instances subtraction with zero decmimals\00") - (data (i32.const 5888) "fixed_point64 instances multiplication result in fixed_point128\00") - (data (i32.const 5952) "fixed_point32 instances multiplication result in fixed_point64\00") - (data (i32.const 6016) "divide by zero\00") - (data (i32.const 6032) ".\00") - (data (i32.const 6048) "fixed_point64 instances division result from operator and function and compare in fixed_point128\00") - (data (i32.const 6160) "should\'ve thrown an error\00") - (data (i32.const 6192) "__multi3 result should be -3000\00") - (data (i32.const 6224) "__multi3 result should be 900\00") - (data (i32.const 6256) "__multi3 result should be 10000\00") - (data (i32.const 6288) "__multi3 result should be 100\00") - (data (i32.const 6320) "__multi3 result should be -30\00") - (data (i32.const 6352) "__divti3 result should be 0\00") - (data (i32.const 6384) "__divti3 result should be -3\00") - (data (i32.const 6416) "__divti3 result should be 1\00") - (data (i32.const 6448) "__divti3 result should be 33\00") - (data (i32.const 6480) "__divti3 result should be 100\00") - (data (i32.const 6512) "__divti3 result should be -30\00") - (data (i32.const 6544) "Should have eosio_asserted\00") - (data (i32.const 6576) "__udivti3 result should be 0\00") - (data (i32.const 6608) "__udivti3 result should be 1\00") - (data (i32.const 6640) "__lshlti3 result should be 1\00") - (data (i32.const 6672) "__lshlti3 result should be 2\00") - (data (i32.const 6704) "__lshlti3 result should be 2^31\00") - (data (i32.const 6736) "__lshlti3 result should be 2^63\00") - (data (i32.const 6768) "__lshlti3 result should be 2^64\00") - (data (i32.const 6800) "__lshlti3 result should be 2^127\00") - (data (i32.const 6848) "__lshlti3 result should be 2^128\00") - (data (i32.const 6896) "__ashlti3 result should be 1\00") - (data (i32.const 6928) "__ashlti3 result should be 2\00") - (data (i32.const 6960) "__ashlti3 result should be 2^31\00") - (data (i32.const 6992) "__ashlti3 result should be 2^63\00") - (data (i32.const 7024) "__ashlti3 result should be 2^64\00") - (data (i32.const 7056) "__ashlti3 result should be 2^127\00") - (data (i32.const 7104) "__ashlti3 result should be 2^128\00") - (data (i32.const 7152) "__lshrti3 result should be 2^127\00") - (data (i32.const 7200) "__lshrti3 result should be 2^126\00") - (data (i32.const 7248) "__lshrti3 result should be 2^64\00") - (data (i32.const 7280) "__lshrti3 result should be 2^63\00") - (data (i32.const 7312) "__lshrti3 result should be 2^31\00") - (data (i32.const 7344) "__lshrti3 result should be 2^0\00") - (data (i32.const 7376) "__ashrti3 result should be -2^127\00") - (data (i32.const 7424) "__ashrti3 result should be -2^126\00") - (data (i32.const 7472) "__ashrti3 result should be -2^125\00") - (data (i32.const 7520) "__ashrti3 result should be -2^63\00") - (data (i32.const 7568) "__ashrti3 result should be -2^31\00") - (data (i32.const 7616) "__ashrti3 result should be -2^0\00") - (data (i32.const 7648) "__modti3 result should be -30\00") - (data (i32.const 7680) "__modti3 result should be 30\00") - (data (i32.const 7712) "__modti3 result should be 10\00") - (data (i32.const 7744) "__modti3 result should be 0\00") - (data (i32.const 7776) "should have thrown an error\00") - (data (i32.const 7808) "public key does not match\00") - (data (i32.const 7840) "abc\00") - (data (i32.const 7856) "\a9\99>6G\06\81j\ba>%qxP\c2l\9c\d0\d8\9d") - (data (i32.const 7888) "sha1 test1\00") - (data (i32.const 7904) "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\00") - (data (i32.const 7968) "\84\98>D\1c;\d2n\ba\aeJ\a1\f9Q)\e5\e5Fp\f1") - (data (i32.const 8000) "sha1 test3\00") - (data (i32.const 8016) "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu\00") - (data (i32.const 8144) "\a4\9b$F\a0,d[\f4\19\f9\95\b6p\91%:\04\a2Y") - (data (i32.const 8176) "sha1 test4\00") - (data (i32.const 8192) "message digest\00") - (data (i32.const 8208) "\c1\"R\ce\da\8b\e8\99M_\a0)\nG#\1c\1d\16\aa\e3") - (data (i32.const 8240) "sha1 test5\00") - (data (i32.const 8256) "\bax\16\bf\8f\01\cf\eaAA@\de]\ae\"#\b0\03a\a3\96\17z\9c\b4\10\ffa\f2\00\15\ad") - (data (i32.const 8288) "sha256 test1\00") - (data (i32.const 8304) "$\8dja\d2\068\b8\e5\c0&\93\0c>`9\a3<\e4Yd\ff!g\f6\ec\ed\d4\19\db\06\c1") - (data (i32.const 8336) "sha256 test3\00") - (data (i32.const 8352) "\cf[\16\a7x\af\83\80\03l\e5\9e{\04\927\0b$\9b\11\e8\f0zQ\af\acE\03z\fe\e9\d1") - (data (i32.const 8384) "sha256 test4\00") - (data (i32.const 8400) "\f7\84oU\cf#\e1N\eb\ea\b5\b4\e1U\0c\ad[P\9e3H\fb\c4\ef\a3\a1A=9<\b6P") - (data (i32.const 8432) "sha256 test5\00") - (data (i32.const 8448) "\dd\af5\a1\93az\ba\ccAsI\ae A1\12\e6\faN\89\a9~\a2\n\9e\ee\e6KU\d3\9a!\92\99*\'O\c1\a86\ba<#\a3\fe\eb\bdEMD#d<\e8\0e*\9a\c9O\a5L\a4\9f") - (data (i32.const 8512) "sha512 test1\00") - (data (i32.const 8528) " J\8f\c6\dd\a8/\n\0c\ed{\eb\8e\08\a4\16W\c1n\f4h\b2(\a8\'\9b\e31\a7\03\c35\96\fd\15\c1;\1b\07\f9\aa\1d;\eaWx\9c\a01\ad\85\c7\a7\1d\d7\03T\ecc\128\ca4E") - (data (i32.const 8592) "sha512 test3\00") - (data (i32.const 8608) "\8e\95\9bu\da\e3\13\da\8c\f4\f7(\14\fc\14?\8fwy\c6\eb\9f\7f\a1r\99\ae\ad\b6\88\90\18P\1d(\9eI\00\f7\e43\1b\99\de\c4\b5C:\c7\d3)\ee\b6\dd&T^\96\e5[\87K\e9\t") - (data (i32.const 8672) "sha512 test4\00") - (data (i32.const 8688) "\10}\bf8\9d\9e\9fq\a3\a9_l\05[\92Q\bcRh\c2\be\16\d6\c14\92\eaE\b0\19\9f3\t\e1dU\ab\1e\96\11\8e\8a\90]U\97\b7 8\dd\b3r\a8\98&\04m\e6f\87\bbB\0e|") - (data (i32.const 8752) "sha512 test5\00") - (data (i32.const 8768) "\8e\b2\08\f7\e0]\98z\9b\04J\8e\98\c6\b0\87\f1Z\0b\fc") - (data (i32.const 8800) "ripemd160 test1\00") - (data (i32.const 8816) "\12\a0S8J\9c\0c\88\e4\05\a0l\'\dc\f4\9a\dab\eb+") - (data (i32.const 8848) "ripemd160 test3\00") - (data (i32.const 8864) "o?\a3\9bkP<8O\91\9aI\a7\aa\\,\08\bd\fbE") - (data (i32.const 8896) "ripemd160 test4\00") - (data (i32.const 8912) "]\06\89\efI\d2\fa\e5r\b8\81\b1#\a8_\fa!Y_6") - (data (i32.const 8944) "ripemd160 test5\00") - (data (i32.const 8976) "\da9\a3\ee^kK\0d2U\bf\ef\95`\18\90\af\d8\07\t") - (data (i32.const 9008) "sha1 test2\00") - (data (i32.const 9024) "\e3\b0\c4B\98\fc\1c\14\9a\fb\f4\c8\99o\b9$\'\aeA\e4d\9b\93L\a4\95\99\1bxR\b8U") - (data (i32.const 9056) "sha256 test2\00") - (data (i32.const 9072) "\cf\83\e15~\ef\b8\bd\f1T(P\d6m\80\07\d6 \e4\05\0bW\15\dc\83\f4\a9!\d3l\e9\ceG\d0\d1<]\85\f2\b0\ff\83\18\d2\87~\ec/c\b91\bdGAz\81\a582z\f9\'\da>") - (data (i32.const 9136) "sha512 test2\00") - (data (i32.const 9152) "\9c\11\85\a5\c5\e9\fcTa(\08\97~\e8\f5H\b2%\8d1") - (data (i32.const 9184) "ripemd160 test2\00") - (data (i32.const 9200) "should have failed\00") - (data (i32.const 9232) "producers.len != 21\00") - (data (i32.const 9264) "Active producer\00") - (data (i32.const 9280) "EwfUD\12\cd\11\ab\12\aeQt") - (data (i32.const 17488) "send_message_large() should\'ve thrown an error\00") - (data (i32.const 17536) "tapos_block_prefix does not match\00") - (data (i32.const 17584) "tapos_block_num does not match\00") - (data (i32.const 17616) "read_transaction failed\00") - (data (i32.const 17648) "size: \00") - (data (i32.const 17664) "transaction size does not match\00") - (data (i32.const 17696) "EwfUD\12\cd\11\ab\12\aeQt") - (data (i32.const 17712) "send_transaction_empty() should\'ve thrown an error\00") - (data (i32.const 17776) "transaction should only have one action\00") - (data (i32.const 17824) "transaction has wrong code\00") - (data (i32.const 17856) "transaction has wrong name\00") - (data (i32.const 17888) "action should only have one authorization\00") - (data (i32.const 17936) "action\'s authorization has wrong actor\00") - (data (i32.const 17984) "action\'s authorization has wrong permission\00") - (data (i32.const 18032) "send_transaction_large() should\'ve thrown an error\00") - (data (i32.const 18096) "deferred executed\n\00") - (data (i32.const 18128) "transaction was not found\00") - (data (i32.const 18160) "transaction was canceled, whild should not be found\00") - (data (i32.const 18224) "context free actions cannot have authorizations\00") - (data (i32.const 18272) "dummy\00") - (data (i32.const 18288) "send_cfa_action_fail() should\'ve thrown an error\00") - (data (i32.const 18352) "test_transaction\00") - (data (i32.const 18384) "table\00") - (data (i32.const 18400) "newfeature\00") - (data (i32.const 18416) "we should not have new features unless hardfork\00") - (data (i32.const 18464) "unexpected last used permission time\00") - (data (i32.const 18512) "unexpected account creation time\00") - (data (i32.const 18560) "bool\00") - (data (i32.const 18576) "int8\00") - (data (i32.const 18592) "uint8\00") - (data (i32.const 18608) "int16\00") - (data (i32.const 18624) "uint16\00") - (data (i32.const 18640) "int32\00") - (data (i32.const 18656) "uint32\00") - (data (i32.const 18672) "int64\00") - (data (i32.const 18688) "uint64\00") - (data (i32.const 18704) "float\00") - (data (i32.const 18720) "double\00") - (data (i32.const 18728) "\01\00\00\00\00\00\00\0082\8f\fc\c1\c0\f3?") - (data (i32.const 18752) "struct\00") - (data (i32.const 18760) "\n\00\00\00\14\00\00\00") - (data (i32.const 18768) "StaticArray\00") - (data (i32.const 18784) "string\00") - (data (i32.const 18800) "vector\00") - (data (i32.const 18816) "empty vector\00") - (data (i32.const 18832) "\n\00\00\00\14\00\00\00\1e\00\00\00") - (data (i32.const 18848) "std::array\00") - (data (i32.const 18864) "apple\00") - (data (i32.const 18880) "cat\00") - (data (i32.const 18896) "panda\00") - (data (i32.const 18912) "map\00") - (data (i32.const 18928) "tuple\00") - (data (i32.const 18944) "eosio\00") - (data (i32.const 18960) "onerror\00") - (data (i32.const 18976) "onerror called\n\00") - (data (i32.const 18992) "Unknown Test\00") - (data (i32.const 27408) "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 "_ZN11test_action18read_action_normalEv" (func $_ZN11test_action18read_action_normalEv)) - (export "_ZN11test_action17test_dummy_actionEv" (func $_ZN11test_action17test_dummy_actionEv)) - (export "_ZN11test_action16read_action_to_0Ev" (func $_ZN11test_action16read_action_to_0Ev)) - (export "_ZN11test_action18read_action_to_64kEv" (func $_ZN11test_action18read_action_to_64kEv)) - (export "_ZN11test_action14test_cf_actionEv" (func $_ZN11test_action14test_cf_actionEv)) - (export "_ZN11test_action14require_noticeEyyy" (func $_ZN11test_action14require_noticeEyyy)) - (export "_ZN11test_action12require_authEv" (func $_ZN11test_action12require_authEv)) - (export "_ZN11test_action12assert_falseEv" (func $_ZN11test_action12assert_falseEv)) - (export "_ZN11test_action11assert_trueEv" (func $_ZN11test_action11assert_trueEv)) - (export "_ZN11test_action14assert_true_cfEv" (func $_ZN11test_action14assert_true_cfEv)) - (export "_ZN11test_action10test_abortEv" (func $_ZN11test_action10test_abortEv)) - (export "_ZN11test_action21test_publication_timeEv" (func $_ZN11test_action21test_publication_timeEv)) - (export "_ZN11test_action21test_current_receiverEyyy" (func $_ZN11test_action21test_current_receiverEyyy)) - (export "_ZN11test_action17test_current_timeEv" (func $_ZN11test_action17test_current_timeEv)) - (export "_ZN11test_action16test_assert_codeEv" (func $_ZN11test_action16test_assert_codeEv)) - (export "_ZN10test_print13test_prints_lEv" (func $_ZN10test_print13test_prints_lEv)) - (export "_ZN10test_print11test_printsEv" (func $_ZN10test_print11test_printsEv)) - (export "_ZN10test_print11test_printiEv" (func $_ZN10test_print11test_printiEv)) - (export "_ZN10test_print12test_printuiEv" (func $_ZN10test_print12test_printuiEv)) - (export "_ZN10test_print14test_printi128Ev" (func $_ZN10test_print14test_printi128Ev)) - (export "_ZN10test_print15test_printui128Ev" (func $_ZN10test_print15test_printui128Ev)) - (export "_ZN10test_print11test_printnEv" (func $_ZN10test_print11test_printnEv)) - (export "_ZN10test_print12test_printsfEv" (func $_ZN10test_print12test_printsfEv)) - (export "_ZN10test_print12test_printdfEv" (func $_ZN10test_print12test_printdfEv)) - (export "_ZN10test_print12test_printqfEv" (func $_ZN10test_print12test_printqfEv)) - (export "_ZN10test_print17test_print_simpleEv" (func $_ZN10test_print17test_print_simpleEv)) - (export "_ZN10test_types10types_sizeEv" (func $_ZN10test_types10types_sizeEv)) - (export "_ZN10test_types14char_to_symbolEv" (func $_ZN10test_types14char_to_symbolEv)) - (export "_ZN10test_types14string_to_nameEv" (func $_ZN10test_types14string_to_nameEv)) - (export "_ZN10test_types10name_classEv" (func $_ZN10test_types10name_classEv)) - (export "_ZN15test_fixedpoint16create_instancesEv" (func $_ZN15test_fixedpoint16create_instancesEv)) - (export "_ZN15test_fixedpoint13test_additionEv" (func $_ZN15test_fixedpoint13test_additionEv)) - (export "_ZN15test_fixedpoint16test_subtractionEv" (func $_ZN15test_fixedpoint16test_subtractionEv)) - (export "_ZN15test_fixedpoint19test_multiplicationEv" (func $_ZN15test_fixedpoint19test_multiplicationEv)) - (export "_ZN15test_fixedpoint13test_divisionEv" (func $_ZN15test_fixedpoint13test_divisionEv)) - (export "_ZN15test_fixedpoint18test_division_by_0Ev" (func $_ZN15test_fixedpoint18test_division_by_0Ev)) - (export "_Zli5_ULLLPKc" (func $_Zli5_ULLLPKc)) - (export "_Zli4_LLLPKc" (func $_Zli4_LLLPKc)) - (export "_ZN22test_compiler_builtins11test_multi3Ev" (func $_ZN22test_compiler_builtins11test_multi3Ev)) - (export "_ZN22test_compiler_builtins11test_divti3Ev" (func $_ZN22test_compiler_builtins11test_divti3Ev)) - (export "_ZN22test_compiler_builtins16test_divti3_by_0Ev" (func $_ZN22test_compiler_builtins16test_divti3_by_0Ev)) - (export "_ZN22test_compiler_builtins12test_udivti3Ev" (func $_ZN22test_compiler_builtins12test_udivti3Ev)) - (export "_ZN22test_compiler_builtins17test_udivti3_by_0Ev" (func $_ZN22test_compiler_builtins17test_udivti3_by_0Ev)) - (export "_ZN22test_compiler_builtins12test_lshlti3Ev" (func $_ZN22test_compiler_builtins12test_lshlti3Ev)) - (export "_ZN22test_compiler_builtins12test_ashlti3Ev" (func $_ZN22test_compiler_builtins12test_ashlti3Ev)) - (export "_ZN22test_compiler_builtins12test_lshrti3Ev" (func $_ZN22test_compiler_builtins12test_lshrti3Ev)) - (export "_ZN22test_compiler_builtins12test_ashrti3Ev" (func $_ZN22test_compiler_builtins12test_ashrti3Ev)) - (export "_ZN22test_compiler_builtins11test_modti3Ev" (func $_ZN22test_compiler_builtins11test_modti3Ev)) - (export "_ZN22test_compiler_builtins16test_modti3_by_0Ev" (func $_ZN22test_compiler_builtins16test_modti3_by_0Ev)) - (export "_ZN22test_compiler_builtins12test_umodti3Ev" (func $_ZN22test_compiler_builtins12test_umodti3Ev)) - (export "_ZN22test_compiler_builtins17test_umodti3_by_0Ev" (func $_ZN22test_compiler_builtins17test_umodti3_by_0Ev)) - (export "my_strlen" (func $my_strlen)) - (export "my_memcmp" (func $my_memcmp)) - (export "_ZN11test_crypto28test_recover_key_assert_trueEv" (func $_ZN11test_crypto28test_recover_key_assert_trueEv)) - (export "_ZN11test_crypto29test_recover_key_assert_falseEv" (func $_ZN11test_crypto29test_recover_key_assert_falseEv)) - (export "_ZN11test_crypto16test_recover_keyEv" (func $_ZN11test_crypto16test_recover_keyEv)) - (export "_ZN11test_crypto9test_sha1Ev" (func $_ZN11test_crypto9test_sha1Ev)) - (export "_ZN11test_crypto11test_sha256Ev" (func $_ZN11test_crypto11test_sha256Ev)) - (export "_ZN11test_crypto11test_sha512Ev" (func $_ZN11test_crypto11test_sha512Ev)) - (export "_ZN11test_crypto14test_ripemd160Ev" (func $_ZN11test_crypto14test_ripemd160Ev)) - (export "_ZN11test_crypto11sha256_nullEv" (func $_ZN11test_crypto11sha256_nullEv)) - (export "_ZN11test_crypto12sha1_no_dataEv" (func $_ZN11test_crypto12sha1_no_dataEv)) - (export "_ZN11test_crypto14sha256_no_dataEv" (func $_ZN11test_crypto14sha256_no_dataEv)) - (export "_ZN11test_crypto14sha512_no_dataEv" (func $_ZN11test_crypto14sha512_no_dataEv)) - (export "_ZN11test_crypto17ripemd160_no_dataEv" (func $_ZN11test_crypto17ripemd160_no_dataEv)) - (export "_ZN11test_crypto19assert_sha256_falseEv" (func $_ZN11test_crypto19assert_sha256_falseEv)) - (export "_ZN11test_crypto18assert_sha256_trueEv" (func $_ZN11test_crypto18assert_sha256_trueEv)) - (export "_ZN11test_crypto17assert_sha1_falseEv" (func $_ZN11test_crypto17assert_sha1_falseEv)) - (export "_ZN11test_crypto16assert_sha1_trueEv" (func $_ZN11test_crypto16assert_sha1_trueEv)) - (export "_ZN11test_crypto19assert_sha512_falseEv" (func $_ZN11test_crypto19assert_sha512_falseEv)) - (export "_ZN11test_crypto18assert_sha512_trueEv" (func $_ZN11test_crypto18assert_sha512_trueEv)) - (export "_ZN11test_crypto22assert_ripemd160_falseEv" (func $_ZN11test_crypto22assert_ripemd160_falseEv)) - (export "_ZN11test_crypto21assert_ripemd160_trueEv" (func $_ZN11test_crypto21assert_ripemd160_trueEv)) - (export "_ZN10test_chain16test_activeprodsEv" (func $_ZN10test_chain16test_activeprodsEv)) - (export "_Z9copy_dataPcjRNSt3__16vectorIcNS0_9allocatorIcEEEE" (func $_Z9copy_dataPcjRNSt3__16vectorIcNS0_9allocatorIcEEEE)) - (export "_ZN16test_transaction11send_actionEv" (func $_ZN16test_transaction11send_actionEv)) - (export "_ZN16test_transaction17send_action_emptyEv" (func $_ZN16test_transaction17send_action_emptyEv)) - (export "_ZN16test_transaction17send_action_largeEv" (func $_ZN16test_transaction17send_action_largeEv)) - (export "_ZN16test_transaction19send_action_recurseEv" (func $_ZN16test_transaction19send_action_recurseEv)) - (export "_ZN16test_transaction23send_action_inline_failEv" (func $_ZN16test_transaction23send_action_inline_failEv)) - (export "_ZN16test_transaction23test_tapos_block_prefixEv" (func $_ZN16test_transaction23test_tapos_block_prefixEv)) - (export "_ZN16test_transaction20test_tapos_block_numEv" (func $_ZN16test_transaction20test_tapos_block_numEv)) - (export "_ZN16test_transaction21test_read_transactionEv" (func $_ZN16test_transaction21test_read_transactionEv)) - (export "_ZN16test_transaction21test_transaction_sizeEv" (func $_ZN16test_transaction21test_transaction_sizeEv)) - (export "_ZN16test_transaction16send_transactionEyyy" (func $_ZN16test_transaction16send_transactionEyyy)) - (export "_ZN16test_transaction18send_action_senderEyyy" (func $_ZN16test_transaction18send_action_senderEyyy)) - (export "_ZN16test_transaction22send_transaction_emptyEyyy" (func $_ZN16test_transaction22send_transaction_emptyEyyy)) - (export "_ZN16test_transaction38send_transaction_trigger_error_handlerEyyy" (func $_ZN16test_transaction38send_transaction_trigger_error_handlerEyyy)) - (export "_ZN16test_transaction26assert_false_error_handlerERKN5eosio11transactionE" (func $_ZN16test_transaction26assert_false_error_handlerERKN5eosio11transactionE)) - (export "_ZN16test_transaction22send_transaction_largeEyyy" (func $_ZN16test_transaction22send_transaction_largeEyyy)) - (export "_ZN16test_transaction14deferred_printEv" (func $_ZN16test_transaction14deferred_printEv)) - (export "_ZN16test_transaction25send_deferred_transactionEyyy" (func $_ZN16test_transaction25send_deferred_transactionEyyy)) - (export "_ZN16test_transaction33send_deferred_transaction_replaceEyyy" (func $_ZN16test_transaction33send_deferred_transaction_replaceEyyy)) - (export "_ZN16test_transaction32send_deferred_tx_with_dtt_actionEv" (func $_ZN16test_transaction32send_deferred_tx_with_dtt_actionEv)) - (export "_ZN16test_transaction35cancel_deferred_transaction_successEv" (func $_ZN16test_transaction35cancel_deferred_transaction_successEv)) - (export "_ZN16test_transaction37cancel_deferred_transaction_not_foundEv" (func $_ZN16test_transaction37cancel_deferred_transaction_not_foundEv)) - (export "_ZN16test_transaction14send_cf_actionEv" (func $_ZN16test_transaction14send_cf_actionEv)) - (export "_ZN16test_transaction19send_cf_action_failEv" (func $_ZN16test_transaction19send_cf_action_failEv)) - (export "_ZN16test_transaction12stateful_apiEv" (func $_ZN16test_transaction12stateful_apiEv)) - (export "_ZN16test_transaction16context_free_apiEv" (func $_ZN16test_transaction16context_free_apiEv)) - (export "_ZN16test_transaction11new_featureEv" (func $_ZN16test_transaction11new_featureEv)) - (export "_ZN16test_transaction18active_new_featureEv" (func $_ZN16test_transaction18active_new_featureEv)) - (export "_ZN14test_checktime14checktime_passEv" (func $_ZN14test_checktime14checktime_passEv)) - (export "_ZN14test_checktime17checktime_failureEv" (func $_ZN14test_checktime17checktime_failureEv)) - (export "_ZN14test_checktime22checktime_sha1_failureEv" (func $_ZN14test_checktime22checktime_sha1_failureEv)) - (export "_ZN14test_checktime29checktime_assert_sha1_failureEv" (func $_ZN14test_checktime29checktime_assert_sha1_failureEv)) - (export "_ZN14test_checktime24checktime_sha256_failureEv" (func $_ZN14test_checktime24checktime_sha256_failureEv)) - (export "_ZN14test_checktime31checktime_assert_sha256_failureEv" (func $_ZN14test_checktime31checktime_assert_sha256_failureEv)) - (export "_ZN14test_checktime24checktime_sha512_failureEv" (func $_ZN14test_checktime24checktime_sha512_failureEv)) - (export "_ZN14test_checktime31checktime_assert_sha512_failureEv" (func $_ZN14test_checktime31checktime_assert_sha512_failureEv)) - (export "_ZN14test_checktime27checktime_ripemd160_failureEv" (func $_ZN14test_checktime27checktime_ripemd160_failureEv)) - (export "_ZN14test_checktime34checktime_assert_ripemd160_failureEv" (func $_ZN14test_checktime34checktime_assert_ripemd160_failureEv)) - (export "_ZN15test_permission19check_authorizationEyyy" (func $_ZN15test_permission19check_authorizationEyyy)) - (export "_ZN15test_permission25test_permission_last_usedEyyy" (func $_ZN15test_permission25test_permission_last_usedEyyy)) - (export "_ZN15test_permission26test_account_creation_timeEyyy" (func $_ZN15test_permission26test_account_creation_timeEyyy)) - (export "_ZN15test_datastream10test_basicEv" (func $_ZN15test_datastream10test_basicEv)) - (export "apply" (func $apply)) - (export "fabs" (func $fabs)) - (export "fabsf" (func $fabsf)) - (export "memccpy" (func $memccpy)) - (export "memcmp" (func $memcmp)) - (export "strlen" (func $strlen)) - (export "malloc" (func $malloc)) - (export "free" (func $free)) - (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 $_ZN11test_action18read_action_normalEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 112) - ) - ) - ) - (call $eosio_assert - (i32.eq - (call $action_data_size) - (i32.const 13) - ) - (i32.const 32) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (get_local $0) - (i32.const 30) - ) - (i32.const 13) - ) - (i32.const 80) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (get_local $0) - (i32.const 100) - ) - (i32.const 13) - ) - (i32.const 96) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (get_local $0) - (i32.const 5) - ) - (i32.const 5) - ) - (i32.const 128) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (get_local $0) - (i32.const 13) - ) - (i32.const 13) - ) - (i32.const 144) - ) - (call $eosio_assert - (i32.eq - (i32.load8_u - (get_local $0) - ) - (i32.const 69) - ) - (i32.const 192) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=1 align=1 - (get_local $0) - ) - (i64.const -6119884940280240521) - ) - (i32.const 240) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=9 align=1 - (get_local $0) - ) - (i32.const 1951510034) - ) - (i32.const 288) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 112) - ) - ) - ) - (func $_ZN11test_action17test_dummy_actionEv - (local $0 i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (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 176) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (tee_local $0 - (call $get_action - (i32.const 1) - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 64) - ) - (call $get_action - (i32.const 1) - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 64) - ) - (i32.const 0) - ) - ) - ) - (i32.const 0) - ) - (i32.const 336) - ) - (call $_ZN5eosio10get_actionEmm - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.const 1) - (i32.const 0) - ) - (set_local $1 - (i64.load - (i32.add - (i32.load - (i32.add - (get_local $10) - (i32.const 44) - ) - ) - (i32.const -16) - ) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 368) - ) - (set_local $8 - (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 $7) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $2 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $2 - (select - (i32.add - (get_local $2) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $2) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $2) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $1) - (get_local $8) - ) - (i32.const 384) - ) - (set_local $1 - (i64.load - (i32.add - (i32.load - (i32.add - (get_local $10) - (i32.const 44) - ) - ) - (i32.const -8) - ) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 416) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $7) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $2 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $2 - (select - (i32.add - (get_local $2) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $2) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $2) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $1) - (get_local $8) - ) - (i32.const 432) - ) - (set_local $5 - (i32.const 16) - ) - (set_local $7 - (i64.extend_u/i32 - (i32.shr_s - (tee_local $4 - (i32.sub - (tee_local $2 - (i32.load - (i32.add - (get_local $10) - (i32.const 44) - ) - ) - ) - (tee_local $3 - (i32.load - (i32.add - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.const 16) - ) - ) - ) - ) - ) - (i32.const 4) - ) - ) - ) - (loop $label$12 - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (br_if $label$12 - (i64.ne - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.eq - (get_local $3) - (get_local $2) - ) - ) - (set_local $5 - (i32.add - (i32.and - (get_local $4) - (i32.const -16) - ) - (get_local $5) - ) - ) - ) - (set_local $5 - (i32.sub - (i32.sub - (i32.add - (get_local $0) - (tee_local $2 - (i32.load offset=52 - (get_local $10) - ) - ) - ) - (get_local $5) - ) - (tee_local $0 - (i32.load - (i32.add - (get_local $10) - (i32.const 56) - ) - ) - ) - ) - ) - (set_local $7 - (i64.extend_u/i32 - (i32.sub - (get_local $0) - (get_local $2) - ) - ) - ) - (loop $label$14 - (set_local $5 - (i32.add - (get_local $5) - (i32.const -1) - ) - ) - (br_if $label$14 - (i64.ne - (tee_local $7 - (i64.shr_u - (get_local $7) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (call $eosio_assert - (i32.eqz - (get_local $5) - ) - (i32.const 464) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 368) - ) - (set_local $1 - (i64.load offset=24 - (get_local $10) - ) - ) - (set_local $8 - (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 $7) - (i64.const 6) - ) - ) - (br_if $label$19 - (i32.gt_u - (i32.and - (i32.add - (tee_local $2 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 165) - ) - ) - (br $label$18) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$17 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$16) - ) - (set_local $2 - (select - (i32.add - (get_local $2) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $2) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $2) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$15 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $1) - (get_local $8) - ) - (i32.const 512) - ) - (call $_ZN5eosio6action7data_asI12dummy_actionEET_v - (i32.add - (get_local $10) - (i32.const 8) - ) - (i32.add - (get_local $10) - (i32.const 24) - ) - ) - (block $label$21 - (block $label$22 - (block $label$23 - (br_if $label$23 - (i64.ne - (i64.load offset=9 align=1 - (get_local $10) - ) - (i64.const 200) - ) - ) - (drop - (call $get_context_free_data - (i32.const 0) - (i32.const 0) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 544) - ) - (br_if $label$22 - (tee_local $5 - (i32.load offset=52 - (get_local $10) - ) - ) - ) - (br $label$21) - ) - (call $eosio_assert - (i32.eq - (i32.load8_u offset=8 - (get_local $10) - ) - (i32.const 69) - ) - (i32.const 608) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=9 align=1 - (get_local $10) - ) - (i64.const -6119884940280240521) - ) - (i32.const 656) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=17 align=1 - (get_local $10) - ) - (i32.const 1951510034) - ) - (i32.const 704) - ) - (br_if $label$21 - (i32.eqz - (tee_local $5 - (i32.load offset=52 - (get_local $10) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 56) - ) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (block $label$24 - (br_if $label$24 - (i32.eqz - (tee_local $5 - (i32.load offset=40 - (get_local $10) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 44) - ) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 176) - ) - ) - ) - (func $_ZN5eosio10get_actionEmm (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (set_local $5 - (tee_local $4 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $4) - ) - (call $eosio_assert - (i32.gt_s - (tee_local $3 - (call $get_action - (get_local $1) - (get_local $2) - (i32.const 0) - (i32.const 0) - ) - ) - (i32.const 0) - ) - (i32.const 816) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (get_local $3) - (i32.const 513) - ) - ) - (set_local $4 - (call $malloc - (get_local $3) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $4 - (i32.sub - (get_local $4) - (i32.and - (i32.add - (get_local $3) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (call $eosio_assert - (i32.eq - (get_local $3) - (call $get_action - (get_local $1) - (get_local $2) - (get_local $4) - (get_local $3) - ) - ) - (i32.const 336) - ) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 24) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 32) - ) - (i64.const 0) - ) - (i32.store - (get_local $5) - (get_local $4) - ) - (i32.store offset=8 - (get_local $5) - (tee_local $1 - (i32.add - (get_local $4) - (get_local $3) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (get_local $3) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $4) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (get_local $1) - (tee_local $3 - (i32.add - (get_local $4) - (i32.const 8) - ) - ) - ) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $3) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $5) - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__16vectorIcNS7_9allocatorIcEEEE - (call $_ZN5eosiorsINS_10datastreamIPKcEENS_16permission_levelEEERT_S7_RNSt3__16vectorIT0_NS8_9allocatorISA_EEEE - (get_local $5) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosio6action7data_asI12dummy_actionEET_v (param $0 i32) (param $1 i32) - (local $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (set_local $2 - (i64.load offset=8 - (get_local $1) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $8 - (i64.const 59) - ) - (set_local $4 - (i32.const 752) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$0 - (set_local $6 - (i64.const 0) - ) - (block $label$1 - (br_if $label$1 - (i64.gt_u - (get_local $7) - (i64.const 11) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (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$2) - ) - (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 $6 - (i64.shl - (i64.extend_u/i32 - (i32.and - (get_local $3) - (i32.const 31) - ) - ) - (i64.and - (get_local $8) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $8 - (i64.add - (get_local $8) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $5) - ) - (i32.const 768) - ) - (set_local $2 - (i64.load - (get_local $1) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $4 - (i32.const 368) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i64.gt_u - (get_local $7) - (i64.const 6) - ) - ) - (br_if $label$8 - (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$7) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$6 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$5) - ) - (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 $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $8) - (get_local $5) - ) - ) - (br_if $label$4 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $5) - ) - (i32.const 784) - ) - (call $eosio_assert - (i32.ne - (tee_local $3 - (i32.sub - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - (tee_local $4 - (i32.load offset=28 - (get_local $1) - ) - ) - ) - ) - (i32.const 0) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $4) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.add - (get_local $3) - (i32.const -1) - ) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 1) - ) - (i32.add - (get_local $4) - (i32.const 1) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.add - (get_local $3) - (i32.const -9) - ) - (i32.const 3) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 9) - ) - (i32.add - (get_local $4) - (i32.const 9) - ) - (i32.const 4) - ) - ) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEENS_16permission_levelEEERT_S7_RNSt3__16vectorIT0_NS8_9allocatorISA_EEEE (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) - (set_local $7 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $5 - (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 $7) - (i32.load - (get_local $2) - ) - ) - (i32.const 848) - ) - (set_local $4 - (i32.load8_u - (tee_local $7 - (i32.load - (get_local $3) - ) - ) - ) - ) - (i32.store - (get_local $3) - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - ) - (set_local $5 - (i64.or - (i64.extend_u/i32 - (i32.shl - (i32.and - (get_local $4) - (i32.const 127) - ) - (tee_local $6 - (i32.and - (get_local $6) - (i32.const 255) - ) - ) - ) - ) - (get_local $5) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 7) - ) - ) - (br_if $label$0 - (i32.shr_u - (get_local $4) - (i32.const 7) - ) - ) - ) - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.le_u - (tee_local $4 - (i32.wrap/i64 - (get_local $5) - ) - ) - (tee_local $6 - (i32.shr_s - (i32.sub - (tee_local $2 - (i32.load offset=4 - (get_local $1) - ) - ) - (tee_local $7 - (i32.load - (get_local $1) - ) - ) - ) - (i32.const 4) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIN5eosio16permission_levelENS_9allocatorIS2_EEE8__appendEj - (get_local $1) - (i32.sub - (get_local $4) - (get_local $6) - ) - ) - (br_if $label$2 - (i32.ne - (tee_local $7 - (i32.load - (get_local $1) - ) - ) - (tee_local $2 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (br $label$1) - ) - (block $label$4 - (br_if $label$4 - (i32.ge_u - (get_local $4) - (get_local $6) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (tee_local $2 - (i32.add - (get_local $7) - (i32.shl - (get_local $4) - (i32.const 4) - ) - ) - ) - ) - ) - (br_if $label$1 - (i32.eq - (get_local $7) - (get_local $2) - ) - ) - ) - (set_local $6 - (i32.load - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - (loop $label$5 - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (get_local $6) - ) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $7) - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (get_local $3) - ) - (get_local $6) - ) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - ) - (br_if $label$5 - (i32.ne - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $2) - ) - ) - ) - ) - (get_local $0) - ) - (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 848) - ) - (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 800) - ) - (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 $_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 $_ZNSt3__16vectorIN5eosio16permission_levelENS_9allocatorIS2_EEE8__appendEj (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 - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.ge_u - (i32.shr_s - (i32.sub - (tee_local $2 - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $7 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (i32.const 4) - ) - (get_local $1) - ) - ) - (br_if $label$2 - (i32.ge_u - (tee_local $4 - (i32.add - (tee_local $3 - (i32.shr_s - (i32.sub - (get_local $7) - (tee_local $6 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 4) - ) - ) - (get_local $1) - ) - ) - (i32.const 268435456) - ) - ) - (set_local $5 - (i32.const 268435455) - ) - (block $label$5 - (br_if $label$5 - (i32.gt_u - (i32.shr_s - (tee_local $2 - (i32.sub - (get_local $2) - (get_local $6) - ) - ) - (i32.const 4) - ) - (i32.const 134217726) - ) - ) - (br_if $label$3 - (i32.eqz - (tee_local $5 - (select - (get_local $4) - (tee_local $5 - (i32.shr_s - (get_local $2) - (i32.const 3) - ) - ) - (i32.lt_u - (get_local $5) - (get_local $4) - ) - ) - ) - ) - ) - (br_if $label$1 - (i32.ge_u - (get_local $5) - (i32.const 268435456) - ) - ) - ) - (set_local $2 - (call $_Znwj - (i32.shl - (get_local $5) - (i32.const 4) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $6 - (i32.load - (get_local $0) - ) - ) - (br $label$0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (i32.add - (get_local $7) - (i32.shl - (get_local $1) - (i32.const 4) - ) - ) - ) - (return) - ) - (set_local $5 - (i32.const 0) - ) - (set_local $2 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (call $abort) - (unreachable) - ) - (set_local $4 - (i32.sub - (tee_local $3 - (i32.add - (get_local $2) - (i32.shl - (get_local $3) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.sub - (get_local $7) - (get_local $6) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $3) - (i32.shl - (get_local $1) - (i32.const 4) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $2) - (i32.shl - (get_local $5) - (i32.const 4) - ) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.lt_s - (get_local $7) - (i32.const 1) - ) - ) - (drop - (call $memcpy - (get_local $4) - (get_local $6) - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $4) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $5) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (get_local $6) - ) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - ) - (func $_ZN11test_action16read_action_to_0Ev - (drop - (call $read_action_data - (i32.const 0) - (call $action_data_size) - ) - ) - ) - (func $_ZN11test_action18read_action_to_64kEv - (drop - (call $read_action_data - (i32.const 65534) - (call $action_data_size) - ) - ) - ) - (func $_ZN11test_action14test_cf_actionEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (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 144) - ) - ) - ) - (call $_ZN5eosio10get_actionEmm - (i32.add - (get_local $9) - (i32.const 104) - ) - (i32.const 0) - (i32.const 0) - ) - (call $_ZN5eosio6action7data_asI9cf_actionEET_v - (i32.add - (get_local $9) - (i32.const 96) - ) - (i32.add - (get_local $9) - (i32.const 104) - ) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $2 - (i32.add - (i32.load offset=96 - (get_local $9) - ) - (i32.const -100) - ) - ) - (i32.const 111) - ) - ) - (block $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (block $label$16 - (br_table $label$16 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$3 $label$15 $label$14 $label$13 $label$12 $label$11 $label$10 $label$9 $label$8 $label$7 $label$6 $label$5 $label$4 $label$16 - (get_local $2) - ) - ) - (call $eosio_assert - (i32.gt_s - (tee_local $0 - (call $get_context_free_data - (i32.load offset=100 - (get_local $9) - ) - (i32.const 0) - (i32.const 0) - ) - ) - (i32.const 0) - ) - (i32.const 864) - ) - (i32.store offset=88 - (get_local $9) - (i32.const 0) - ) - (i64.store offset=80 - (get_local $9) - (i64.const 0) - ) - (set_local $2 - (i32.const 0) - ) - (block $label$17 - (br_if $label$17 - (i32.eqz - (get_local $0) - ) - ) - (br_if $label$0 - (i32.le_s - (get_local $0) - (i32.const -1) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 88) - ) - (i32.add - (tee_local $2 - (call $_Znwj - (get_local $0) - ) - ) - (get_local $0) - ) - ) - (i32.store offset=80 - (get_local $9) - (get_local $2) - ) - (i32.store offset=84 - (get_local $9) - (get_local $2) - ) - (set_local $1 - (get_local $0) - ) - (loop $label$18 - (i32.store8 - (get_local $2) - (i32.const 0) - ) - (i32.store offset=84 - (get_local $9) - (tee_local $2 - (i32.add - (i32.load offset=84 - (get_local $9) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$18 - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -1) - ) - ) - ) - ) - (set_local $2 - (i32.load offset=80 - (get_local $9) - ) - ) - ) - (call $eosio_assert - (i32.eq - (call $get_context_free_data - (i32.load offset=100 - (get_local $9) - ) - (get_local $2) - (get_local $0) - ) - (i32.sub - (i32.load offset=84 - (get_local $9) - ) - (i32.load offset=80 - (get_local $9) - ) - ) - ) - (i32.const 896) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=84 - (get_local $9) - ) - (tee_local $2 - (i32.load offset=80 - (get_local $9) - ) - ) - ) - (i32.const 3) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $9) - (get_local $2) - (i32.const 4) - ) - ) - (i32.store offset=76 - (get_local $9) - (tee_local $2 - (i32.load - (get_local $9) - ) - ) - ) - (call $eosio_assert - (i32.eq - (get_local $2) - (i32.load offset=96 - (get_local $9) - ) - ) - (i32.const 928) - ) - (i32.store8 - (i32.add - (i32.add - (get_local $9) - (i32.const 68) - ) - (i32.const 4) - ) - (i32.load8_u offset=948 - (i32.const 0) - ) - ) - (i32.store offset=68 - (get_local $9) - (i32.load offset=944 align=1 - (i32.const 0) - ) - ) - (call $sha256 - (i32.add - (get_local $9) - (i32.const 68) - ) - (i32.const 5) - (get_local $9) - ) - (call $assert_sha256 - (i32.add - (get_local $9) - (i32.const 68) - ) - (i32.const 5) - (get_local $9) - ) - (drop - (call $action_data_size) - ) - (call $prints - (i32.const 960) - ) - (i32.store offset=64 - (get_local $9) - (i32.const 42) - ) - (drop - (call $memccpy - (i32.add - (get_local $9) - (i32.const 76) - ) - (i32.add - (get_local $9) - (i32.const 64) - ) - (i32.const 4) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.ne - (call $transaction_size) - (i32.const 0) - ) - (i32.const 976) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1008) - ) - (call $__divti3 - (i32.add - (get_local $9) - (i32.const 48) - ) - (i64.const 2) - (i64.const 2) - (i64.const 2) - (i64.const 2) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1040) - ) - (br_if $label$3 - (i32.eqz - (tee_local $2 - (i32.load offset=80 - (get_local $9) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $9) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (drop - (call $is_privileged - (i64.load offset=112 - (get_local $9) - ) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1088) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (drop - (call $get_active_producers - (i32.const 0) - (i32.const 0) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1136) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$19 - (block $label$20 - (block $label$21 - (block $label$22 - (block $label$23 - (block $label$24 - (br_if $label$24 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$23 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$22) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$21 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$20) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$19 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$25 - (block $label$26 - (block $label$27 - (block $label$28 - (block $label$29 - (block $label$30 - (br_if $label$30 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$29 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$28) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$27 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$26) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $7 - (i64.or - (get_local $6) - (get_local $7) - ) - ) - (br_if $label$25 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$31 - (block $label$32 - (block $label$33 - (block $label$34 - (block $label$35 - (block $label$36 - (br_if $label$36 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$35 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$34) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$33 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$32) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $6) - (get_local $8) - ) - ) - (br_if $label$31 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (drop - (call $db_store_i64 - (get_local $5) - (get_local $7) - (get_local $8) - (i64.const 0) - (i32.const 944) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1184) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (set_local $4 - (i64.const 0) - ) - (i64.store - (get_local $9) - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$37 - (block $label$38 - (block $label$39 - (block $label$40 - (block $label$41 - (block $label$42 - (br_if $label$42 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$41 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$40) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$39 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$38) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$37 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$43 - (block $label$44 - (block $label$45 - (block $label$46 - (block $label$47 - (block $label$48 - (br_if $label$48 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$47 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$46) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$45 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$44) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $7 - (i64.or - (get_local $6) - (get_local $7) - ) - ) - (br_if $label$43 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$49 - (block $label$50 - (block $label$51 - (block $label$52 - (block $label$53 - (block $label$54 - (br_if $label$54 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$53 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$52) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$51 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$50) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $6) - (get_local $8) - ) - ) - (br_if $label$49 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (drop - (call $db_idx64_store - (get_local $5) - (get_local $7) - (get_local $8) - (i64.const 0) - (get_local $9) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1184) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$55 - (block $label$56 - (block $label$57 - (block $label$58 - (block $label$59 - (block $label$60 - (br_if $label$60 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$59 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$58) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$57 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$56) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$55 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$61 - (block $label$62 - (block $label$63 - (block $label$64 - (block $label$65 - (block $label$66 - (br_if $label$66 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$65 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$64) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$63 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$62) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $7 - (i64.or - (get_local $6) - (get_local $7) - ) - ) - (br_if $label$61 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$67 - (block $label$68 - (block $label$69 - (block $label$70 - (block $label$71 - (block $label$72 - (br_if $label$72 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$71 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$70) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$69 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$68) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $6) - (get_local $8) - ) - ) - (br_if $label$67 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (drop - (call $db_find_i64 - (get_local $5) - (get_local $7) - (get_local $8) - (i64.const 1) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1184) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 24) - ) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $9) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $9) - (i64.const 0) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $9) - (i32.const 48) - ) - (get_local $9) - ) - (call $send_inline - (tee_local $2 - (i32.load offset=48 - (get_local $9) - ) - ) - (i32.sub - (i32.load offset=52 - (get_local $9) - ) - (get_local $2) - ) - ) - (block $label$73 - (br_if $label$73 - (i32.eqz - (tee_local $2 - (i32.load offset=48 - (get_local $9) - ) - ) - ) - ) - (i32.store offset=52 - (get_local $9) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1216) - ) - (block $label$74 - (br_if $label$74 - (i32.eqz - (tee_local $2 - (i32.load - (i32.add - (get_local $9) - (i32.const 28) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 32) - ) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (br_if $label$3 - (i32.eqz - (tee_local $2 - (i32.load - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 20) - ) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 944) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$75 - (block $label$76 - (block $label$77 - (block $label$78 - (block $label$79 - (block $label$80 - (br_if $label$80 - (i64.gt_u - (get_local $4) - (i64.const 3) - ) - ) - (br_if $label$79 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$78) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$77 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$76) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$75 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $require_auth - (get_local $5) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1264) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (drop - (call $current_time) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1312) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (drop - (call $current_time) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1312) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (drop - (call $publication_time) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1312) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (call $send_inline - (i32.const 1360) - (i32.const 6) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1376) - ) - (br_if $label$2 - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - (br $label$1) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$81 - (block $label$82 - (block $label$83 - (block $label$84 - (block $label$85 - (block $label$86 - (br_if $label$86 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$85 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$84) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$83 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$82) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$81 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $4 - (i64.const 0) - ) - (i64.store offset=8 - (get_local $9) - (i64.const 0) - ) - (i64.store - (get_local $9) - (get_local $5) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$87 - (block $label$88 - (block $label$89 - (block $label$90 - (block $label$91 - (block $label$92 - (br_if $label$92 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$91 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$90) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$89 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$88) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$87 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $send_deferred - (get_local $9) - (get_local $5) - (i32.const 1360) - (i32.const 6) - (i32.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1376) - ) - ) - (br_if $label$1 - (i32.eqz - (tee_local $2 - (i32.load offset=132 - (get_local $9) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 136) - ) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (block $label$93 - (br_if $label$93 - (i32.eqz - (tee_local $2 - (i32.load offset=120 - (get_local $9) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 124) - ) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 144) - ) - ) - (return) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $9) - (i32.const 80) - ) - ) - (unreachable) - ) - (func $_ZN5eosio6action7data_asI9cf_actionEET_v (param $0 i32) (param $1 i32) - (local $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (set_local $2 - (i64.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1440) - ) - (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 8) - ) - ) - (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) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $7) - ) - (i32.const 768) - ) - (set_local $2 - (i64.load - (get_local $1) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 368) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $6) - (i64.const 6) - ) - ) - (br_if $label$10 - (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$9) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$7) - ) - (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$6 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $7) - ) - (i32.const 784) - ) - (i64.store align=4 - (get_local $0) - (i64.const 100) - ) - (call $eosio_assert - (i32.gt_u - (tee_local $3 - (i32.sub - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - (tee_local $4 - (i32.load offset=28 - (get_local $1) - ) - ) - ) - ) - (i32.const 3) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $4) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.ne - (i32.and - (get_local $3) - (i32.const -4) - ) - (i32.const 4) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 4) - ) - (i32.add - (get_local $4) - (i32.const 4) - ) - (i32.const 4) - ) - ) - ) - (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 1424) - ) - (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 1424) - ) - (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 1424) - ) - (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 1424) - ) - (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 1424) - ) - (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 1424) - ) - (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 1424) - ) - (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 $_ZN11test_action14require_noticeEyyy (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 i64) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 368) - ) - (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) - ) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1456) - ) - (set_local $9 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $6) - (i64.const 3) - ) - ) - (br_if $label$10 - (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$9) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$7) - ) - (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 $9 - (i64.or - (get_local $8) - (get_local $9) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (block $label$12 - (block $label$13 - (block $label$14 - (br_if $label$14 - (i64.ne - (get_local $7) - (get_local $0) - ) - ) - (call $require_recipient - (get_local $9) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1472) - ) - (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 3) - ) - ) - (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) - ) - ) - ) - (call $require_recipient - (get_local $7) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1456) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$21 - (block $label$22 - (block $label$23 - (block $label$24 - (block $label$25 - (block $label$26 - (br_if $label$26 - (i64.gt_u - (get_local $6) - (i64.const 3) - ) - ) - (br_if $label$25 - (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$24) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$23 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$22) - ) - (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$21 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1472) - ) - (set_local $9 - (i64.const 0) - ) - (loop $label$27 - (block $label$28 - (block $label$29 - (block $label$30 - (block $label$31 - (block $label$32 - (br_if $label$32 - (i64.gt_u - (get_local $6) - (i64.const 3) - ) - ) - (br_if $label$31 - (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$30) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$29 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$28) - ) - (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 $9 - (i64.or - (get_local $8) - (get_local $9) - ) - ) - (br_if $label$27 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $require_recipient - (get_local $7) - ) - (call $require_recipient - (get_local $9) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1488) - ) - (br $label$13) - ) - (br_if $label$12 - (i64.eq - (get_local $9) - (get_local $0) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 1472) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$33 - (block $label$34 - (block $label$35 - (block $label$36 - (block $label$37 - (block $label$38 - (br_if $label$38 - (i64.gt_u - (get_local $6) - (i64.const 3) - ) - ) - (br_if $label$37 - (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$36) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$35 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$34) - ) - (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$33 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (br_if $label$12 - (i64.eq - (get_local $7) - (get_local $0) - ) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1488) - ) - ) - ) - (func $_ZN11test_action12require_authEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (call $prints - (i32.const 1520) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1536) - ) - (set_local $4 - (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 $3) - (i64.const 3) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $require_auth - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1552) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $3) - (i64.const 3) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $require_auth - (get_local $4) - ) - ) - (func $_ZN11test_action12assert_falseEv - (call $eosio_assert - (i32.const 0) - (i32.const 1568) - ) - ) - (func $_ZN11test_action11assert_trueEv - (call $eosio_assert - (i32.const 1) - (i32.const 1600) - ) - ) - (func $_ZN11test_action14assert_true_cfEv - (call $eosio_assert - (i32.const 1) - (i32.const 1600) - ) - ) - (func $_ZN11test_action10test_abortEv - (call $abort) - (unreachable) - ) - (func $_ZN11test_action21test_publication_timeEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 1632) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $0) - ) - (call $publication_time) - ) - (i32.const 1664) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN11test_action21test_current_receiverEyyy (param $0 i64) (param $1 i64) (param $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) - ) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $3) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $3) - ) - (get_local $0) - ) - (i32.const 1696) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - (func $_ZN11test_action17test_current_timeEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 1632) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $0) - ) - (call $current_time) - ) - (i32.const 1744) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN11test_action16test_assert_codeEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 1632) - ) - (call $eosio_assert_code - (i32.const 0) - (i64.load offset=8 - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN10test_print13test_prints_lEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store16 offset=14 - (get_local $0) - (i32.const 25185) - ) - (call $prints_l - (i32.add - (get_local $0) - (i32.const 14) - ) - (i32.const 2) - ) - (call $prints_l - (i32.add - (get_local $0) - (i32.const 14) - ) - (i32.const 1) - ) - (call $prints_l - (i32.add - (get_local $0) - (i32.const 14) - ) - (i32.const 0) - ) - (call $prints_l - (i32.const 944) - (i32.const 4) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN10test_print11test_printsEv - (call $prints - (i32.const 1776) - ) - (call $prints - (i32.const 0) - ) - (call $prints - (i32.const 1792) - ) - (call $prints - (i32.const 0) - ) - (call $prints - (i32.const 1808) - ) - (call $prints - (i32.const 0) - ) - ) - (func $_ZN10test_print11test_printiEv - (call $printi - (i64.const 0) - ) - (call $printi - (i64.const 556644) - ) - (call $printi - (i64.const -1) - ) - ) - (func $_ZN10test_print12test_printuiEv - (call $printui - (i64.const 0) - ) - (call $printui - (i64.const 556644) - ) - (call $printui - (i64.const -1) - ) - ) - (func $_ZN10test_print14test_printi128Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (i64.store offset=56 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=48 - (get_local $0) - (i64.const 1) - ) - (i64.store offset=40 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=32 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $0) - (i64.const -9223372036854775808) - ) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $0) - (i64.const -1) - ) - (i64.store - (get_local $0) - (i64.const -87654323456) - ) - (call $printi128 - (i32.add - (get_local $0) - (i32.const 48) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printi128 - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printi128 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printi128 - (get_local $0) - ) - (call $prints - (i32.const 1824) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - (func $_ZN10test_print15test_printui128Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i64.store offset=40 - (get_local $0) - (i64.const -1) - ) - (i64.store offset=32 - (get_local $0) - (i64.const -1) - ) - (i64.store offset=24 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 87654323456) - ) - (call $printui128 - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printui128 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printui128 - (get_local $0) - ) - (call $prints - (i32.const 1824) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 48) - ) - ) - ) - (func $_ZN10test_print11test_printnEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1840) - ) - (set_local $4 - (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 $3) - (i64.const 4) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $printn - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1856) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $3) - (i64.const 4) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $printn - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1872) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (block $label$16 - (block $label$17 - (br_if $label$17 - (i64.gt_u - (get_local $3) - (i64.const 7) - ) - ) - (br_if $label$16 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$15) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$14 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$13) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$12 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $printn - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (call $printn - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1888) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$18 - (block $label$19 - (block $label$20 - (block $label$21 - (block $label$22 - (block $label$23 - (br_if $label$23 - (i64.gt_u - (get_local $3) - (i64.const 5) - ) - ) - (br_if $label$22 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$21) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$20 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$19) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$18 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $printn - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1904) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$24 - (block $label$25 - (block $label$26 - (block $label$27 - (block $label$28 - (block $label$29 - (br_if $label$29 - (i64.gt_u - (get_local $3) - (i64.const 10) - ) - ) - (br_if $label$28 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$27) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$26 - (i64.eq - (get_local $3) - (i64.const 11) - ) - ) - (br $label$25) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$24 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (i64.const 13) - ) - ) - ) - (call $printn - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $1 - (i32.const 1920) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$30 - (set_local $2 - (i64.const 0) - ) - (block $label$31 - (br_if $label$31 - (i64.gt_u - (get_local $3) - (i64.const 11) - ) - ) - (block $label$32 - (block $label$33 - (br_if $label$33 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$32) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $2 - (i64.shl - (i64.extend_u/i32 - (i32.and - (get_local $0) - (i32.const 31) - ) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $2) - (get_local $4) - ) - ) - (br_if $label$30 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $printn - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1936) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$34 - (set_local $5 - (i64.const 0) - ) - (block $label$35 - (block $label$36 - (br_if $label$36 - (i64.gt_u - (get_local $3) - (i64.const 12) - ) - ) - (block $label$37 - (block $label$38 - (br_if $label$38 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$37) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$36 - (i64.gt_u - (get_local $3) - (i64.const 11) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - (br $label$35) - ) - (set_local $5 - (i64.and - (get_local $5) - (i64.const 15) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$34 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $printn - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1952) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$39 - (set_local $5 - (i64.const 0) - ) - (block $label$40 - (block $label$41 - (br_if $label$41 - (i64.gt_u - (get_local $3) - (i64.const 13) - ) - ) - (block $label$42 - (block $label$43 - (br_if $label$43 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$42) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$41 - (i64.gt_u - (get_local $3) - (i64.const 11) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - (br $label$40) - ) - (set_local $5 - (i64.and - (get_local $5) - (i64.const 15) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$39 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $printn - (get_local $4) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 1968) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$44 - (set_local $5 - (i64.const 0) - ) - (block $label$45 - (block $label$46 - (br_if $label$46 - (i64.gt_u - (get_local $3) - (i64.const 14) - ) - ) - (block $label$47 - (block $label$48 - (br_if $label$48 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$47) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$46 - (i64.gt_u - (get_local $3) - (i64.const 11) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - (br $label$45) - ) - (set_local $5 - (i64.and - (get_local $5) - (i64.const 15) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$44 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $printn - (get_local $4) - ) - ) - (func $_ZN10test_print12test_printsfEv - (call $printsf - (f32.const 0.5) - ) - (call $prints - (i32.const 1824) - ) - (call $printsf - (f32.const -3.75) - ) - (call $prints - (i32.const 1824) - ) - (call $printsf - (f32.const 6.666666649834951e-07) - ) - (call $prints - (i32.const 1824) - ) - ) - (func $_ZN10test_print12test_printdfEv - (call $printdf - (f64.const 0.5) - ) - (call $prints - (i32.const 1824) - ) - (call $printdf - (f64.const -3.75) - ) - (call $prints - (i32.const 1824) - ) - (call $printdf - (f64.const 6.666666666666666e-07) - ) - (call $prints - (i32.const 1824) - ) - ) - (func $_ZN10test_print12test_printqfEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 48) - ) - ) - ) - (i64.store offset=40 - (get_local $0) - (i64.const 4611123068473966592) - ) - (i64.store offset=32 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $0) - (i64.const -4611439727822766080) - ) - (i64.store offset=16 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 4605605624503281953) - ) - (i64.store - (get_local $0) - (i64.const 1865728291273748996) - ) - (call $printqf - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printqf - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printqf - (get_local $0) - ) - (call $prints - (i32.const 1824) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 48) - ) - ) - ) - (func $_ZN10test_print17test_print_simpleEv - (local $0 i32) - (local $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 32) - ) - ) - ) - (i32.store - (i32.add - (get_local $3) - (i32.const 24) - ) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $3) - (i64.const 0) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $0 - (call $strlen - (i32.const 1984) - ) - ) - (i32.const -16) - ) - ) - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.ge_u - (get_local $0) - (i32.const 11) - ) - ) - (i32.store8 offset=16 - (get_local $3) - (i32.shl - (get_local $0) - (i32.const 1) - ) - ) - (set_local $2 - (tee_local $1 - (i32.or - (i32.add - (get_local $3) - (i32.const 16) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$3 - (get_local $0) - ) - (br $label$2) - ) - (set_local $2 - (call $_Znwj - (tee_local $1 - (i32.and - (i32.add - (get_local $0) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=16 - (get_local $3) - (i32.or - (get_local $1) - (i32.const 1) - ) - ) - (i32.store offset=24 - (get_local $3) - (get_local $2) - ) - (i32.store offset=20 - (get_local $3) - (get_local $0) - ) - (set_local $1 - (i32.or - (i32.add - (get_local $3) - (i32.const 16) - ) - (i32.const 1) - ) - ) - ) - (drop - (call $memcpy - (get_local $2) - (i32.const 1984) - (get_local $0) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $2) - (get_local $0) - ) - (i32.const 0) - ) - (call $prints_l - (select - (i32.load offset=24 - (get_local $3) - ) - (get_local $1) - (tee_local $2 - (i32.and - (tee_local $0 - (i32.load8_u offset=16 - (get_local $3) - ) - ) - (i32.const 1) - ) - ) - ) - (select - (i32.load offset=20 - (get_local $3) - ) - (i32.shr_u - (get_local $0) - (i32.const 1) - ) - (get_local $2) - ) - ) - (i32.store - (i32.add - (get_local $3) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store - (get_local $3) - (i64.const 0) - ) - (br_if $label$0 - (i32.ge_u - (tee_local $0 - (call $strlen - (i32.const 2000) - ) - ) - (i32.const -16) - ) - ) - (block $label$5 - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.ge_u - (get_local $0) - (i32.const 11) - ) - ) - (i32.store8 - (get_local $3) - (i32.shl - (get_local $0) - (i32.const 1) - ) - ) - (set_local $2 - (tee_local $1 - (i32.or - (get_local $3) - (i32.const 1) - ) - ) - ) - (br_if $label$6 - (get_local $0) - ) - (br $label$5) - ) - (set_local $2 - (call $_Znwj - (tee_local $1 - (i32.and - (i32.add - (get_local $0) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store - (get_local $3) - (i32.or - (get_local $1) - (i32.const 1) - ) - ) - (i32.store offset=8 - (get_local $3) - (get_local $2) - ) - (i32.store offset=4 - (get_local $3) - (get_local $0) - ) - (set_local $1 - (i32.or - (get_local $3) - (i32.const 1) - ) - ) - ) - (drop - (call $memcpy - (get_local $2) - (i32.const 2000) - (get_local $0) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $2) - (get_local $0) - ) - (i32.const 0) - ) - (call $prints_l - (select - (i32.load offset=8 - (get_local $3) - ) - (get_local $1) - (tee_local $2 - (i32.and - (tee_local $0 - (i32.load8_u - (get_local $3) - ) - ) - (i32.const 1) - ) - ) - ) - (select - (i32.load offset=4 - (get_local $3) - ) - (i32.shr_u - (get_local $0) - (i32.const 1) - ) - (get_local $2) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.eqz - (i32.and - (i32.load8_u - (get_local $3) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (i32.and - (i32.load8_u offset=16 - (get_local $3) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $3) - (i32.const 24) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 32) - ) - ) - (return) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (get_local $3) - ) - (unreachable) - ) - (func $_ZN10test_types10types_sizeEv - (call $eosio_assert - (i32.const 1) - (i32.const 2016) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2048) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2080) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2112) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2144) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2176) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2208) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2240) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2272) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2304) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2320) - ) - ) - (func $_ZN10test_types14char_to_symbolEv - (call $eosio_assert - (i32.const 1) - (i32.const 2352) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2400) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2448) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2496) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2544) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2592) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2640) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2688) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2736) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2784) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2832) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2880) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2928) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 2976) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3024) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3072) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3120) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3168) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3216) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3264) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3312) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3360) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3408) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3456) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3504) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3552) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3600) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3648) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3696) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3744) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 3792) - ) - ) - (func $_ZN10test_types14string_to_nameEv - (local $0 i32) - (local $1 i64) - (local $2 i64) - (local $3 i64) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 3840) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i64.eq - (get_local $1) - (i64.const 0) - ) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$1) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$4) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 3840) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i64.eq - (get_local $1) - (i64.const 0) - ) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$7) - ) - (block $label$10 - (block $label$11 - (br_if $label$11 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$10) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 3856) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 3888) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (block $label$16 - (block $label$17 - (br_if $label$17 - (i64.gt_u - (get_local $1) - (i64.const 1) - ) - ) - (br_if $label$16 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$15) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$14 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$13) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$12 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 3888) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$18 - (block $label$19 - (block $label$20 - (block $label$21 - (block $label$22 - (block $label$23 - (br_if $label$23 - (i64.gt_u - (get_local $1) - (i64.const 1) - ) - ) - (br_if $label$22 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$21) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$20 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$19) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$18 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 3904) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 3936) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$24 - (block $label$25 - (block $label$26 - (block $label$27 - (block $label$28 - (block $label$29 - (br_if $label$29 - (i64.gt_u - (get_local $1) - (i64.const 2) - ) - ) - (br_if $label$28 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$27) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$26 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$25) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$24 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 3936) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$30 - (block $label$31 - (block $label$32 - (block $label$33 - (block $label$34 - (block $label$35 - (br_if $label$35 - (i64.gt_u - (get_local $1) - (i64.const 2) - ) - ) - (br_if $label$34 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$33) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$32 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$31) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$30 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 3952) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 3984) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$36 - (block $label$37 - (block $label$38 - (block $label$39 - (block $label$40 - (block $label$41 - (br_if $label$41 - (i64.gt_u - (get_local $1) - (i64.const 3) - ) - ) - (br_if $label$40 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$39) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$38 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$37) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$36 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 3984) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$42 - (block $label$43 - (block $label$44 - (block $label$45 - (block $label$46 - (block $label$47 - (br_if $label$47 - (i64.gt_u - (get_local $1) - (i64.const 3) - ) - ) - (br_if $label$46 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$45) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$44 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$43) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$42 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4000) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4032) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$48 - (block $label$49 - (block $label$50 - (block $label$51 - (block $label$52 - (block $label$53 - (br_if $label$53 - (i64.gt_u - (get_local $1) - (i64.const 4) - ) - ) - (br_if $label$52 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$51) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$50 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$49) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$48 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4032) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$54 - (block $label$55 - (block $label$56 - (block $label$57 - (block $label$58 - (block $label$59 - (br_if $label$59 - (i64.gt_u - (get_local $1) - (i64.const 4) - ) - ) - (br_if $label$58 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$57) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$56 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$55) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$54 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4048) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4080) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$60 - (block $label$61 - (block $label$62 - (block $label$63 - (block $label$64 - (block $label$65 - (br_if $label$65 - (i64.gt_u - (get_local $1) - (i64.const 5) - ) - ) - (br_if $label$64 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$63) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$62 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$61) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$60 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4080) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$66 - (block $label$67 - (block $label$68 - (block $label$69 - (block $label$70 - (block $label$71 - (br_if $label$71 - (i64.gt_u - (get_local $1) - (i64.const 5) - ) - ) - (br_if $label$70 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$69) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$68 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$67) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$66 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4096) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4128) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$72 - (block $label$73 - (block $label$74 - (block $label$75 - (block $label$76 - (block $label$77 - (br_if $label$77 - (i64.gt_u - (get_local $1) - (i64.const 6) - ) - ) - (br_if $label$76 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$75) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$74 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$73) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$72 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4128) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$78 - (block $label$79 - (block $label$80 - (block $label$81 - (block $label$82 - (block $label$83 - (br_if $label$83 - (i64.gt_u - (get_local $1) - (i64.const 6) - ) - ) - (br_if $label$82 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$81) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$80 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$79) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$78 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4144) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4176) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$84 - (block $label$85 - (block $label$86 - (block $label$87 - (block $label$88 - (block $label$89 - (br_if $label$89 - (i64.gt_u - (get_local $1) - (i64.const 7) - ) - ) - (br_if $label$88 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$87) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$86 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$85) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$84 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4176) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$90 - (block $label$91 - (block $label$92 - (block $label$93 - (block $label$94 - (block $label$95 - (br_if $label$95 - (i64.gt_u - (get_local $1) - (i64.const 7) - ) - ) - (br_if $label$94 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$93) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$92 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$91) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$90 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4192) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4224) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$96 - (block $label$97 - (block $label$98 - (block $label$99 - (block $label$100 - (block $label$101 - (br_if $label$101 - (i64.gt_u - (get_local $1) - (i64.const 8) - ) - ) - (br_if $label$100 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$99) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$98 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$97) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$96 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4224) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$102 - (block $label$103 - (block $label$104 - (block $label$105 - (block $label$106 - (block $label$107 - (br_if $label$107 - (i64.gt_u - (get_local $1) - (i64.const 8) - ) - ) - (br_if $label$106 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$105) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$104 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$103) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$102 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4240) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4288) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$108 - (block $label$109 - (block $label$110 - (block $label$111 - (block $label$112 - (block $label$113 - (br_if $label$113 - (i64.gt_u - (get_local $1) - (i64.const 9) - ) - ) - (br_if $label$112 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$111) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$110 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$109) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$108 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4288) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$114 - (block $label$115 - (block $label$116 - (block $label$117 - (block $label$118 - (block $label$119 - (br_if $label$119 - (i64.gt_u - (get_local $1) - (i64.const 9) - ) - ) - (br_if $label$118 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$117) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$116 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$115) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$114 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4304) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4352) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$120 - (block $label$121 - (block $label$122 - (block $label$123 - (block $label$124 - (block $label$125 - (br_if $label$125 - (i64.gt_u - (get_local $1) - (i64.const 10) - ) - ) - (br_if $label$124 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$123) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$122 - (i64.eq - (get_local $1) - (i64.const 11) - ) - ) - (br $label$121) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$120 - (i64.ne - (tee_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (i64.const 13) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4352) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$126 - (block $label$127 - (block $label$128 - (block $label$129 - (block $label$130 - (block $label$131 - (br_if $label$131 - (i64.gt_u - (get_local $1) - (i64.const 10) - ) - ) - (br_if $label$130 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$129) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$128 - (i64.eq - (get_local $1) - (i64.const 11) - ) - ) - (br $label$127) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$126 - (i64.ne - (tee_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (i64.const 13) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4368) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $4 - (i32.const 4416) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$132 - (set_local $5 - (i64.const 0) - ) - (block $label$133 - (br_if $label$133 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (block $label$134 - (block $label$135 - (br_if $label$135 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$134) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.extend_u/i32 - (i32.and - (get_local $0) - (i32.const 31) - ) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $5) - (get_local $2) - ) - ) - (br_if $label$132 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $4 - (i32.const 4416) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$136 - (set_local $5 - (i64.const 0) - ) - (block $label$137 - (br_if $label$137 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (block $label$138 - (block $label$139 - (br_if $label$139 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$138) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.extend_u/i32 - (i32.and - (get_local $0) - (i32.const 31) - ) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $5) - (get_local $3) - ) - ) - (br_if $label$136 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4432) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4480) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$140 - (set_local $6 - (i64.const 0) - ) - (block $label$141 - (block $label$142 - (br_if $label$142 - (i64.gt_u - (get_local $1) - (i64.const 12) - ) - ) - (block $label$143 - (block $label$144 - (br_if $label$144 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$143) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$142 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - (br $label$141) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$140 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4480) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$145 - (set_local $6 - (i64.const 0) - ) - (block $label$146 - (block $label$147 - (br_if $label$147 - (i64.gt_u - (get_local $1) - (i64.const 12) - ) - ) - (block $label$148 - (block $label$149 - (br_if $label$149 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$148) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$147 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - (br $label$146) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$145 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4496) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4544) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$150 - (set_local $6 - (i64.const 0) - ) - (block $label$151 - (block $label$152 - (br_if $label$152 - (i64.gt_u - (get_local $1) - (i64.const 13) - ) - ) - (block $label$153 - (block $label$154 - (br_if $label$154 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$153) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$152 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - (br $label$151) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$150 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4560) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$155 - (set_local $6 - (i64.const 0) - ) - (block $label$156 - (block $label$157 - (br_if $label$157 - (i64.gt_u - (get_local $1) - (i64.const 13) - ) - ) - (block $label$158 - (block $label$159 - (br_if $label$159 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$158) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$157 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - (br $label$156) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$155 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4576) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4624) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$160 - (set_local $6 - (i64.const 0) - ) - (block $label$161 - (block $label$162 - (br_if $label$162 - (i64.gt_u - (get_local $1) - (i64.const 14) - ) - ) - (block $label$163 - (block $label$164 - (br_if $label$164 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$163) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$162 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - (br $label$161) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$160 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4640) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$165 - (set_local $6 - (i64.const 0) - ) - (block $label$166 - (block $label$167 - (br_if $label$167 - (i64.gt_u - (get_local $1) - (i64.const 14) - ) - ) - (block $label$168 - (block $label$169 - (br_if $label$169 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$168) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$167 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - (br $label$166) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$165 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4656) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4704) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$170 - (block $label$171 - (block $label$172 - (block $label$173 - (block $label$174 - (block $label$175 - (br_if $label$175 - (i64.gt_u - (get_local $1) - (i64.const 5) - ) - ) - (br_if $label$174 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$173) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$172 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$171) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$170 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4720) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$176 - (block $label$177 - (block $label$178 - (block $label$179 - (block $label$180 - (block $label$181 - (br_if $label$181 - (i64.gt_u - (get_local $1) - (i64.const 5) - ) - ) - (br_if $label$180 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$179) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$178 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$177) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$176 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4736) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4768) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$182 - (block $label$183 - (block $label$184 - (block $label$185 - (block $label$186 - (block $label$187 - (br_if $label$187 - (i64.gt_u - (get_local $1) - (i64.const 9) - ) - ) - (br_if $label$186 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$185) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$184 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$183) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$182 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4768) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$188 - (block $label$189 - (block $label$190 - (block $label$191 - (block $label$192 - (block $label$193 - (br_if $label$193 - (i64.gt_u - (get_local $1) - (i64.const 9) - ) - ) - (br_if $label$192 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$191) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$190 - (i64.le_u - (get_local $1) - (i64.const 11) - ) - ) - (br $label$189) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$188 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4784) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4832) - ) - (set_local $2 - (i64.const 0) - ) - (loop $label$194 - (set_local $6 - (i64.const 0) - ) - (block $label$195 - (block $label$196 - (br_if $label$196 - (i64.gt_u - (get_local $1) - (i64.const 14) - ) - ) - (block $label$197 - (block $label$198 - (br_if $label$198 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$197) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$196 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - (br $label$195) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $2 - (i64.or - (get_local $6) - (get_local $2) - ) - ) - (br_if $label$194 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $1 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 4848) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$199 - (set_local $6 - (i64.const 0) - ) - (block $label$200 - (block $label$201 - (br_if $label$201 - (i64.gt_u - (get_local $1) - (i64.const 22) - ) - ) - (block $label$202 - (block $label$203 - (br_if $label$203 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $4) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$202) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$201 - (i64.gt_u - (get_local $1) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $5) - (i64.const 4294967295) - ) - ) - ) - (br $label$200) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $1 - (i64.add - (get_local $1) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$199 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $2) - (get_local $3) - ) - (i32.const 4880) - ) - ) - (func $_ZN10test_types10name_classEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 4704) - ) - (set_local $4 - (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 $3) - (i64.const 5) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $4) - (i64.const 4017212585601400832) - ) - (i32.const 4928) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 4960) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 4992) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $3) - (i64.const 3) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $4) - (i64.const 580542139465728) - ) - (i32.const 5008) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 5040) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (block $label$16 - (block $label$17 - (br_if $label$17 - (i64.gt_u - (get_local $3) - (i64.const 1) - ) - ) - (br_if $label$16 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$15) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$14 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$13) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$12 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $4) - (i64.const 594475150812905472) - ) - (i32.const 5056) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 5088) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$18 - (block $label$19 - (block $label$20 - (block $label$21 - (block $label$22 - (block $label$23 - (br_if $label$23 - (i64.gt_u - (get_local $3) - (i64.const 1) - ) - ) - (br_if $label$22 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$21) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$20 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$19) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$18 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $4) - (i64.const 1188950301625810944) - ) - (i32.const 5104) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 5136) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$24 - (block $label$25 - (block $label$26 - (block $label$27 - (block $label$28 - (block $label$29 - (br_if $label$29 - (i64.gt_u - (get_local $3) - (i64.const 9) - ) - ) - (br_if $label$28 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$27) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$26 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$25) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$24 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 5136) - ) - (set_local $6 - (i64.const 0) - ) - (loop $label$30 - (block $label$31 - (block $label$32 - (block $label$33 - (block $label$34 - (block $label$35 - (br_if $label$35 - (i64.gt_u - (get_local $3) - (i64.const 9) - ) - ) - (br_if $label$34 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$33) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$32 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$31) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $5) - (get_local $6) - ) - ) - (br_if $label$30 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $4) - (get_local $6) - ) - (i32.const 5152) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 5184) - ) - (set_local $4 - (i64.const 0) - ) - (loop $label$36 - (block $label$37 - (block $label$38 - (block $label$39 - (block $label$40 - (block $label$41 - (br_if $label$41 - (i64.gt_u - (get_local $3) - (i64.const 8) - ) - ) - (br_if $label$40 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$39) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$38 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$37) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$36 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 5184) - ) - (set_local $6 - (i64.const 0) - ) - (loop $label$42 - (block $label$43 - (block $label$44 - (block $label$45 - (block $label$46 - (block $label$47 - (br_if $label$47 - (i64.gt_u - (get_local $3) - (i64.const 8) - ) - ) - (br_if $label$46 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$45) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$44 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$43) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $5) - (get_local $6) - ) - ) - (br_if $label$42 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $6) - (get_local $4) - ) - (i32.const 5200) - ) - ) - (func $_ZN15test_fixedpoint16create_instancesEv - (call $eosio_assert - (i32.const 1) - (i32.const 5232) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5312) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5376) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5440) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5504) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5568) - ) - ) - (func $_ZN15test_fixedpoint13test_additionEv - (call $eosio_assert - (i32.const 1) - (i32.const 5632) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5696) - ) - ) - (func $_ZN15test_fixedpoint16test_subtractionEv - (call $eosio_assert - (i32.const 1) - (i32.const 5760) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5760) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5824) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5824) - ) - ) - (func $_ZN15test_fixedpoint19test_multiplicationEv - (call $eosio_assert - (i32.const 1) - (i32.const 5888) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5952) - ) - ) - (func $_ZN15test_fixedpoint13test_divisionEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 6016) - ) - (i64.store offset=24 - (get_local $0) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $0) - (i64.const 30030) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 128977867898880) - ) - (call $printui128 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (call $prints - (i32.const 6032) - ) - (call $printui128 - (get_local $0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 6048) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 6048) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN15test_fixedpoint18test_division_by_0Ev - (call $eosio_assert - (i32.const 0) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6160) - ) - ) - (func $_Zli5_ULLLPKc (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (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) - ) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $1 - (i32.load8_u - (tee_local $6 - (i32.add - (get_local $1) - (select - (select - (i32.const 2) - (i32.const 1) - (tee_local $2 - (i32.eq - (i32.load8_u - (get_local $1) - ) - (i32.const 45) - ) - ) - ) - (get_local $2) - (i32.eq - (i32.load8_u - (i32.add - (get_local $1) - (get_local $2) - ) - ) - (i32.const 43) - ) - ) - ) - ) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (set_local $5 - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$2 - (call $__multi3 - (get_local $8) - (get_local $7) - (get_local $3) - (i64.const 10) - (i64.const 0) - ) - (set_local $3 - (i64.add - (i64.add - (i64.shr_s - (tee_local $3 - (i64.extend_s/i32 - (i32.add - (i32.shr_s - (i32.shl - (get_local $1) - (i32.const 24) - ) - (i32.const 24) - ) - (i32.const -48) - ) - ) - ) - (i64.const 63) - ) - (i64.load - (get_local $5) - ) - ) - (select - (i64.const 1) - (i64.extend_u/i32 - (i64.lt_u - (tee_local $7 - (i64.add - (get_local $3) - (tee_local $4 - (i64.load - (get_local $8) - ) - ) - ) - ) - (get_local $3) - ) - ) - (i64.lt_u - (get_local $7) - (get_local $4) - ) - ) - ) - ) - (set_local $1 - (i32.load8_u - (get_local $6) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (get_local $1) - ) - (br $label$0) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $3 - (i64.const 0) - ) - ) - (i64.store - (get_local $0) - (select - (i64.sub - (i64.const 0) - (get_local $7) - ) - (get_local $7) - (get_local $2) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (select - (i64.sub - (i64.sub - (i64.const 0) - (get_local $3) - ) - (i64.extend_u/i32 - (i64.ne - (get_local $7) - (i64.const 0) - ) - ) - ) - (get_local $3) - (get_local $2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - (func $_Zli4_LLLPKc (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (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) - ) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $1 - (i32.load8_u - (tee_local $6 - (i32.add - (get_local $1) - (select - (select - (i32.const 2) - (i32.const 1) - (tee_local $2 - (i32.eq - (i32.load8_u - (get_local $1) - ) - (i32.const 45) - ) - ) - ) - (get_local $2) - (i32.eq - (i32.load8_u - (i32.add - (get_local $1) - (get_local $2) - ) - ) - (i32.const 43) - ) - ) - ) - ) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (set_local $5 - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$2 - (call $__multi3 - (get_local $8) - (get_local $7) - (get_local $3) - (i64.const 10) - (i64.const 0) - ) - (set_local $3 - (i64.add - (i64.add - (i64.shr_s - (tee_local $3 - (i64.extend_s/i32 - (i32.add - (i32.shr_s - (i32.shl - (get_local $1) - (i32.const 24) - ) - (i32.const 24) - ) - (i32.const -48) - ) - ) - ) - (i64.const 63) - ) - (i64.load - (get_local $5) - ) - ) - (select - (i64.const 1) - (i64.extend_u/i32 - (i64.lt_u - (tee_local $7 - (i64.add - (get_local $3) - (tee_local $4 - (i64.load - (get_local $8) - ) - ) - ) - ) - (get_local $3) - ) - ) - (i64.lt_u - (get_local $7) - (get_local $4) - ) - ) - ) - ) - (set_local $1 - (i32.load8_u - (get_local $6) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (get_local $1) - ) - (br $label$0) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $3 - (i64.const 0) - ) - ) - (i64.store - (get_local $0) - (select - (i64.sub - (i64.const 0) - (get_local $7) - ) - (get_local $7) - (get_local $2) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (select - (i64.sub - (i64.sub - (i64.const 0) - (get_local $3) - ) - (i64.extend_u/i32 - (i64.ne - (get_local $7) - (i64.const 0) - ) - ) - ) - (get_local $3) - (get_local $2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins11test_multi3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__multi3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -3000) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 6192) - ) - (call $__multi3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const -30) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -3000) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 6192) - ) - (call $__multi3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const -30) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 900) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6224) - ) - (call $__multi3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 10000) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6256) - ) - (call $__multi3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 100) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6288) - ) - (call $__multi3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i64.const -30) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -30) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 6320) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins11test_divti3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__divti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6352) - ) - (call $__divti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const -30) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -3) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 6384) - ) - (call $__divti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const -30) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 1) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6416) - ) - (call $__divti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 1) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6416) - ) - (call $__divti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 3333) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6352) - ) - (call $__divti3 - (get_local $0) - (i64.const 3333) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 33) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6448) - ) - (call $__divti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 1) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 100) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6480) - ) - (call $__divti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const 1) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -30) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 6512) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins16test_divti3_by_0Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__divti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6544) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins12test_udivti3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__udivti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 2951479051793528258) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const 184467440737095516) - ) - ) - ) - (i32.const 6576) - ) - (call $__udivti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const -30) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6576) - ) - (call $__udivti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const -30) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 1) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6608) - ) - (call $__udivti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 1) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6416) - ) - (call $__udivti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 3333) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6352) - ) - (call $__udivti3 - (get_local $0) - (i64.const 3333) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 33) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6448) - ) - (call $__udivti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 1) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 100) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6480) - ) - (call $__udivti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const 1) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -30) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 6512) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins17test_udivti3_by_0Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__udivti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6544) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins12test_lshlti3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__lshlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 1) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6640) - ) - (call $__lshlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 2) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6672) - ) - (call $__lshlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 31) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 2147483648) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6704) - ) - (call $__lshlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 63) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -9223372036854775808) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6736) - ) - (call $__lshlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 64) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const 1) - ) - ) - ) - (i32.const 6768) - ) - (call $__lshlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 127) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -9223372036854775808) - ) - ) - ) - (i32.const 6800) - ) - (call $__lshlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 128) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6848) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins12test_ashlti3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__ashlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 1) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6896) - ) - (call $__ashlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 2) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6928) - ) - (call $__ashlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 31) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 2147483648) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6960) - ) - (call $__ashlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 63) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -9223372036854775808) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 6992) - ) - (call $__ashlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 64) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const 1) - ) - ) - ) - (i32.const 7024) - ) - (call $__ashlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 127) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -9223372036854775808) - ) - ) - ) - (i32.const 7056) - ) - (call $__ashlti3 - (get_local $0) - (i64.const 1) - (i64.const 0) - (i32.const 128) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7104) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins12test_lshrti3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__lshrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -9223372036854775808) - ) - ) - ) - (i32.const 7152) - ) - (call $__lshrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const 4611686018427387904) - ) - ) - ) - (i32.const 7200) - ) - (call $__lshrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 63) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const 1) - ) - ) - ) - (i32.const 7248) - ) - (call $__lshrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 64) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -9223372036854775808) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7280) - ) - (call $__lshrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 96) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 2147483648) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7312) - ) - (call $__lshrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 127) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 1) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7344) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins12test_ashrti3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__ashrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -9223372036854775808) - ) - ) - ) - (i32.const 7376) - ) - (call $__ashrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -4611686018427387904) - ) - ) - ) - (i32.const 7424) - ) - (call $__ashrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 2) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -2305843009213693952) - ) - ) - ) - (i32.const 7472) - ) - (call $__ashrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 64) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -9223372036854775808) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 7520) - ) - (call $__ashrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 95) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -4294967296) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 7568) - ) - (call $__ashrti3 - (get_local $0) - (i64.const 0) - (i64.const -9223372036854775808) - (i32.const 127) - ) - (call $eosio_assert - (i64.eq - (i64.and - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - (i64.const -1) - ) - (i32.const 7616) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins11test_modti3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__modti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -30) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 7648) - ) - (call $__modti3 - (get_local $0) - (i64.const 30) - (i64.const 0) - (i64.const -100) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 30) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7680) - ) - (call $__modti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const -100) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -30) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 7648) - ) - (call $__modti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 30) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 10) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7712) - ) - (call $__modti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const -100) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7744) - ) - (call $__modti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7744) - ) - (call $__modti3 - (get_local $0) - (i64.const 0) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7744) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins16test_modti3_by_0Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__modti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 7776) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins12test_umodti3Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__umodti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -30) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 7648) - ) - (call $__umodti3 - (get_local $0) - (i64.const 30) - (i64.const 0) - (i64.const -100) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 30) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7680) - ) - (call $__umodti3 - (get_local $0) - (i64.const -30) - (i64.const -1) - (i64.const -100) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const -30) - ) - (i64.xor - (i64.load offset=8 - (get_local $0) - ) - (i64.const -1) - ) - ) - ) - (i32.const 7648) - ) - (call $__umodti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 30) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.xor - (i64.load - (get_local $0) - ) - (i64.const 10) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7712) - ) - (call $__umodti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const -100) - (i64.const -1) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7744) - ) - (call $__umodti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7744) - ) - (call $__umodti3 - (get_local $0) - (i64.const 0) - (i64.const 0) - (i64.const 100) - (i64.const 0) - ) - (call $eosio_assert - (i64.eqz - (i64.or - (i64.load - (get_local $0) - ) - (i64.load offset=8 - (get_local $0) - ) - ) - ) - (i32.const 7744) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN22test_compiler_builtins17test_umodti3_by_0Ev - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 0) - ) - (call $__umodti3 - (get_local $0) - (i64.const 100) - (i64.const 0) - (i64.const 0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 7776) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $my_strlen (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (set_local $3 - (i32.const -1) - ) - (loop $label$0 - (set_local $2 - (i32.add - (get_local $0) - (get_local $3) - ) - ) - (set_local $3 - (tee_local $1 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - ) - (br_if $label$0 - (i32.load8_u - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - ) - ) - (get_local $1) - ) - (func $my_memcmp (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (get_local $2) - ) - ) - (set_local $3 - (i32.const 0) - ) - (loop $label$2 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (get_local $3) - ) - ) - (i32.load8_u - (i32.add - (get_local $1) - (get_local $3) - ) - ) - ) - ) - (br_if $label$2 - (i32.lt_u - (tee_local $3 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (get_local $2) - ) - ) - ) - (return - (i32.const 1) - ) - ) - (return - (i32.const 1) - ) - ) - (i32.const 0) - ) - (func $_ZN11test_crypto28test_recover_key_assert_trueEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 144) - ) - ) - ) - (drop - (call $read_action_data - (get_local $0) - (i32.const 144) - ) - ) - (call $assert_recover_key - (get_local $0) - (i32.add - (get_local $0) - (i32.const 66) - ) - (i32.const 66) - (i32.add - (get_local $0) - (i32.const 32) - ) - (i32.const 34) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 144) - ) - ) - ) - (func $_ZN11test_crypto29test_recover_key_assert_falseEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 144) - ) - ) - ) - (drop - (call $read_action_data - (get_local $0) - (i32.const 144) - ) - ) - (call $assert_recover_key - (get_local $0) - (i32.add - (get_local $0) - (i32.const 66) - ) - (i32.const 66) - (i32.add - (get_local $0) - (i32.const 32) - ) - (i32.const 34) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 7776) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 144) - ) - ) - ) - (func $_ZN11test_crypto16test_recover_keyEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 192) - ) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $2) - (i32.const 48) - ) - (i32.const 144) - ) - ) - (drop - (call $recover_key - (i32.add - (get_local $2) - (i32.const 48) - ) - (i32.add - (i32.add - (get_local $2) - (i32.const 48) - ) - (i32.const 66) - ) - (i32.const 66) - (i32.add - (get_local $2) - (i32.const 8) - ) - (i32.const 34) - ) - ) - (set_local $0 - (i32.add - (get_local $2) - (i32.const 80) - ) - ) - (set_local $1 - (i32.const 0) - ) - (loop $label$0 - (block $label$1 - (br_if $label$1 - (i32.eq - (i32.load8_u - (i32.add - (i32.add - (get_local $2) - (i32.const 8) - ) - (get_local $1) - ) - ) - (i32.load8_u - (i32.add - (get_local $0) - (get_local $1) - ) - ) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 7808) - ) - ) - (br_if $label$0 - (i32.ne - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 34) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 192) - ) - ) - ) - (func $_ZN11test_crypto9test_sha1Ev - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha1 - (i32.const 7840) - (i32.const 3) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 7856) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$1 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 7888) - ) - (call $sha1 - (i32.const 7904) - (i32.const 56) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$2 - (loop $label$3 - (br_if $label$2 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 7968) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$3 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8000) - ) - (call $sha1 - (i32.const 8016) - (i32.const 112) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$4 - (loop $label$5 - (br_if $label$4 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8144) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$5 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8176) - ) - (call $sha1 - (i32.const 8192) - (i32.const 14) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8208) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$7 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8240) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto11test_sha256Ev - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha256 - (i32.const 7840) - (i32.const 3) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8256) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$1 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8288) - ) - (call $sha256 - (i32.const 7904) - (i32.const 56) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$2 - (loop $label$3 - (br_if $label$2 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8304) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$3 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8336) - ) - (call $sha256 - (i32.const 8016) - (i32.const 112) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$4 - (loop $label$5 - (br_if $label$4 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8352) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$5 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8384) - ) - (call $sha256 - (i32.const 8192) - (i32.const 14) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8400) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$7 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8432) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto11test_sha512Ev - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (call $sha512 - (i32.const 7840) - (i32.const 3) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8448) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$1 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 63) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8512) - ) - (call $sha512 - (i32.const 7904) - (i32.const 56) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$2 - (loop $label$3 - (br_if $label$2 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8528) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$3 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 63) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8592) - ) - (call $sha512 - (i32.const 8016) - (i32.const 112) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$4 - (loop $label$5 - (br_if $label$4 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8608) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$5 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 63) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8672) - ) - (call $sha512 - (i32.const 8192) - (i32.const 14) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8688) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$7 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 63) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8752) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 64) - ) - ) - ) - (func $_ZN11test_crypto14test_ripemd160Ev - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $ripemd160 - (i32.const 7840) - (i32.const 3) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8768) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$1 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8800) - ) - (call $ripemd160 - (i32.const 7904) - (i32.const 56) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$2 - (loop $label$3 - (br_if $label$2 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8816) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$3 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8848) - ) - (call $ripemd160 - (i32.const 8016) - (i32.const 112) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$4 - (loop $label$5 - (br_if $label$4 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8864) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$5 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8896) - ) - (call $ripemd160 - (i32.const 8192) - (i32.const 14) - (get_local $2) - ) - (set_local $1 - (i32.const 0) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$6 - (loop $label$7 - (br_if $label$6 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8912) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$7 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 8944) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto11sha256_nullEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha256 - (i32.const 0) - (i32.const 100) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto12sha1_no_dataEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (set_local $1 - (i32.const 0) - ) - (call $sha1 - (i32.const 8960) - (i32.const 0) - (get_local $2) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 8976) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$1 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 9008) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto14sha256_no_dataEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (set_local $1 - (i32.const 0) - ) - (call $sha256 - (i32.const 8960) - (i32.const 0) - (get_local $2) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 9024) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$1 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 9056) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto14sha512_no_dataEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (set_local $1 - (i32.const 0) - ) - (call $sha512 - (i32.const 8960) - (i32.const 0) - (get_local $2) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 9072) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$1 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 63) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 9136) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 64) - ) - ) - ) - (func $_ZN11test_crypto17ripemd160_no_dataEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (set_local $1 - (i32.const 0) - ) - (call $ripemd160 - (i32.const 8960) - (i32.const 0) - (get_local $2) - ) - (set_local $0 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (br_if $label$0 - (i32.ne - (i32.load8_u - (i32.add - (get_local $0) - (i32.const 9152) - ) - ) - (i32.load8_u - (i32.add - (get_local $2) - (get_local $0) - ) - ) - ) - ) - (br_if $label$1 - (i32.le_u - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $1 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $1) - (i32.const 9184) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $2) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto19assert_sha256_falseEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha256 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (i32.store8 - (get_local $0) - (i32.xor - (i32.load8_u - (get_local $0) - ) - (i32.const -1) - ) - ) - (call $assert_sha256 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 9200) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto18assert_sha256_trueEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha256 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $assert_sha256 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $sha256 - (i32.const 7904) - (i32.const 56) - (get_local $0) - ) - (call $assert_sha256 - (i32.const 7904) - (i32.const 56) - (get_local $0) - ) - (call $sha256 - (i32.const 8016) - (i32.const 112) - (get_local $0) - ) - (call $assert_sha256 - (i32.const 8016) - (i32.const 112) - (get_local $0) - ) - (call $sha256 - (i32.const 8192) - (i32.const 14) - (get_local $0) - ) - (call $assert_sha256 - (i32.const 8192) - (i32.const 14) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto17assert_sha1_falseEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha1 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (i32.store8 - (get_local $0) - (i32.xor - (i32.load8_u - (get_local $0) - ) - (i32.const -1) - ) - ) - (call $assert_sha1 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 9200) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto16assert_sha1_trueEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha1 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $assert_sha1 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $sha1 - (i32.const 7904) - (i32.const 56) - (get_local $0) - ) - (call $assert_sha1 - (i32.const 7904) - (i32.const 56) - (get_local $0) - ) - (call $sha1 - (i32.const 8016) - (i32.const 112) - (get_local $0) - ) - (call $assert_sha1 - (i32.const 8016) - (i32.const 112) - (get_local $0) - ) - (call $sha1 - (i32.const 8192) - (i32.const 14) - (get_local $0) - ) - (call $assert_sha1 - (i32.const 8192) - (i32.const 14) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto19assert_sha512_falseEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (call $sha512 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (i32.store8 - (get_local $0) - (i32.xor - (i32.load8_u - (get_local $0) - ) - (i32.const -1) - ) - ) - (call $assert_sha512 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 9200) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - (func $_ZN11test_crypto18assert_sha512_trueEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (call $sha512 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $assert_sha512 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $sha512 - (i32.const 7904) - (i32.const 56) - (get_local $0) - ) - (call $assert_sha512 - (i32.const 7904) - (i32.const 56) - (get_local $0) - ) - (call $sha512 - (i32.const 8016) - (i32.const 112) - (get_local $0) - ) - (call $assert_sha512 - (i32.const 8016) - (i32.const 112) - (get_local $0) - ) - (call $sha512 - (i32.const 8192) - (i32.const 14) - (get_local $0) - ) - (call $assert_sha512 - (i32.const 8192) - (i32.const 14) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - (func $_ZN11test_crypto22assert_ripemd160_falseEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $ripemd160 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (i32.store8 - (get_local $0) - (i32.xor - (i32.load8_u - (get_local $0) - ) - (i32.const -1) - ) - ) - (call $assert_ripemd160 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 9200) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN11test_crypto21assert_ripemd160_trueEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $ripemd160 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $assert_ripemd160 - (i32.const 7840) - (i32.const 3) - (get_local $0) - ) - (call $ripemd160 - (i32.const 7904) - (i32.const 56) - (get_local $0) - ) - (call $assert_ripemd160 - (i32.const 7904) - (i32.const 56) - (get_local $0) - ) - (call $ripemd160 - (i32.const 8016) - (i32.const 112) - (get_local $0) - ) - (call $assert_ripemd160 - (i32.const 8016) - (i32.const 112) - (get_local $0) - ) - (call $ripemd160 - (i32.const 8192) - (i32.const 14) - (get_local $0) - ) - (call $assert_ripemd160 - (i32.const 8192) - (i32.const 14) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN10test_chain16test_activeprodsEv - (local $0 i32) - (local $1 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $1 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 352) - ) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $1) - (i32.const 176) - ) - (i32.const 169) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load8_u offset=176 - (get_local $1) - ) - (i32.const 21) - ) - (i32.const 9232) - ) - (set_local $0 - (i32.const 1) - ) - (drop - (call $get_active_producers - (i32.or - (get_local $1) - (i32.const 1) - ) - (i32.const 168) - ) - ) - (loop $label$0 - (call $eosio_assert - (i64.eq - (i64.load align=1 - (i32.add - (get_local $1) - (get_local $0) - ) - ) - (i64.load align=1 - (i32.add - (i32.add - (get_local $1) - (i32.const 176) - ) - (get_local $0) - ) - ) - ) - (i32.const 9264) - ) - (br_if $label$0 - (i32.ne - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (i32.const 169) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $1) - (i32.const 352) - ) - ) - ) - (func $_Z9copy_dataPcjRNSt3__16vectorIcNS0_9allocatorIcEEEE (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $1) - ) - ) - (set_local $4 - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - (set_local $5 - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - (loop $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (tee_local $3 - (i32.load - (get_local $5) - ) - ) - (i32.load - (get_local $4) - ) - ) - ) - (i32.store8 - (get_local $3) - (i32.load8_u - (get_local $0) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) - ) - (i32.const 1) - ) - ) - (br $label$2) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (get_local $2) - (get_local $0) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (br_if $label$1 - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -1) - ) - ) - ) - ) - ) - ) - (func $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ (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 - (block $label$1 - (br_if $label$1 - (i32.le_s - (tee_local $7 - (i32.add - (tee_local $3 - (i32.sub - (tee_local $5 - (i32.load offset=4 - (get_local $0) - ) - ) - (tee_local $4 - (i32.load - (get_local $0) - ) - ) - ) - ) - (i32.const 1) - ) - ) - (i32.const -1) - ) - ) - (set_local $6 - (i32.const 2147483647) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $2 - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $4) - ) - ) - (i32.const 1073741822) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $6 - (select - (get_local $7) - (tee_local $6 - (i32.shl - (get_local $2) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $6) - (get_local $7) - ) - ) - ) - ) - ) - ) - (set_local $7 - (call $_Znwj - (get_local $6) - ) - ) - (set_local $5 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $4 - (i32.load - (get_local $0) - ) - ) - (br $label$0) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $7 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (i32.store8 - (tee_local $3 - (i32.add - (get_local $7) - (get_local $3) - ) - ) - (i32.load8_u - (get_local $1) - ) - ) - (set_local $1 - (i32.sub - (get_local $3) - (tee_local $5 - (i32.sub - (get_local $5) - (get_local $4) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $7) - (get_local $6) - ) - ) - (set_local $7 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (block $label$4 - (br_if $label$4 - (i32.lt_s - (get_local $5) - (i32.const 1) - ) - ) - (drop - (call $memcpy - (get_local $1) - (get_local $4) - (get_local $5) - ) - ) - (set_local $4 - (i32.load - (get_local $0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $7) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $6) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (get_local $4) - ) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - ) - (func $_ZN16test_transaction11send_actionEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $7) - (i32.const 92) - ) - (i32.load8_u offset=9292 - (i32.const 0) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 88) - ) - (i32.load offset=9288 align=1 - (i32.const 0) - ) - ) - (i64.store offset=80 - (get_local $7) - (i64.load offset=9280 align=1 - (i32.const 0) - ) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 368) - ) - (set_local $4 - (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 $3) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 416) - ) - (set_local $6 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $3) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $5) - (get_local $6) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=16 - (get_local $7) - (get_local $6) - ) - (i64.store offset=8 - (get_local $7) - (get_local $4) - ) - (i32.store - (i32.add - (tee_local $1 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (i32.load offset=12 - (get_local $7) - ) - ) - (i32.store offset=24 - (get_local $7) - (get_local $1) - ) - (i32.store - (get_local $1) - (i32.load offset=8 - (get_local $7) - ) - ) - (i32.store offset=32 - (get_local $7) - (tee_local $0 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=16 - (get_local $7) - ) - ) - (i32.store offset=28 - (get_local $7) - (get_local $0) - ) - (set_local $1 - (call $_ZN5eosio6actionC2I17test_dummy_actionILy14605617063041957888ELy9781311595436863162EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (i32.add - (get_local $7) - (i32.const 40) - ) - (i32.add - (get_local $7) - (i32.const 24) - ) - (i32.add - (get_local $7) - (i32.const 80) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $0 - (i32.load offset=24 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=28 - (get_local $7) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $7) - (i32.const 8) - ) - (get_local $1) - ) - (call $send_inline - (tee_local $0 - (i32.load offset=8 - (get_local $7) - ) - ) - (i32.sub - (i32.load offset=12 - (get_local $7) - ) - (get_local $0) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $0 - (i32.load offset=8 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $7) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $0 - (i32.load offset=28 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 32) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (tee_local $0 - (i32.load offset=16 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 20) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 96) - ) - ) - ) - (func $_ZN5eosio6actionC2I17test_dummy_actionILy14605617063041957888ELy9781311595436863162EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (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 16) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -3841127010667593728) - ) - (i64.store offset=8 - (get_local $0) - (i64.const -8665432478272688454) - ) - (i32.store offset=16 - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 20) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $4) - (i32.load offset=8 - (get_local $1) - ) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $5) - (i32.const 0) - ) - (i64.store - (get_local $5) - (i64.const 0) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $5) - (i32.const 13) - ) - (call $eosio_assert - (i32.gt_s - (tee_local $4 - (i32.sub - (i32.load offset=4 - (get_local $5) - ) - (tee_local $1 - (i32.load - (get_local $5) - ) - ) - ) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $1) - (get_local $2) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.add - (get_local $4) - (i32.const -1) - ) - (i32.const 7) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 1) - ) - (i32.add - (get_local $2) - (i32.const 1) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.add - (get_local $4) - (i32.const -9) - ) - (i32.const 3) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 9) - ) - (i32.add - (get_local $2) - (i32.const 9) - ) - (i32.const 4) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $1 - (i32.load offset=28 - (get_local $0) - ) - ) - ) - ) - (i32.store - (get_local $3) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 28) - ) - (i64.const 0) - ) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 28) - ) - (i64.load - (get_local $5) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.load - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction17send_action_emptyEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store offset=88 - (get_local $7) - (i32.const 0) - ) - (set_local $3 - (i64.const 0) - ) - (i64.store offset=80 - (get_local $7) - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 368) - ) - (set_local $4 - (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 $3) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 416) - ) - (set_local $6 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $3) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $5) - (get_local $6) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=16 - (get_local $7) - (get_local $6) - ) - (i64.store offset=8 - (get_local $7) - (get_local $4) - ) - (i32.store - (i32.add - (tee_local $1 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (i32.load offset=12 - (get_local $7) - ) - ) - (i32.store offset=24 - (get_local $7) - (get_local $1) - ) - (i32.store - (get_local $1) - (i32.load offset=8 - (get_local $7) - ) - ) - (i32.store offset=32 - (get_local $7) - (tee_local $0 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=16 - (get_local $7) - ) - ) - (i32.store offset=28 - (get_local $7) - (get_local $0) - ) - (set_local $1 - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311596421349198EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (i32.add - (get_local $7) - (i32.const 40) - ) - (i32.add - (get_local $7) - (i32.const 24) - ) - (i32.add - (get_local $7) - (i32.const 80) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $0 - (i32.load offset=24 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=28 - (get_local $7) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $7) - (i32.const 8) - ) - (get_local $1) - ) - (call $send_inline - (tee_local $0 - (i32.load offset=8 - (get_local $7) - ) - ) - (i32.sub - (i32.load offset=12 - (get_local $7) - ) - (get_local $0) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $0 - (i32.load offset=8 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $7) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $0 - (i32.load offset=28 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 32) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (tee_local $0 - (i32.load offset=16 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 20) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (tee_local $1 - (i32.load offset=80 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $7) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 96) - ) - ) - ) - (func $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311596421349198EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ (param $0 i32) (param $1 i32) (param $2 i32) (result 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 16) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -3841127010667593728) - ) - (i64.store offset=8 - (get_local $0) - (i64.const -8665432477288202418) - ) - (i32.store offset=16 - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 20) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $6) - (i32.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $7) - (i32.const 0) - ) - (i64.store - (get_local $7) - (i64.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $1 - (i32.load - (get_local $2) - ) - ) - (tee_local $4 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.sub - (get_local $4) - (get_local $1) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $7) - (get_local $3) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $2) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $1) - (get_local $4) - ) - ) - (loop $label$2 - (i32.store8 offset=15 - (get_local $7) - (i32.load8_u - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $5) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $6) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 32) - ) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - ) - (i64.store align=4 - (get_local $6) - (i64.load - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction17send_action_largeEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (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 96) - ) - ) - ) - (set_local $2 - (i32.const 0) - ) - (i32.store offset=88 - (get_local $10) - (i32.const 0) - ) - (i64.store offset=80 - (get_local $10) - (i64.const 0) - ) - (set_local $1 - (i32.add - (get_local $10) - (i32.const 88) - ) - ) - (set_local $3 - (i32.const 0) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (set_local $0 - (i32.add - (get_local $4) - (i32.const 9296) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $3) - (get_local $2) - ) - ) - (i32.store8 - (get_local $3) - (i32.load8_u - (get_local $0) - ) - ) - (i32.store offset=84 - (get_local $10) - (i32.add - (i32.load offset=84 - (get_local $10) - ) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (i32.const 8191) - ) - ) - (br $label$0) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $10) - (i32.const 80) - ) - (get_local $0) - ) - (br_if $label$0 - (i32.eq - (get_local $4) - (i32.const 8191) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $2 - (i32.load - (get_local $1) - ) - ) - (set_local $3 - (i32.load offset=84 - (get_local $10) - ) - ) - (br $label$1) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 368) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i64.gt_u - (get_local $6) - (i64.const 6) - ) - ) - (br_if $label$8 - (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$7) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$6 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$5) - ) - (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$4 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 416) - ) - (set_local $9 - (i64.const 0) - ) - (loop $label$10 - (block $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (br_if $label$15 - (i64.gt_u - (get_local $6) - (i64.const 5) - ) - ) - (br_if $label$14 - (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$13) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$12 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$11) - ) - (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 $9 - (i64.or - (get_local $8) - (get_local $9) - ) - ) - (br_if $label$10 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=16 - (get_local $10) - (get_local $9) - ) - (i64.store offset=8 - (get_local $10) - (get_local $7) - ) - (i32.store - (i32.add - (tee_local $4 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $10) - (i32.const 8) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 4) - ) - (i32.load offset=12 - (get_local $10) - ) - ) - (i32.store offset=24 - (get_local $10) - (get_local $4) - ) - (i32.store - (get_local $4) - (i32.load offset=8 - (get_local $10) - ) - ) - (i32.store offset=32 - (get_local $10) - (tee_local $3 - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 8) - ) - (i32.load offset=16 - (get_local $10) - ) - ) - (i32.store offset=28 - (get_local $10) - (get_local $3) - ) - (set_local $4 - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311595436863162EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (i32.add - (get_local $10) - (i32.const 40) - ) - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.add - (get_local $10) - (i32.const 80) - ) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (tee_local $3 - (i32.load offset=24 - (get_local $10) - ) - ) - ) - ) - (i32.store offset=28 - (get_local $10) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $10) - (i32.const 8) - ) - (get_local $4) - ) - (call $send_inline - (tee_local $3 - (i32.load offset=8 - (get_local $10) - ) - ) - (i32.sub - (i32.load offset=12 - (get_local $10) - ) - (get_local $3) - ) - ) - (block $label$17 - (br_if $label$17 - (i32.eqz - (tee_local $3 - (i32.load offset=8 - (get_local $10) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $10) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 17488) - ) - (block $label$18 - (br_if $label$18 - (i32.eqz - (tee_local $3 - (i32.load offset=28 - (get_local $4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 32) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (block $label$19 - (br_if $label$19 - (i32.eqz - (tee_local $3 - (i32.load offset=16 - (get_local $4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 20) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (block $label$20 - (br_if $label$20 - (i32.eqz - (tee_local $4 - (i32.load offset=80 - (get_local $10) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $10) - (get_local $4) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 96) - ) - ) - ) - (func $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311595436863162EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ (param $0 i32) (param $1 i32) (param $2 i32) (result 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 16) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -3841127010667593728) - ) - (i64.store offset=8 - (get_local $0) - (i64.const -8665432478272688454) - ) - (i32.store offset=16 - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 20) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $6) - (i32.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $7) - (i32.const 0) - ) - (i64.store - (get_local $7) - (i64.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $1 - (i32.load - (get_local $2) - ) - ) - (tee_local $4 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.sub - (get_local $4) - (get_local $1) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $7) - (get_local $3) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $2) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $1) - (get_local $4) - ) - ) - (loop $label$2 - (i32.store8 offset=15 - (get_local $7) - (i32.load8_u - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $5) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $6) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 32) - ) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - ) - (i64.store align=4 - (get_local $6) - (i64.load - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction19send_action_recurseEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (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 1120) - ) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 96) - ) - (i32.const 1024) - ) - ) - (set_local $2 - (i32.const 0) - ) - (i32.store offset=88 - (get_local $10) - (i32.const 0) - ) - (i64.store offset=80 - (get_local $10) - (i64.const 0) - ) - (set_local $1 - (i32.add - (get_local $10) - (i32.const 88) - ) - ) - (set_local $3 - (i32.const 0) - ) - (set_local $4 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (set_local $0 - (i32.add - (i32.add - (get_local $10) - (i32.const 96) - ) - (get_local $4) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $3) - (get_local $2) - ) - ) - (i32.store8 - (get_local $3) - (i32.load8_u - (get_local $0) - ) - ) - (i32.store offset=84 - (get_local $10) - (i32.add - (i32.load offset=84 - (get_local $10) - ) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (i32.const 1023) - ) - ) - (br $label$0) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $10) - (i32.const 80) - ) - (get_local $0) - ) - (br_if $label$0 - (i32.eq - (get_local $4) - (i32.const 1023) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - (set_local $2 - (i32.load - (get_local $1) - ) - ) - (set_local $3 - (i32.load offset=84 - (get_local $10) - ) - ) - (br $label$1) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 368) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i64.gt_u - (get_local $6) - (i64.const 6) - ) - ) - (br_if $label$8 - (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$7) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$6 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$5) - ) - (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$4 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $5 - (i64.const 59) - ) - (set_local $4 - (i32.const 416) - ) - (set_local $9 - (i64.const 0) - ) - (loop $label$10 - (block $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (br_if $label$15 - (i64.gt_u - (get_local $6) - (i64.const 5) - ) - ) - (br_if $label$14 - (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$13) - ) - (set_local $8 - (i64.const 0) - ) - (br_if $label$12 - (i64.le_u - (get_local $6) - (i64.const 11) - ) - ) - (br $label$11) - ) - (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 $9 - (i64.or - (get_local $8) - (get_local $9) - ) - ) - (br_if $label$10 - (i64.ne - (tee_local $5 - (i64.add - (get_local $5) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=16 - (get_local $10) - (get_local $9) - ) - (i64.store offset=8 - (get_local $10) - (get_local $7) - ) - (i32.store - (i32.add - (tee_local $4 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $10) - (i32.const 8) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 4) - ) - (i32.load offset=12 - (get_local $10) - ) - ) - (i32.store offset=24 - (get_local $10) - (get_local $4) - ) - (i32.store - (get_local $4) - (i32.load offset=8 - (get_local $10) - ) - ) - (i32.store offset=32 - (get_local $10) - (tee_local $3 - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 8) - ) - (i32.load offset=16 - (get_local $10) - ) - ) - (i32.store offset=28 - (get_local $10) - (get_local $3) - ) - (set_local $4 - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy17750730571693710178EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (i32.add - (get_local $10) - (i32.const 40) - ) - (i32.add - (get_local $10) - (i32.const 24) - ) - (i32.add - (get_local $10) - (i32.const 80) - ) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (tee_local $3 - (i32.load offset=24 - (get_local $10) - ) - ) - ) - ) - (i32.store offset=28 - (get_local $10) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $10) - (i32.const 8) - ) - (get_local $4) - ) - (call $send_inline - (tee_local $3 - (i32.load offset=8 - (get_local $10) - ) - ) - (i32.sub - (i32.load offset=12 - (get_local $10) - ) - (get_local $3) - ) - ) - (block $label$17 - (br_if $label$17 - (i32.eqz - (tee_local $3 - (i32.load offset=8 - (get_local $10) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $10) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (block $label$18 - (br_if $label$18 - (i32.eqz - (tee_local $3 - (i32.load offset=28 - (get_local $4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 32) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (block $label$19 - (br_if $label$19 - (i32.eqz - (tee_local $3 - (i32.load offset=16 - (get_local $4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 20) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (block $label$20 - (br_if $label$20 - (i32.eqz - (tee_local $4 - (i32.load offset=80 - (get_local $10) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $10) - (get_local $4) - ) - (call $_ZdlPv - (get_local $4) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 1120) - ) - ) - ) - (func $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy17750730571693710178EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ (param $0 i32) (param $1 i32) (param $2 i32) (result 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 16) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -3841127010667593728) - ) - (i64.store offset=8 - (get_local $0) - (i64.const -696013502015841438) - ) - (i32.store offset=16 - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 20) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $6) - (i32.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $7) - (i32.const 0) - ) - (i64.store - (get_local $7) - (i64.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $1 - (i32.load - (get_local $2) - ) - ) - (tee_local $4 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.sub - (get_local $4) - (get_local $1) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $7) - (get_local $3) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $2) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $1) - (get_local $4) - ) - ) - (loop $label$2 - (i32.store8 offset=15 - (get_local $7) - (i32.load8_u - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $5) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $6) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 32) - ) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - ) - (i64.store align=4 - (get_local $6) - (i64.load - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction23send_action_inline_failEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store offset=88 - (get_local $7) - (i32.const 0) - ) - (set_local $3 - (i64.const 0) - ) - (i64.store offset=80 - (get_local $7) - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 368) - ) - (set_local $4 - (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 $3) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 416) - ) - (set_local $6 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $3) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $5) - (get_local $6) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=16 - (get_local $7) - (get_local $6) - ) - (i64.store offset=8 - (get_local $7) - (get_local $4) - ) - (i32.store - (i32.add - (tee_local $1 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (i32.load offset=12 - (get_local $7) - ) - ) - (i32.store offset=24 - (get_local $7) - (get_local $1) - ) - (i32.store - (get_local $1) - (i32.load offset=8 - (get_local $7) - ) - ) - (i32.store offset=32 - (get_local $7) - (tee_local $0 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=16 - (get_local $7) - ) - ) - (i32.store offset=28 - (get_local $7) - (get_local $0) - ) - (set_local $1 - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311595419386437EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (i32.add - (get_local $7) - (i32.const 40) - ) - (i32.add - (get_local $7) - (i32.const 24) - ) - (i32.add - (get_local $7) - (i32.const 80) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $0 - (i32.load offset=24 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=28 - (get_local $7) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $7) - (i32.const 8) - ) - (get_local $1) - ) - (call $send_inline - (tee_local $0 - (i32.load offset=8 - (get_local $7) - ) - ) - (i32.sub - (i32.load offset=12 - (get_local $7) - ) - (get_local $0) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $0 - (i32.load offset=8 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $7) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $0 - (i32.load offset=28 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 32) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (tee_local $0 - (i32.load offset=16 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 20) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (tee_local $1 - (i32.load offset=80 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $7) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 96) - ) - ) - ) - (func $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311595419386437EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ (param $0 i32) (param $1 i32) (param $2 i32) (result 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 16) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -3841127010667593728) - ) - (i64.store offset=8 - (get_local $0) - (i64.const -8665432478290165179) - ) - (i32.store offset=16 - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 20) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $6) - (i32.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $7) - (i32.const 0) - ) - (i64.store - (get_local $7) - (i64.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $1 - (i32.load - (get_local $2) - ) - ) - (tee_local $4 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.sub - (get_local $4) - (get_local $1) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $7) - (get_local $3) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $2) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $1) - (get_local $4) - ) - ) - (loop $label$2 - (i32.store8 offset=15 - (get_local $7) - (i32.load8_u - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $5) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $6) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 32) - ) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - ) - (i64.store align=4 - (get_local $6) - (i64.load - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction23test_tapos_block_prefixEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $0) - (i32.const 12) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=12 - (get_local $0) - ) - (call $tapos_block_prefix) - ) - (i32.const 17536) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN16test_transaction20test_tapos_block_numEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $0) - (i32.const 12) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=12 - (get_local $0) - ) - (call $tapos_block_num) - ) - (i32.const 17584) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN16test_transaction21test_read_transactionEv - (local $0 i32) - (local $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 32) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $1 - (i32.sub - (get_local $3) - (i32.and - (i32.add - (tee_local $0 - (call $transaction_size) - ) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - (call $eosio_assert - (i32.eq - (get_local $0) - (tee_local $2 - (call $read_transaction - (get_local $1) - (get_local $0) - ) - ) - ) - (i32.const 17616) - ) - (call $sha256 - (get_local $1) - (get_local $2) - (tee_local $0 - (get_local $3) - ) - ) - (call $printhex - (get_local $0) - (i32.const 32) - ) - (drop - (get_local $3) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN16test_transaction21test_transaction_sizeEv - (local $0 i32) - (local $1 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $1 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store offset=12 - (get_local $1) - (i32.const 0) - ) - (drop - (call $read_action_data - (i32.add - (get_local $1) - (i32.const 12) - ) - (i32.const 4) - ) - ) - (set_local $0 - (call $transaction_size) - ) - (call $prints - (i32.const 17648) - ) - (call $printui - (i64.extend_u/i32 - (get_local $0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=12 - (get_local $1) - ) - (call $transaction_size) - ) - (i32.const 17664) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (func $_ZN16test_transaction16send_transactionEyyy (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i64) - (local $12 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $12 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 128) - ) - ) - ) - (set_local $4 - (i32.const 0) - ) - (i32.store8 - (i32.add - (i32.add - (get_local $12) - (i32.const 96) - ) - (i32.const 12) - ) - (i32.load8_u offset=17708 - (i32.const 0) - ) - ) - (i32.store - (i32.add - (i32.add - (get_local $12) - (i32.const 96) - ) - (i32.const 8) - ) - (i32.load offset=17704 align=1 - (i32.const 0) - ) - ) - (i64.store offset=96 align=4 - (get_local $12) - (i64.load offset=17696 align=1 - (i32.const 0) - ) - ) - (i32.store offset=88 - (get_local $12) - (i32.const 0) - ) - (i64.store offset=80 - (get_local $12) - (i64.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (set_local $6 - (i32.const 0) - ) - (block $label$0 - (loop $label$1 - (set_local $3 - (i32.add - (i32.add - (get_local $12) - (i32.const 96) - ) - (get_local $6) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $5) - (get_local $4) - ) - ) - (i32.store8 - (get_local $5) - (i32.load8_u - (get_local $3) - ) - ) - (i32.store offset=84 - (get_local $12) - (i32.add - (i32.load offset=84 - (get_local $12) - ) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $6) - (i32.const 12) - ) - ) - (br $label$0) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $12) - (i32.const 80) - ) - (get_local $3) - ) - (br_if $label$0 - (i32.eq - (get_local $6) - (i32.const 12) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (set_local $4 - (i32.load - (i32.add - (i32.add - (get_local $12) - (i32.const 80) - ) - (i32.const 8) - ) - ) - ) - (set_local $5 - (i32.load offset=84 - (get_local $12) - ) - ) - (br $label$1) - ) - ) - (set_local $8 - (call $current_time) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 44) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 48) - ) - (i32.const 0) - ) - (i32.store offset=28 - (get_local $12) - (i32.const 0) - ) - (i32.store8 offset=32 - (get_local $12) - (i32.const 0) - ) - (i32.store offset=36 - (get_local $12) - (i32.const 0) - ) - (i32.store offset=40 - (get_local $12) - (i32.const 0) - ) - (i32.store offset=16 - (get_local $12) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $8) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=52 - (get_local $12) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 56) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 60) - ) - (i32.const 0) - ) - (i32.store offset=64 - (get_local $12) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 68) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 72) - ) - (i32.const 0) - ) - (set_local $4 - (i32.add - (get_local $12) - (i32.const 52) - ) - ) - (set_local $8 - (i64.const 0) - ) - (set_local $7 - (i64.const 59) - ) - (set_local $6 - (i32.const 368) - ) - (set_local $9 - (i64.const 0) - ) - (loop $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i64.gt_u - (get_local $8) - (i64.const 6) - ) - ) - (br_if $label$8 - (i32.gt_u - (i32.and - (i32.add - (tee_local $5 - (i32.load8_s - (get_local $6) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 165) - ) - ) - (br $label$7) - ) - (set_local $10 - (i64.const 0) - ) - (br_if $label$6 - (i64.le_u - (get_local $8) - (i64.const 11) - ) - ) - (br $label$5) - ) - (set_local $5 - (select - (i32.add - (get_local $5) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $5) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $10 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $5) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $10 - (i64.shl - (i64.and - (get_local $10) - (i64.const 31) - ) - (i64.and - (get_local $7) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (set_local $8 - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - (set_local $9 - (i64.or - (get_local $10) - (get_local $9) - ) - ) - (br_if $label$4 - (i64.ne - (tee_local $7 - (i64.add - (get_local $7) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $8 - (i64.const 0) - ) - (set_local $7 - (i64.const 59) - ) - (set_local $6 - (i32.const 416) - ) - (set_local $11 - (i64.const 0) - ) - (loop $label$10 - (block $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (br_if $label$15 - (i64.gt_u - (get_local $8) - (i64.const 5) - ) - ) - (br_if $label$14 - (i32.gt_u - (i32.and - (i32.add - (tee_local $5 - (i32.load8_s - (get_local $6) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 165) - ) - ) - (br $label$13) - ) - (set_local $10 - (i64.const 0) - ) - (br_if $label$12 - (i64.le_u - (get_local $8) - (i64.const 11) - ) - ) - (br $label$11) - ) - (set_local $5 - (select - (i32.add - (get_local $5) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $5) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $10 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $5) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $10 - (i64.shl - (i64.and - (get_local $10) - (i64.const 31) - ) - (i64.and - (get_local $7) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (set_local $8 - (i64.add - (get_local $8) - (i64.const 1) - ) - ) - (set_local $11 - (i64.or - (get_local $10) - (get_local $11) - ) - ) - (br_if $label$10 - (i64.ne - (tee_local $7 - (i64.add - (get_local $7) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=8 - (get_local $12) - (get_local $11) - ) - (i64.store - (get_local $12) - (get_local $9) - ) - (i32.store - (i32.add - (tee_local $6 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $12) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $6) - (i32.const 4) - ) - (i32.load offset=4 - (get_local $12) - ) - ) - (i32.store offset=112 - (get_local $12) - (get_local $6) - ) - (i32.store - (get_local $6) - (i32.load - (get_local $12) - ) - ) - (i32.store offset=120 - (get_local $12) - (tee_local $5 - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $6) - (i32.const 8) - ) - (i32.load offset=8 - (get_local $12) - ) - ) - (i32.store offset=116 - (get_local $12) - (get_local $5) - ) - (call $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy9781311595436863162EEEEEvDpOT_ - (get_local $4) - (i32.add - (get_local $12) - (i32.const 112) - ) - (i32.add - (get_local $12) - (i32.const 80) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (tee_local $6 - (i32.load offset=112 - (get_local $12) - ) - ) - ) - ) - (i32.store offset=116 - (get_local $12) - (get_local $6) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - (i64.store offset=8 - (get_local $12) - (i64.const 0) - ) - (i64.store - (get_local $12) - (i64.const 0) - ) - (call $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $12) - (i32.const 112) - ) - (i32.add - (get_local $12) - (i32.const 16) - ) - ) - (call $send_deferred - (get_local $12) - (get_local $0) - (tee_local $6 - (i32.load offset=112 - (get_local $12) - ) - ) - (i32.sub - (i32.load offset=116 - (get_local $12) - ) - (get_local $6) - ) - (i32.const 0) - ) - (block $label$17 - (br_if $label$17 - (i32.eqz - (tee_local $6 - (i32.load offset=112 - (get_local $12) - ) - ) - ) - ) - (i32.store offset=116 - (get_local $12) - (get_local $6) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $12) - (i32.const 16) - ) - ) - ) - (block $label$18 - (br_if $label$18 - (i32.eqz - (tee_local $6 - (i32.load offset=80 - (get_local $12) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $12) - (get_local $6) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $12) - (i32.const 128) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy9781311595436863162EEEEEvDpOT_ (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $6 - (i32.add - (tee_local $9 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $0) - ) - (tee_local $8 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 40) - ) - ) - (i32.const 1) - ) - ) - (i32.const 107374183) - ) - ) - (set_local $7 - (i32.const 107374182) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $8 - (i32.div_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $8) - ) - (i32.const 40) - ) - ) - (i32.const 53687090) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $7 - (select - (get_local $6) - (tee_local $7 - (i32.shl - (get_local $8) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $6) - ) - ) - ) - ) - ) - ) - (set_local $8 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $3 - (i32.add - (get_local $8) - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (set_local $4 - (i32.add - (tee_local $8 - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311595436863162EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (tee_local $9 - (i32.add - (get_local $8) - (i32.mul - (get_local $9) - (i32.const 40) - ) - ) - ) - (get_local $1) - (get_local $2) - ) - ) - (i32.const 40) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.load - (get_local $0) - ) - ) - ) - ) - (set_local $5 - (i32.sub - (i32.const 0) - (get_local $7) - ) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const -20) - ) - ) - (loop $label$6 - (i64.store - (i32.add - (get_local $8) - (i32.const -32) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -12) - ) - ) - ) - (i64.store - (i32.add - (get_local $8) - (i32.const -40) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -20) - ) - ) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - (i64.const 0) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $8) - (i32.const -16) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const -4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -20) - ) - (i32.load - (get_local $7) - ) - ) - (i32.store - (get_local $2) - (i32.load - (tee_local $1 - (i32.add - (get_local $7) - (i32.const 4) - ) - ) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -12) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $8) - (i32.const -4) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - (i32.store - (get_local $2) - (i32.load - (tee_local $8 - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (set_local $8 - (tee_local $9 - (i32.add - (get_local $9) - (i32.const -40) - ) - ) - ) - (br_if $label$6 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $5) - ) - (i32.const -20) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $0) - ) - ) - (br $label$4) - ) - (set_local $1 - (get_local $7) - ) - ) - (i32.store - (get_local $0) - (get_local $9) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $4) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $3) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $7) - (get_local $1) - ) - ) - (set_local $9 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (loop $label$8 - (block $label$9 - (br_if $label$9 - (i32.eqz - (tee_local $8 - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 16) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $8 - (i32.load - (get_local $7) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 4) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$8 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $9) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - ) - (func $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ (param $0 i32) (param $1 i32) - (local $2 i32) - (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 16) - ) - ) - ) - (set_local $3 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i64.store align=4 - (get_local $0) - (i64.const 0) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIjEEEERT_S4_RKNS_11transactionE - (get_local $4) - (get_local $1) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $2 - (i32.load - (get_local $4) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $0) - (get_local $2) - ) - (set_local $3 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $0 - (i32.load - (get_local $0) - ) - ) - (br $label$0) - ) - (set_local $0 - (i32.const 0) - ) - ) - (i32.store offset=4 - (get_local $4) - (get_local $0) - ) - (i32.store - (get_local $4) - (get_local $0) - ) - (i32.store offset=8 - (get_local $4) - (get_local $3) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_18transaction_headerE - (get_local $4) - (get_local $1) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEENSt3__15tupleIJtNS4_6vectorIcNS4_9allocatorIcEEEEEEEEERT_SC_RKNS6_IT0_NS7_ISD_EEEE - (call $_ZN5eosiolsINS_10datastreamIPcEENS_6actionEEERT_S6_RKNSt3__16vectorIT0_NS7_9allocatorIS9_EEEE - (call $_ZN5eosiolsINS_10datastreamIPcEENS_6actionEEERT_S6_RKNSt3__16vectorIT0_NS7_9allocatorIS9_EEEE - (get_local $4) - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - (i32.add - (get_local $1) - (i32.const 36) - ) - ) - (i32.add - (get_local $1) - (i32.const 48) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosio11transactionD2Ev (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $1 - (i32.load offset=48 - (get_local $0) - ) - ) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.eq - (tee_local $5 - (i32.load - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 52) - ) - ) - ) - ) - (get_local $1) - ) - ) - (set_local $2 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const -12) - ) - ) - (loop $label$3 - (block $label$4 - (br_if $label$4 - (i32.eqz - (tee_local $3 - (i32.load - (get_local $5) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 4) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (br_if $label$3 - (i32.ne - (i32.add - (tee_local $5 - (i32.add - (get_local $5) - (i32.const -16) - ) - ) - (get_local $2) - ) - (i32.const -12) - ) - ) - ) - (set_local $5 - (i32.load - (i32.add - (get_local $0) - (i32.const 48) - ) - ) - ) - (br $label$1) - ) - (set_local $5 - (get_local $1) - ) - ) - (i32.store - (get_local $4) - (get_local $1) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (tee_local $1 - (i32.load offset=36 - (get_local $0) - ) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.eq - (tee_local $5 - (i32.load - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 40) - ) - ) - ) - ) - (get_local $1) - ) - ) - (set_local $2 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const -24) - ) - ) - (loop $label$8 - (block $label$9 - (br_if $label$9 - (i32.eqz - (tee_local $3 - (i32.load - (i32.add - (get_local $5) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 16) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $3 - (i32.load - (get_local $5) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 4) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (br_if $label$8 - (i32.ne - (i32.add - (tee_local $5 - (i32.add - (get_local $5) - (i32.const -40) - ) - ) - (get_local $2) - ) - (i32.const -24) - ) - ) - ) - (set_local $5 - (i32.load - (i32.add - (get_local $0) - (i32.const 36) - ) - ) - ) - (br $label$6) - ) - (set_local $5 - (get_local $1) - ) - ) - (i32.store - (get_local $4) - (get_local $1) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (tee_local $1 - (i32.load offset=24 - (get_local $0) - ) - ) - ) - ) - (block $label$12 - (block $label$13 - (br_if $label$13 - (i32.eq - (tee_local $5 - (i32.load - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - (get_local $1) - ) - ) - (set_local $2 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const -24) - ) - ) - (loop $label$14 - (block $label$15 - (br_if $label$15 - (i32.eqz - (tee_local $3 - (i32.load - (i32.add - (get_local $5) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 16) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (tee_local $3 - (i32.load - (get_local $5) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 4) - ) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (br_if $label$14 - (i32.ne - (i32.add - (tee_local $5 - (i32.add - (get_local $5) - (i32.const -40) - ) - ) - (get_local $2) - ) - (i32.const -24) - ) - ) - ) - (set_local $5 - (i32.load - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - ) - (br $label$12) - ) - (set_local $5 - (get_local $1) - ) - ) - (i32.store - (get_local $4) - (get_local $1) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiolsINS_10datastreamIjEEEERT_S4_RKNS_11transactionE (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) - (i32.store - (get_local $0) - (i32.add - (tee_local $6 - (i32.load - (get_local $0) - ) - ) - (i32.const 10) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 11) - ) - ) - (set_local $8 - (i64.load32_u offset=12 - (get_local $1) - ) - ) - (loop $label$0 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - (set_local $8 - (i64.load32_u offset=20 - (get_local $1) - ) - ) - (loop $label$1 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$1 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.div_s - (i32.sub - (tee_local $2 - (i32.load - (i32.add - (get_local $1) - (i32.const 28) - ) - ) - ) - (tee_local $7 - (i32.load offset=24 - (get_local $1) - ) - ) - ) - (i32.const 40) - ) - ) - ) - (loop $label$2 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $7) - (get_local $2) - ) - ) - (loop $label$4 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.shr_s - (tee_local $5 - (i32.sub - (tee_local $3 - (i32.load - (i32.add - (get_local $7) - (i32.const 20) - ) - ) - ) - (tee_local $4 - (i32.load offset=16 - (get_local $7) - ) - ) - ) - ) - (i32.const 4) - ) - ) - ) - (loop $label$5 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$5 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.eq - (get_local $4) - (get_local $3) - ) - ) - (set_local $6 - (i32.add - (i32.and - (get_local $5) - (i32.const -16) - ) - (get_local $6) - ) - ) - ) - (set_local $6 - (i32.sub - (i32.add - (get_local $6) - (tee_local $3 - (i32.load - (i32.add - (get_local $7) - (i32.const 32) - ) - ) - ) - ) - (tee_local $4 - (i32.load offset=28 - (get_local $7) - ) - ) - ) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.sub - (get_local $3) - (get_local $4) - ) - ) - ) - (loop $label$7 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$7 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (br_if $label$4 - (i32.ne - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 40) - ) - ) - (get_local $2) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.div_s - (i32.sub - (tee_local $2 - (i32.load - (i32.add - (get_local $1) - (i32.const 40) - ) - ) - ) - (tee_local $7 - (i32.load offset=36 - (get_local $1) - ) - ) - ) - (i32.const 40) - ) - ) - ) - (loop $label$8 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$8 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - (block $label$9 - (br_if $label$9 - (i32.eq - (get_local $7) - (get_local $2) - ) - ) - (loop $label$10 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.shr_s - (tee_local $5 - (i32.sub - (tee_local $3 - (i32.load - (i32.add - (get_local $7) - (i32.const 20) - ) - ) - ) - (tee_local $4 - (i32.load offset=16 - (get_local $7) - ) - ) - ) - ) - (i32.const 4) - ) - ) - ) - (loop $label$11 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$11 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eq - (get_local $4) - (get_local $3) - ) - ) - (set_local $6 - (i32.add - (i32.and - (get_local $5) - (i32.const -16) - ) - (get_local $6) - ) - ) - ) - (set_local $6 - (i32.sub - (i32.add - (get_local $6) - (tee_local $3 - (i32.load - (i32.add - (get_local $7) - (i32.const 32) - ) - ) - ) - ) - (tee_local $4 - (i32.load offset=28 - (get_local $7) - ) - ) - ) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.sub - (get_local $3) - (get_local $4) - ) - ) - ) - (loop $label$13 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$13 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (br_if $label$10 - (i32.ne - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 40) - ) - ) - (get_local $2) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.shr_s - (i32.sub - (tee_local $5 - (i32.load - (i32.add - (get_local $1) - (i32.const 52) - ) - ) - ) - (tee_local $7 - (i32.load offset=48 - (get_local $1) - ) - ) - ) - (i32.const 4) - ) - ) - ) - (loop $label$14 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$14 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - (block $label$15 - (br_if $label$15 - (i32.eq - (get_local $7) - (get_local $5) - ) - ) - (loop $label$16 - (set_local $6 - (i32.sub - (i32.add - (i32.add - (get_local $6) - (tee_local $3 - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - ) - (i32.const 2) - ) - (tee_local $4 - (i32.load offset=4 - (get_local $7) - ) - ) - ) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.sub - (get_local $3) - (get_local $4) - ) - ) - ) - (loop $label$17 - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$17 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (br_if $label$16 - (i32.ne - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $5) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $6) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNS_18transaction_headerE (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) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 3) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (get_local $1) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $4 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $4) - ) - (i32.const 1) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 4) - ) - (i32.const 2) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $4 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 2) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $4) - ) - (i32.const 3) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load offset=4 - (get_local $0) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $5 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - ) - (set_local $6 - (i64.load32_u offset=12 - (get_local $1) - ) - ) - (loop $label$0 - (set_local $4 - (i32.wrap/i64 - (get_local $6) - ) - ) - (i32.store8 offset=14 - (get_local $7) - (i32.or - (i32.shl - (tee_local $2 - (i64.ne - (tee_local $6 - (i64.shr_u - (get_local $6) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - (i32.const 7) - ) - (i32.and - (get_local $4) - (i32.const 127) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (get_local $5) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (i32.add - (get_local $7) - (i32.const 14) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $4) - (tee_local $5 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$0 - (get_local $2) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (get_local $5) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $4) - (tee_local $5 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (set_local $6 - (i64.load32_u offset=20 - (get_local $1) - ) - ) - (loop $label$1 - (set_local $2 - (i32.wrap/i64 - (get_local $6) - ) - ) - (i32.store8 offset=15 - (get_local $7) - (i32.or - (i32.shl - (tee_local $1 - (i64.ne - (tee_local $6 - (i64.shr_u - (get_local $6) - (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 $3) - ) - (get_local $5) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (get_local $4) - ) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $4) - (tee_local $5 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$1 - (get_local $1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEENS_6actionEEERT_S6_RKNSt3__16vectorIT0_NS7_9allocatorIS9_EEEE (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) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (set_local $5 - (i64.extend_u/i32 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $1) - ) - (i32.load - (get_local $1) - ) - ) - (i32.const 40) - ) - ) - ) - (set_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $4 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$0 - (set_local $7 - (i32.wrap/i64 - (get_local $5) - ) - ) - (i32.store8 offset=15 - (get_local $8) - (i32.or - (i32.shl - (tee_local $2 - (i64.ne - (tee_local $5 - (i64.shr_u - (get_local $5) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - (i32.const 7) - ) - (i32.and - (get_local $7) - (i32.const 127) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $3) - ) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (get_local $4) - ) - (i32.add - (get_local $8) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$0 - (get_local $2) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (tee_local $7 - (i32.load - (get_local $1) - ) - ) - (tee_local $3 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (set_local $4 - (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 $6) - ) - (i32.const 7) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (get_local $4) - ) - (get_local $7) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $6) - ) - (i32.const 7) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (get_local $4) - ) - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__16vectorIcNS6_9allocatorIcEEEE - (call $_ZN5eosiolsINS_10datastreamIPcEENS_16permission_levelEEERT_S6_RKNSt3__16vectorIT0_NS7_9allocatorIS9_EEEE - (get_local $0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (i32.add - (get_local $7) - (i32.const 28) - ) - ) - ) - (br_if $label$1 - (i32.eq - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 40) - ) - ) - (get_local $3) - ) - ) - (set_local $6 - (i32.load - (get_local $4) - ) - ) - (br $label$2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEENSt3__15tupleIJtNS4_6vectorIcNS4_9allocatorIcEEEEEEEEERT_SC_RKNS6_IT0_NS7_ISD_EEEE (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) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (set_local $5 - (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 $6 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$0 - (set_local $4 - (i32.wrap/i64 - (get_local $5) - ) - ) - (i32.store8 offset=15 - (get_local $7) - (i32.or - (i32.shl - (tee_local $2 - (i64.ne - (tee_local $5 - (i64.shr_u - (get_local $5) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - (i32.const 7) - ) - (i32.and - (get_local $4) - (i32.const 127) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $3) - ) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (br_if $label$0 - (get_local $2) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - (tee_local $2 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$2 - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $3) - ) - (get_local $6) - ) - (i32.const 1) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (get_local $4) - (i32.const 2) - ) - ) - (i32.store - (get_local $6) - (i32.add - (i32.load - (get_local $6) - ) - (i32.const 2) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__16vectorIcNS6_9allocatorIcEEEE - (get_local $0) - (i32.add - (get_local $4) - (i32.const 4) - ) - ) - ) - (br_if $label$1 - (i32.eq - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - (get_local $2) - ) - ) - (set_local $6 - (i32.load - (get_local $6) - ) - ) - (br $label$2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction18send_action_senderEyyy (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $11 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 128) - ) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 8) - ) - ) - (i32.store offset=96 - (get_local $11) - (i32.const 0) - ) - (i64.store offset=88 - (get_local $11) - (i64.const 0) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.add - (get_local $11) - (i32.const 104) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eq - (tee_local $5 - (i32.load offset=92 - (get_local $11) - ) - ) - (i32.load offset=96 - (get_local $11) - ) - ) - ) - (i32.store8 - (get_local $5) - (i32.load8_u offset=105 - (get_local $11) - ) - ) - (i32.store offset=92 - (get_local $11) - (tee_local $5 - (i32.add - (i32.load offset=92 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (br $label$0) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.or - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 1) - ) - ) - (set_local $5 - (i32.load offset=92 - (get_local $11) - ) - ) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $5) - (i32.load - (i32.add - (get_local $11) - (i32.const 96) - ) - ) - ) - ) - (i32.store8 - (get_local $5) - (i32.load8_u offset=106 - (get_local $11) - ) - ) - (i32.store offset=92 - (get_local $11) - (tee_local $5 - (i32.add - (i32.load offset=92 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (br $label$2) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.or - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 2) - ) - ) - (set_local $5 - (i32.load offset=92 - (get_local $11) - ) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (get_local $5) - (i32.load - (i32.add - (get_local $11) - (i32.const 96) - ) - ) - ) - ) - (i32.store8 - (get_local $5) - (i32.load8_u offset=107 - (get_local $11) - ) - ) - (i32.store offset=92 - (get_local $11) - (tee_local $5 - (i32.add - (i32.load offset=92 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (br $label$4) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.or - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 3) - ) - ) - (set_local $5 - (i32.load offset=92 - (get_local $11) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $5) - (i32.load - (i32.add - (get_local $11) - (i32.const 96) - ) - ) - ) - ) - (i32.store8 - (get_local $5) - (i32.load8_u offset=108 - (get_local $11) - ) - ) - (i32.store offset=92 - (get_local $11) - (tee_local $5 - (i32.add - (i32.load offset=92 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (br $label$6) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.or - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 4) - ) - ) - (set_local $5 - (i32.load offset=92 - (get_local $11) - ) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eq - (get_local $5) - (i32.load - (i32.add - (get_local $11) - (i32.const 96) - ) - ) - ) - ) - (i32.store8 - (get_local $5) - (i32.load8_u offset=109 - (get_local $11) - ) - ) - (i32.store offset=92 - (get_local $11) - (tee_local $5 - (i32.add - (i32.load offset=92 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (br $label$8) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.or - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 5) - ) - ) - (set_local $5 - (i32.load offset=92 - (get_local $11) - ) - ) - ) - (block $label$10 - (block $label$11 - (br_if $label$11 - (i32.eq - (get_local $5) - (i32.load - (i32.add - (get_local $11) - (i32.const 96) - ) - ) - ) - ) - (i32.store8 - (get_local $5) - (i32.load8_u offset=110 - (get_local $11) - ) - ) - (i32.store offset=92 - (get_local $11) - (tee_local $5 - (i32.add - (i32.load offset=92 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (br $label$10) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.or - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 6) - ) - ) - (set_local $5 - (i32.load offset=92 - (get_local $11) - ) - ) - ) - (block $label$12 - (block $label$13 - (br_if $label$13 - (i32.eq - (get_local $5) - (i32.load - (i32.add - (get_local $11) - (i32.const 96) - ) - ) - ) - ) - (i32.store8 - (get_local $5) - (i32.load8_u offset=111 - (get_local $11) - ) - ) - (i32.store offset=92 - (get_local $11) - (i32.add - (i32.load offset=92 - (get_local $11) - ) - (i32.const 1) - ) - ) - (br $label$12) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.or - (i32.add - (get_local $11) - (i32.const 104) - ) - (i32.const 7) - ) - ) - ) - (set_local $7 - (call $current_time) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 52) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 56) - ) - (i32.const 0) - ) - (i32.store offset=36 - (get_local $11) - (i32.const 0) - ) - (i32.store8 offset=40 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=44 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=48 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=24 - (get_local $11) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $7) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=60 - (get_local $11) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 64) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 68) - ) - (i32.const 0) - ) - (i32.store offset=72 - (get_local $11) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 76) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 80) - ) - (i32.const 0) - ) - (set_local $4 - (i32.add - (get_local $11) - (i32.const 60) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 368) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$14 - (block $label$15 - (block $label$16 - (block $label$17 - (block $label$18 - (block $label$19 - (br_if $label$19 - (i64.gt_u - (get_local $7) - (i64.const 6) - ) - ) - (br_if $label$18 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$17) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$16 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$15) - ) - (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 $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$14 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 416) - ) - (set_local $10 - (i64.const 0) - ) - (loop $label$20 - (block $label$21 - (block $label$22 - (block $label$23 - (block $label$24 - (block $label$25 - (br_if $label$25 - (i64.gt_u - (get_local $7) - (i64.const 5) - ) - ) - (br_if $label$24 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$23) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$22 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$21) - ) - (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 $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $10 - (i64.or - (get_local $9) - (get_local $10) - ) - ) - (br_if $label$20 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=8 - (get_local $11) - (get_local $10) - ) - (i64.store - (get_local $11) - (get_local $8) - ) - (i32.store - (i32.add - (tee_local $5 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $11) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 4) - ) - (i32.load offset=4 - (get_local $11) - ) - ) - (i32.store offset=112 - (get_local $11) - (get_local $5) - ) - (i32.store - (get_local $5) - (i32.load - (get_local $11) - ) - ) - (i32.store offset=120 - (get_local $11) - (tee_local $3 - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 8) - ) - (i32.load offset=8 - (get_local $11) - ) - ) - (i32.store offset=116 - (get_local $11) - (get_local $3) - ) - (call $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy9781311597322538353EEEEEvDpOT_ - (get_local $4) - (i32.add - (get_local $11) - (i32.const 112) - ) - (i32.add - (get_local $11) - (i32.const 88) - ) - ) - (block $label$26 - (br_if $label$26 - (i32.eqz - (tee_local $5 - (i32.load offset=112 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=116 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (i64.store offset=8 - (get_local $11) - (i64.const 0) - ) - (i64.store - (get_local $11) - (i64.const 0) - ) - (call $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $11) - (i32.const 112) - ) - (i32.add - (get_local $11) - (i32.const 24) - ) - ) - (call $send_deferred - (get_local $11) - (get_local $0) - (tee_local $5 - (i32.load offset=112 - (get_local $11) - ) - ) - (i32.sub - (i32.load offset=116 - (get_local $11) - ) - (get_local $5) - ) - (i32.const 0) - ) - (block $label$27 - (br_if $label$27 - (i32.eqz - (tee_local $5 - (i32.load offset=112 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=116 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $11) - (i32.const 24) - ) - ) - ) - (block $label$28 - (br_if $label$28 - (i32.eqz - (tee_local $5 - (i32.load offset=88 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=92 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 128) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy9781311597322538353EEEEEvDpOT_ (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $6 - (i32.add - (tee_local $9 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $0) - ) - (tee_local $8 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 40) - ) - ) - (i32.const 1) - ) - ) - (i32.const 107374183) - ) - ) - (set_local $7 - (i32.const 107374182) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $8 - (i32.div_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $8) - ) - (i32.const 40) - ) - ) - (i32.const 53687090) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $7 - (select - (get_local $6) - (tee_local $7 - (i32.shl - (get_local $8) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $6) - ) - ) - ) - ) - ) - ) - (set_local $8 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $3 - (i32.add - (get_local $8) - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (set_local $4 - (i32.add - (tee_local $8 - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311597322538353EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (tee_local $9 - (i32.add - (get_local $8) - (i32.mul - (get_local $9) - (i32.const 40) - ) - ) - ) - (get_local $1) - (get_local $2) - ) - ) - (i32.const 40) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.load - (get_local $0) - ) - ) - ) - ) - (set_local $5 - (i32.sub - (i32.const 0) - (get_local $7) - ) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const -20) - ) - ) - (loop $label$6 - (i64.store - (i32.add - (get_local $8) - (i32.const -32) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -12) - ) - ) - ) - (i64.store - (i32.add - (get_local $8) - (i32.const -40) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -20) - ) - ) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - (i64.const 0) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $8) - (i32.const -16) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const -4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -20) - ) - (i32.load - (get_local $7) - ) - ) - (i32.store - (get_local $2) - (i32.load - (tee_local $1 - (i32.add - (get_local $7) - (i32.const 4) - ) - ) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -12) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $8) - (i32.const -4) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - (i32.store - (get_local $2) - (i32.load - (tee_local $8 - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (set_local $8 - (tee_local $9 - (i32.add - (get_local $9) - (i32.const -40) - ) - ) - ) - (br_if $label$6 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $5) - ) - (i32.const -20) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $0) - ) - ) - (br $label$4) - ) - (set_local $1 - (get_local $7) - ) - ) - (i32.store - (get_local $0) - (get_local $9) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $4) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $3) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $7) - (get_local $1) - ) - ) - (set_local $9 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (loop $label$8 - (block $label$9 - (br_if $label$9 - (i32.eqz - (tee_local $8 - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 16) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $8 - (i32.load - (get_local $7) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 4) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$8 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $9) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - ) - (func $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311597322538353EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ (param $0 i32) (param $1 i32) (param $2 i32) (result 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 16) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -3841127010667593728) - ) - (i64.store offset=8 - (get_local $0) - (i64.const -8665432476387013263) - ) - (i32.store offset=16 - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 20) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $6) - (i32.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $7) - (i32.const 0) - ) - (i64.store - (get_local $7) - (i64.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $1 - (i32.load - (get_local $2) - ) - ) - (tee_local $4 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.sub - (get_local $4) - (get_local $1) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $7) - (get_local $3) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $2) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $1) - (get_local $4) - ) - ) - (loop $label$2 - (i32.store8 offset=15 - (get_local $7) - (i32.load8_u - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $5) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $6) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 32) - ) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - ) - (i64.store align=4 - (get_local $6) - (i64.load - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction22send_transaction_emptyEyyy (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i64) - (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) - ) - ) - ) - (set_local $4 - (call $current_time) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 44) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 48) - ) - (i32.const 0) - ) - (i32.store offset=28 - (get_local $5) - (i32.const 0) - ) - (i32.store8 offset=32 - (get_local $5) - (i32.const 0) - ) - (i32.store offset=36 - (get_local $5) - (i32.const 0) - ) - (i32.store offset=40 - (get_local $5) - (i32.const 0) - ) - (i32.store offset=16 - (get_local $5) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $4) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=52 - (get_local $5) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 56) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 60) - ) - (i32.const 0) - ) - (i32.store offset=64 - (get_local $5) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 68) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 72) - ) - (i32.const 0) - ) - (i64.store offset=8 - (get_local $5) - (i64.const 0) - ) - (i64.store - (get_local $5) - (i64.const 0) - ) - (call $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $5) - (i32.const 80) - ) - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - (call $send_deferred - (get_local $5) - (get_local $0) - (tee_local $3 - (i32.load offset=80 - (get_local $5) - ) - ) - (i32.sub - (i32.load offset=84 - (get_local $5) - ) - (get_local $3) - ) - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.load offset=80 - (get_local $5) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $5) - (get_local $3) - ) - (call $_ZdlPv - (get_local $3) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 17712) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 96) - ) - ) - ) - (func $_ZN16test_transaction38send_transaction_trigger_error_handlerEyyy (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (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) - ) - ) - ) - (set_local $7 - (call $current_time) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 60) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 64) - ) - (i32.const 0) - ) - (i32.store offset=44 - (get_local $11) - (i32.const 0) - ) - (i32.store8 offset=48 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=52 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=56 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=32 - (get_local $11) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $7) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=68 - (get_local $11) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 72) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 76) - ) - (i32.const 0) - ) - (i32.store offset=80 - (get_local $11) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 84) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.const 0) - ) - (i32.store offset=24 - (get_local $11) - (i32.const 0) - ) - (set_local $7 - (i64.const 0) - ) - (i64.store offset=16 - (get_local $11) - (i64.const 0) - ) - (set_local $3 - (i32.add - (get_local $11) - (i32.const 68) - ) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 368) - ) - (set_local $8 - (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 $7) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $4 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $4 - (select - (i32.add - (get_local $4) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $4) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $4) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 416) - ) - (set_local $10 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $7) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $4 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $4 - (select - (i32.add - (get_local $4) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $4) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $4) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $10 - (i64.or - (get_local $9) - (get_local $10) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=8 - (get_local $11) - (get_local $10) - ) - (i64.store - (get_local $11) - (get_local $8) - ) - (i32.store - (i32.add - (tee_local $5 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $11) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 4) - ) - (i32.load offset=4 - (get_local $11) - ) - ) - (i32.store offset=96 - (get_local $11) - (get_local $5) - ) - (i32.store - (get_local $5) - (i32.load - (get_local $11) - ) - ) - (i32.store offset=104 - (get_local $11) - (tee_local $4 - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 8) - ) - (i32.load offset=8 - (get_local $11) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $4) - ) - (call $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy9781311595419386437EEEEEvDpOT_ - (get_local $3) - (i32.add - (get_local $11) - (i32.const 96) - ) - (i32.add - (get_local $11) - (i32.const 16) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (i64.store offset=8 - (get_local $11) - (i64.const 0) - ) - (i64.store - (get_local $11) - (i64.const 0) - ) - (call $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $11) - (i32.const 96) - ) - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - (call $send_deferred - (get_local $11) - (get_local $0) - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - (i32.sub - (i32.load offset=100 - (get_local $11) - ) - (get_local $5) - ) - (i32.const 0) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $5 - (i32.load offset=16 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=20 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 112) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy9781311595419386437EEEEEvDpOT_ (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $6 - (i32.add - (tee_local $9 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $0) - ) - (tee_local $8 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 40) - ) - ) - (i32.const 1) - ) - ) - (i32.const 107374183) - ) - ) - (set_local $7 - (i32.const 107374182) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $8 - (i32.div_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $8) - ) - (i32.const 40) - ) - ) - (i32.const 53687090) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $7 - (select - (get_local $6) - (tee_local $7 - (i32.shl - (get_local $8) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $6) - ) - ) - ) - ) - ) - ) - (set_local $8 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $3 - (i32.add - (get_local $8) - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (set_local $4 - (i32.add - (tee_local $8 - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311595419386437EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (tee_local $9 - (i32.add - (get_local $8) - (i32.mul - (get_local $9) - (i32.const 40) - ) - ) - ) - (get_local $1) - (get_local $2) - ) - ) - (i32.const 40) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.load - (get_local $0) - ) - ) - ) - ) - (set_local $5 - (i32.sub - (i32.const 0) - (get_local $7) - ) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const -20) - ) - ) - (loop $label$6 - (i64.store - (i32.add - (get_local $8) - (i32.const -32) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -12) - ) - ) - ) - (i64.store - (i32.add - (get_local $8) - (i32.const -40) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -20) - ) - ) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - (i64.const 0) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $8) - (i32.const -16) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const -4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -20) - ) - (i32.load - (get_local $7) - ) - ) - (i32.store - (get_local $2) - (i32.load - (tee_local $1 - (i32.add - (get_local $7) - (i32.const 4) - ) - ) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -12) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $8) - (i32.const -4) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - (i32.store - (get_local $2) - (i32.load - (tee_local $8 - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (set_local $8 - (tee_local $9 - (i32.add - (get_local $9) - (i32.const -40) - ) - ) - ) - (br_if $label$6 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $5) - ) - (i32.const -20) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $0) - ) - ) - (br $label$4) - ) - (set_local $1 - (get_local $7) - ) - ) - (i32.store - (get_local $0) - (get_local $9) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $4) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $3) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $7) - (get_local $1) - ) - ) - (set_local $9 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (loop $label$8 - (block $label$9 - (br_if $label$9 - (i32.eqz - (tee_local $8 - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 16) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $8 - (i32.load - (get_local $7) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 4) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$8 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $9) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - ) - (func $_ZN16test_transaction26assert_false_error_handlerERKN5eosio11transactionE (param $0 i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (call $eosio_assert - (i32.eq - (i32.sub - (i32.load - (i32.add - (get_local $0) - (i32.const 40) - ) - ) - (i32.load offset=36 - (get_local $0) - ) - ) - (i32.const 40) - ) - (i32.const 17776) - ) - (set_local $1 - (i64.load - (i32.load offset=36 - (get_local $0) - ) - ) - ) - (set_local $5 - (i64.const 0) - ) - (set_local $4 - (i64.const 59) - ) - (set_local $3 - (i32.const 368) - ) - (set_local $6 - (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 $5) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $2 - (i32.load8_s - (get_local $3) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $7 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $5) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $2 - (select - (i32.add - (get_local $2) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $2) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $7 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $2) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $7 - (i64.shl - (i64.and - (get_local $7) - (i64.const 31) - ) - (i64.and - (get_local $4) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (set_local $5 - (i64.add - (get_local $5) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $7) - (get_local $6) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $4 - (i64.add - (get_local $4) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $1) - (get_local $6) - ) - (i32.const 17824) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 36) - ) - ) - ) - ) - (i64.const -8665432478290165179) - ) - (i32.const 17856) - ) - (call $eosio_assert - (i32.eq - (i32.sub - (i32.load - (i32.add - (tee_local $2 - (i32.load - (get_local $3) - ) - ) - (i32.const 20) - ) - ) - (i32.load offset=16 - (get_local $2) - ) - ) - (i32.const 16) - ) - (i32.const 17888) - ) - (set_local $1 - (i64.load - (i32.load offset=16 - (i32.load - (get_local $3) - ) - ) - ) - ) - (set_local $5 - (i64.const 0) - ) - (set_local $4 - (i64.const 59) - ) - (set_local $3 - (i32.const 368) - ) - (set_local $6 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $5) - (i64.const 6) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $2 - (i32.load8_s - (get_local $3) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $7 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $5) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $2 - (select - (i32.add - (get_local $2) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $2) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $7 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $2) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $7 - (i64.shl - (i64.and - (get_local $7) - (i64.const 31) - ) - (i64.and - (get_local $4) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (set_local $5 - (i64.add - (get_local $5) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $7) - (get_local $6) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $4 - (i64.add - (get_local $4) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $1) - (get_local $6) - ) - (i32.const 17936) - ) - (set_local $1 - (i64.load offset=8 - (i32.load offset=16 - (i32.load - (i32.add - (get_local $0) - (i32.const 36) - ) - ) - ) - ) - ) - (set_local $5 - (i64.const 0) - ) - (set_local $4 - (i64.const 59) - ) - (set_local $3 - (i32.const 416) - ) - (set_local $6 - (i64.const 0) - ) - (loop $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (block $label$16 - (block $label$17 - (br_if $label$17 - (i64.gt_u - (get_local $5) - (i64.const 5) - ) - ) - (br_if $label$16 - (i32.gt_u - (i32.and - (i32.add - (tee_local $2 - (i32.load8_s - (get_local $3) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 165) - ) - ) - (br $label$15) - ) - (set_local $7 - (i64.const 0) - ) - (br_if $label$14 - (i64.le_u - (get_local $5) - (i64.const 11) - ) - ) - (br $label$13) - ) - (set_local $2 - (select - (i32.add - (get_local $2) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $2) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $7 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $2) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $7 - (i64.shl - (i64.and - (get_local $7) - (i64.const 31) - ) - (i64.and - (get_local $4) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (set_local $5 - (i64.add - (get_local $5) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $7) - (get_local $6) - ) - ) - (br_if $label$12 - (i64.ne - (tee_local $4 - (i64.add - (get_local $4) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i64.eq - (get_local $1) - (get_local $6) - ) - (i32.const 17984) - ) - ) - (func $_ZN16test_transaction22send_transaction_largeEyyy (param $0 i64) (param $1 i64) (param $2 i64) - (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 i64) - (local $13 i64) - (local $14 i64) - (local $15 i64) - (local $16 i64) - (local $17 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $17 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 1136) - ) - ) - ) - (set_local $13 - (call $current_time) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 1100) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (i32.add - (get_local $17) - (i32.const 1072) - ) - (i32.const 32) - ) - (i32.const 0) - ) - (i32.store offset=1084 - (get_local $17) - (i32.const 0) - ) - (i32.store8 offset=1088 - (get_local $17) - (i32.const 0) - ) - (i32.store offset=1092 - (get_local $17) - (i32.const 0) - ) - (i32.store offset=1096 - (get_local $17) - (i32.const 0) - ) - (i32.store offset=1072 - (get_local $17) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $13) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=1108 - (get_local $17) - (i32.const 0) - ) - (i32.store - (tee_local $5 - (i32.add - (i32.add - (get_local $17) - (i32.const 1072) - ) - (i32.const 40) - ) - ) - (i32.const 0) - ) - (i32.store - (tee_local $6 - (i32.add - (get_local $17) - (i32.const 1116) - ) - ) - (i32.const 0) - ) - (i32.store offset=1120 - (get_local $17) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 1124) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $17) - (i32.const 1128) - ) - (i32.const 0) - ) - (set_local $3 - (i32.add - (get_local $17) - (i32.const 1108) - ) - ) - (set_local $7 - (i32.add - (i32.add - (get_local $17) - (i32.const 32) - ) - (i32.const 8) - ) - ) - (set_local $8 - (i32.const 0) - ) - (loop $label$0 - (i32.store - (get_local $7) - (i32.const 0) - ) - (i64.store offset=32 - (get_local $17) - (i64.const 0) - ) - (set_local $9 - (i32.const 0) - ) - (set_local $10 - (i32.const 0) - ) - (set_local $11 - (i32.const 0) - ) - (block $label$1 - (loop $label$2 - (set_local $4 - (i32.add - (i32.add - (get_local $17) - (i32.const 48) - ) - (get_local $11) - ) - ) - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.eq - (get_local $10) - (get_local $9) - ) - ) - (i32.store8 - (get_local $10) - (i32.load8_u - (get_local $4) - ) - ) - (i32.store offset=36 - (get_local $17) - (i32.add - (i32.load offset=36 - (get_local $17) - ) - (i32.const 1) - ) - ) - (br_if $label$3 - (i32.ne - (get_local $11) - (i32.const 1023) - ) - ) - (br $label$1) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ - (i32.add - (get_local $17) - (i32.const 32) - ) - (get_local $4) - ) - (br_if $label$1 - (i32.eq - (get_local $11) - (i32.const 1023) - ) - ) - ) - (set_local $11 - (i32.add - (get_local $11) - (i32.const 1) - ) - ) - (set_local $9 - (i32.load - (get_local $7) - ) - ) - (set_local $10 - (i32.load offset=36 - (get_local $17) - ) - ) - (br $label$2) - ) - ) - (set_local $13 - (i64.const 0) - ) - (set_local $12 - (i64.const 59) - ) - (set_local $11 - (i32.const 368) - ) - (set_local $14 - (i64.const 0) - ) - (loop $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (br_if $label$10 - (i64.gt_u - (get_local $13) - (i64.const 6) - ) - ) - (br_if $label$9 - (i32.gt_u - (i32.and - (i32.add - (tee_local $10 - (i32.load8_s - (get_local $11) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $10 - (i32.add - (get_local $10) - (i32.const 165) - ) - ) - (br $label$8) - ) - (set_local $15 - (i64.const 0) - ) - (br_if $label$7 - (i64.le_u - (get_local $13) - (i64.const 11) - ) - ) - (br $label$6) - ) - (set_local $10 - (select - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $10) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $15 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $10) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $15 - (i64.shl - (i64.and - (get_local $15) - (i64.const 31) - ) - (i64.and - (get_local $12) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $11 - (i32.add - (get_local $11) - (i32.const 1) - ) - ) - (set_local $13 - (i64.add - (get_local $13) - (i64.const 1) - ) - ) - (set_local $14 - (i64.or - (get_local $15) - (get_local $14) - ) - ) - (br_if $label$5 - (i64.ne - (tee_local $12 - (i64.add - (get_local $12) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $13 - (i64.const 0) - ) - (set_local $12 - (i64.const 59) - ) - (set_local $11 - (i32.const 416) - ) - (set_local $16 - (i64.const 0) - ) - (loop $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (block $label$16 - (br_if $label$16 - (i64.gt_u - (get_local $13) - (i64.const 5) - ) - ) - (br_if $label$15 - (i32.gt_u - (i32.and - (i32.add - (tee_local $10 - (i32.load8_s - (get_local $11) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $10 - (i32.add - (get_local $10) - (i32.const 165) - ) - ) - (br $label$14) - ) - (set_local $15 - (i64.const 0) - ) - (br_if $label$13 - (i64.le_u - (get_local $13) - (i64.const 11) - ) - ) - (br $label$12) - ) - (set_local $10 - (select - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $10) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $15 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $10) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $15 - (i64.shl - (i64.and - (get_local $15) - (i64.const 31) - ) - (i64.and - (get_local $12) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $11 - (i32.add - (get_local $11) - (i32.const 1) - ) - ) - (set_local $13 - (i64.add - (get_local $13) - (i64.const 1) - ) - ) - (set_local $16 - (i64.or - (get_local $15) - (get_local $16) - ) - ) - (br_if $label$11 - (i64.ne - (tee_local $12 - (i64.add - (get_local $12) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store - (tee_local $10 - (i32.add - (get_local $17) - (i32.const 8) - ) - ) - (get_local $16) - ) - (i32.store - (tee_local $9 - (i32.add - (i32.add - (get_local $17) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.const 0) - ) - (i64.store - (get_local $17) - (get_local $14) - ) - (i64.store offset=16 - (get_local $17) - (i64.const 0) - ) - (i32.store - (get_local $9) - (tee_local $4 - (i32.add - (tee_local $11 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $17) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 4) - ) - (i32.load offset=4 - (get_local $17) - ) - ) - (i32.store offset=16 - (get_local $17) - (get_local $11) - ) - (i32.store - (get_local $11) - (i32.load - (get_local $17) - ) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.load - (get_local $10) - ) - ) - (i32.store offset=20 - (get_local $17) - (get_local $4) - ) - (block $label$17 - (block $label$18 - (block $label$19 - (br_if $label$19 - (i32.ge_u - (tee_local $11 - (i32.load - (get_local $5) - ) - ) - (i32.load - (get_local $6) - ) - ) - ) - (drop - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy9781311595436863162EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (get_local $11) - (i32.add - (get_local $17) - (i32.const 16) - ) - (i32.add - (get_local $17) - (i32.const 32) - ) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) - ) - (i32.const 40) - ) - ) - (br_if $label$18 - (tee_local $11 - (i32.load offset=16 - (get_local $17) - ) - ) - ) - (br $label$17) - ) - (call $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy9781311595436863162EEEEEvDpOT_ - (get_local $3) - (i32.add - (get_local $17) - (i32.const 16) - ) - (i32.add - (get_local $17) - (i32.const 32) - ) - ) - (br_if $label$17 - (i32.eqz - (tee_local $11 - (i32.load offset=16 - (get_local $17) - ) - ) - ) - ) - ) - (i32.store offset=20 - (get_local $17) - (get_local $11) - ) - (call $_ZdlPv - (get_local $11) - ) - ) - (block $label$20 - (br_if $label$20 - (i32.eqz - (tee_local $11 - (i32.load offset=32 - (get_local $17) - ) - ) - ) - ) - (i32.store offset=36 - (get_local $17) - (get_local $11) - ) - (call $_ZdlPv - (get_local $11) - ) - ) - (br_if $label$0 - (i32.ne - (tee_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (i32.const 32) - ) - ) - ) - (i64.store offset=56 - (get_local $17) - (i64.const 0) - ) - (i64.store offset=48 - (get_local $17) - (i64.const 0) - ) - (call $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (get_local $17) - (i32.add - (get_local $17) - (i32.const 1072) - ) - ) - (call $send_deferred - (i32.add - (get_local $17) - (i32.const 48) - ) - (get_local $0) - (tee_local $11 - (i32.load - (get_local $17) - ) - ) - (i32.sub - (i32.load offset=4 - (get_local $17) - ) - (get_local $11) - ) - (i32.const 0) - ) - (block $label$21 - (br_if $label$21 - (i32.eqz - (tee_local $11 - (i32.load - (get_local $17) - ) - ) - ) - ) - (i32.store offset=4 - (get_local $17) - (get_local $11) - ) - (call $_ZdlPv - (get_local $11) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 18032) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $17) - (i32.const 1072) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $17) - (i32.const 1136) - ) - ) - ) - (func $_ZN16test_transaction14deferred_printEv - (call $prints - (i32.const 18096) - ) - ) - (func $_ZN16test_transaction25send_deferred_transactionEyyy (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (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) - ) - ) - ) - (set_local $7 - (call $current_time) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 60) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 64) - ) - (i32.const 0) - ) - (i32.store offset=44 - (get_local $11) - (i32.const 0) - ) - (i32.store8 offset=48 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=52 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=56 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=32 - (get_local $11) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $7) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=68 - (get_local $11) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 72) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 76) - ) - (i32.const 0) - ) - (i32.store offset=80 - (get_local $11) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 84) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.const 0) - ) - (i32.store offset=24 - (get_local $11) - (i32.const 0) - ) - (set_local $7 - (i64.const 0) - ) - (i64.store offset=16 - (get_local $11) - (i64.const 0) - ) - (set_local $3 - (i32.add - (get_local $11) - (i32.const 68) - ) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 368) - ) - (set_local $8 - (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 $7) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $4 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $4 - (select - (i32.add - (get_local $4) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $4) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $4) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 416) - ) - (set_local $10 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $7) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $4 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $4 - (select - (i32.add - (get_local $4) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $4) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $4) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $10 - (i64.or - (get_local $9) - (get_local $10) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=8 - (get_local $11) - (get_local $10) - ) - (i64.store - (get_local $11) - (get_local $8) - ) - (i32.store - (i32.add - (tee_local $5 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $11) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 4) - ) - (i32.load offset=4 - (get_local $11) - ) - ) - (i32.store offset=96 - (get_local $11) - (get_local $5) - ) - (i32.store - (get_local $5) - (i32.load - (get_local $11) - ) - ) - (i32.store offset=104 - (get_local $11) - (tee_local $4 - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 8) - ) - (i32.load offset=8 - (get_local $11) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $4) - ) - (call $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy17750730572681658536EEEEEvDpOT_ - (get_local $3) - (i32.add - (get_local $11) - (i32.const 96) - ) - (i32.add - (get_local $11) - (i32.const 16) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 52) - ) - (i32.const 2) - ) - (i64.store offset=8 - (get_local $11) - (i64.const 0) - ) - (i64.store - (get_local $11) - (i64.const -1) - ) - (call $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $11) - (i32.const 96) - ) - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - (call $send_deferred - (get_local $11) - (get_local $0) - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - (i32.sub - (i32.load offset=100 - (get_local $11) - ) - (get_local $5) - ) - (i32.const 0) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $5 - (i32.load offset=16 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=20 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 112) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy17750730572681658536EEEEEvDpOT_ (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $6 - (i32.add - (tee_local $9 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $0) - ) - (tee_local $8 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 40) - ) - ) - (i32.const 1) - ) - ) - (i32.const 107374183) - ) - ) - (set_local $7 - (i32.const 107374182) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $8 - (i32.div_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $8) - ) - (i32.const 40) - ) - ) - (i32.const 53687090) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $7 - (select - (get_local $6) - (tee_local $7 - (i32.shl - (get_local $8) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $6) - ) - ) - ) - ) - ) - ) - (set_local $8 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $3 - (i32.add - (get_local $8) - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (set_local $4 - (i32.add - (tee_local $8 - (call $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy17750730572681658536EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (tee_local $9 - (i32.add - (get_local $8) - (i32.mul - (get_local $9) - (i32.const 40) - ) - ) - ) - (get_local $1) - (get_local $2) - ) - ) - (i32.const 40) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.load - (get_local $0) - ) - ) - ) - ) - (set_local $5 - (i32.sub - (i32.const 0) - (get_local $7) - ) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const -20) - ) - ) - (loop $label$6 - (i64.store - (i32.add - (get_local $8) - (i32.const -32) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -12) - ) - ) - ) - (i64.store - (i32.add - (get_local $8) - (i32.const -40) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -20) - ) - ) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - (i64.const 0) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $8) - (i32.const -16) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const -4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -20) - ) - (i32.load - (get_local $7) - ) - ) - (i32.store - (get_local $2) - (i32.load - (tee_local $1 - (i32.add - (get_local $7) - (i32.const 4) - ) - ) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -12) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (i32.store - (tee_local $2 - (i32.add - (get_local $8) - (i32.const -4) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - (i32.store - (get_local $2) - (i32.load - (tee_local $8 - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (set_local $8 - (tee_local $9 - (i32.add - (get_local $9) - (i32.const -40) - ) - ) - ) - (br_if $label$6 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $5) - ) - (i32.const -20) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $0) - ) - ) - (br $label$4) - ) - (set_local $1 - (get_local $7) - ) - ) - (i32.store - (get_local $0) - (get_local $9) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $4) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $3) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $7) - (get_local $1) - ) - ) - (set_local $9 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (loop $label$8 - (block $label$9 - (br_if $label$9 - (i32.eqz - (tee_local $8 - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 16) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $8 - (i32.load - (get_local $7) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 4) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$8 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $9) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - ) - (func $_ZN5eosio6actionC2I18test_action_actionILy14605617063041957888ELy17750730572681658536EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ (param $0 i32) (param $1 i32) (param $2 i32) (result 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 16) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -3841127010667593728) - ) - (i64.store offset=8 - (get_local $0) - (i64.const -696013501027893080) - ) - (i32.store offset=16 - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 20) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $6) - (i32.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $7) - (i32.const 0) - ) - (i64.store - (get_local $7) - (i64.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $1 - (i32.load - (get_local $2) - ) - ) - (tee_local $4 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.sub - (get_local $4) - (get_local $1) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $7) - (get_local $3) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $2) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $1) - (get_local $4) - ) - ) - (loop $label$2 - (i32.store8 offset=15 - (get_local $7) - (i32.load8_u - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $5) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $6) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 32) - ) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - ) - (i64.store align=4 - (get_local $6) - (i64.load - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction33send_deferred_transaction_replaceEyyy (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (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) - ) - ) - ) - (set_local $7 - (call $current_time) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 60) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 64) - ) - (i32.const 0) - ) - (i32.store offset=44 - (get_local $11) - (i32.const 0) - ) - (i32.store8 offset=48 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=52 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=56 - (get_local $11) - (i32.const 0) - ) - (i32.store offset=32 - (get_local $11) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $7) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=68 - (get_local $11) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 72) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 76) - ) - (i32.const 0) - ) - (i32.store offset=80 - (get_local $11) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 84) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 88) - ) - (i32.const 0) - ) - (i32.store offset=24 - (get_local $11) - (i32.const 0) - ) - (set_local $7 - (i64.const 0) - ) - (i64.store offset=16 - (get_local $11) - (i64.const 0) - ) - (set_local $3 - (i32.add - (get_local $11) - (i32.const 68) - ) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 368) - ) - (set_local $8 - (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 $7) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $4 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $4 - (select - (i32.add - (get_local $4) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $4) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $4) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 416) - ) - (set_local $10 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $7) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $4 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $4 - (select - (i32.add - (get_local $4) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $4) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $4) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $10 - (i64.or - (get_local $9) - (get_local $10) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=8 - (get_local $11) - (get_local $10) - ) - (i64.store - (get_local $11) - (get_local $8) - ) - (i32.store - (i32.add - (tee_local $5 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (get_local $11) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 4) - ) - (i32.load offset=4 - (get_local $11) - ) - ) - (i32.store offset=96 - (get_local $11) - (get_local $5) - ) - (i32.store - (get_local $5) - (i32.load - (get_local $11) - ) - ) - (i32.store offset=104 - (get_local $11) - (tee_local $4 - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $5) - (i32.const 8) - ) - (i32.load offset=8 - (get_local $11) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $4) - ) - (call $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJNS0_INS1_16permission_levelENS3_IS7_EEEER18test_action_actionILy14605617063041957888ELy17750730572681658536EEEEEvDpOT_ - (get_local $3) - (i32.add - (get_local $11) - (i32.const 96) - ) - (i32.add - (get_local $11) - (i32.const 16) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (i32.store - (i32.add - (get_local $11) - (i32.const 52) - ) - (i32.const 2) - ) - (i64.store offset=8 - (get_local $11) - (i64.const 0) - ) - (i64.store - (get_local $11) - (i64.const -1) - ) - (call $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $11) - (i32.const 96) - ) - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - (call $send_deferred - (get_local $11) - (get_local $0) - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - (i32.sub - (i32.load offset=100 - (get_local $11) - ) - (get_local $5) - ) - (i32.const 1) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $5 - (i32.load offset=96 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=100 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $5 - (i32.load offset=16 - (get_local $11) - ) - ) - ) - ) - (i32.store offset=20 - (get_local $11) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $11) - (i32.const 32) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 112) - ) - ) - ) - (func $_ZN16test_transaction32send_deferred_tx_with_dtt_actionEv - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 176) - ) - ) - ) - (set_local $0 - (call $_ZN10dtt_actionC2Ev - (i32.add - (get_local $7) - (i32.const 120) - ) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $7) - (i32.const 120) - ) - (call $action_data_size) - ) - ) - (set_local $4 - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $7) - (i32.const 104) - ) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $7) - (i32.const 112) - ) - (i64.const 0) - ) - (i64.store offset=96 - (get_local $7) - (i64.const 0) - ) - (i64.store offset=80 - (get_local $7) - (i64.load offset=8 - (get_local $0) - ) - ) - (i64.store offset=88 - (get_local $7) - (i64.load offset=16 - (get_local $0) - ) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $5 - (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 $4) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=16 - (get_local $7) - (get_local $5) - ) - (i64.store offset=24 - (get_local $7) - (i64.load offset=24 - (get_local $0) - ) - ) - (i64.store - (i32.add - (tee_local $2 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 8) - ) - (i64.load offset=24 - (get_local $7) - ) - ) - (i64.store - (get_local $2) - (i64.load offset=16 - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 100) - ) - (tee_local $1 - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - ) - (i32.store offset=96 - (get_local $7) - (get_local $2) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 104) - ) - (get_local $1) - ) - (set_local $4 - (call $current_time) - ) - (i32.store - (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 28) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 48) - ) - (i32.const 0) - ) - (i32.store offset=28 - (get_local $7) - (i32.const 0) - ) - (i32.store8 offset=32 - (get_local $7) - (i32.const 0) - ) - (i32.store offset=36 - (get_local $7) - (i32.const 0) - ) - (i32.store offset=40 - (get_local $7) - (i32.const 0) - ) - (i32.store offset=16 - (get_local $7) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $4) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=52 - (get_local $7) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 56) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 60) - ) - (i32.const 0) - ) - (i32.store offset=64 - (get_local $7) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 68) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 72) - ) - (i32.const 0) - ) - (call $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJRS2_EEEvDpOT_ - (i32.add - (get_local $7) - (i32.const 52) - ) - (i32.add - (get_local $7) - (i32.const 80) - ) - ) - (i32.store offset=36 - (get_local $7) - (i32.load offset=32 - (get_local $0) - ) - ) - (i64.store offset=8 - (get_local $7) - (i64.const 0) - ) - (i64.store - (get_local $7) - (i64.const -1) - ) - (drop - (call $cancel_deferred - (get_local $7) - ) - ) - (i64.store offset=8 - (get_local $7) - (i64.const 0) - ) - (i64.store - (get_local $7) - (i64.const -1) - ) - (set_local $4 - (i64.load - (get_local $0) - ) - ) - (call $_ZN5eosio4packINS_11transactionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $7) - (i32.const 160) - ) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (call $send_deferred - (get_local $7) - (get_local $4) - (tee_local $2 - (i32.load offset=160 - (get_local $7) - ) - ) - (i32.sub - (i32.load offset=164 - (get_local $7) - ) - (get_local $2) - ) - (i32.const 1) - ) - (block $label$6 - (br_if $label$6 - (i32.eqz - (tee_local $2 - (i32.load offset=160 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=164 - (get_local $7) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (tee_local $2 - (i32.load - (i32.add - (i32.add - (get_local $7) - (i32.const 80) - ) - (i32.const 28) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 112) - ) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.eqz - (tee_local $2 - (i32.load - (i32.add - (get_local $7) - (i32.const 96) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 100) - ) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 176) - ) - ) - ) - (func $_ZN10dtt_actionC2Ev (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $5 - (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 $4) - (i64.const 6) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store align=1 - (get_local $0) - (get_local $5) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 368) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $4) - (i64.const 6) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=16 align=1 - (get_local $0) - (i64.const -696013501027893080) - ) - (i64.store align=1 - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $5) - ) - (set_local $4 - (i64.const 0) - ) - (set_local $3 - (i64.const 59) - ) - (set_local $2 - (i32.const 416) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (block $label$16 - (block $label$17 - (br_if $label$17 - (i64.gt_u - (get_local $4) - (i64.const 5) - ) - ) - (br_if $label$16 - (i32.gt_u - (i32.and - (i32.add - (tee_local $1 - (i32.load8_s - (get_local $2) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 165) - ) - ) - (br $label$15) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$14 - (i64.le_u - (get_local $4) - (i64.const 11) - ) - ) - (br $label$13) - ) - (set_local $1 - (select - (i32.add - (get_local $1) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $1) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $1) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $3) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (set_local $4 - (i64.add - (get_local $4) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$12 - (i64.ne - (tee_local $3 - (i64.add - (get_local $3) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i32.store offset=32 align=1 - (get_local $0) - (i32.const 2) - ) - (i64.store align=1 - (i32.add - (get_local $0) - (i32.const 24) - ) - (get_local $5) - ) - (get_local $0) - ) - (func $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJRS2_EEEvDpOT_ (param $0 i32) (param $1 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) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.ge_u - (tee_local $5 - (i32.add - (tee_local $9 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $0) - ) - (tee_local $8 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 40) - ) - ) - (i32.const 1) - ) - ) - (i32.const 107374183) - ) - ) - (set_local $7 - (i32.const 107374182) - ) - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.gt_u - (tee_local $8 - (i32.div_s - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $8) - ) - (i32.const 40) - ) - ) - (i32.const 53687090) - ) - ) - (br_if $label$2 - (i32.eqz - (tee_local $7 - (select - (get_local $5) - (tee_local $7 - (i32.shl - (get_local $8) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $5) - ) - ) - ) - ) - ) - ) - (set_local $8 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $2 - (i32.add - (get_local $8) - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (set_local $3 - (i32.add - (tee_local $8 - (call $_ZN5eosio6actionC2ERKS0_ - (tee_local $9 - (i32.add - (get_local $8) - (i32.mul - (get_local $9) - (i32.const 40) - ) - ) - ) - (get_local $1) - ) - ) - (i32.const 40) - ) - ) - (block $label$4 - (block $label$5 - (br_if $label$5 - (i32.eq - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $7 - (i32.load - (get_local $0) - ) - ) - ) - ) - (set_local $4 - (i32.sub - (i32.const 0) - (get_local $7) - ) - ) - (set_local $7 - (i32.add - (get_local $1) - (i32.const -20) - ) - ) - (loop $label$6 - (i64.store - (i32.add - (get_local $8) - (i32.const -32) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -12) - ) - ) - ) - (i64.store - (i32.add - (get_local $8) - (i32.const -40) - ) - (i64.load - (i32.add - (get_local $7) - (i32.const -20) - ) - ) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - (i64.const 0) - ) - (i32.store - (tee_local $5 - (i32.add - (get_local $8) - (i32.const -16) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const -4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -20) - ) - (i32.load - (get_local $7) - ) - ) - (i32.store - (get_local $5) - (i32.load - (tee_local $1 - (i32.add - (get_local $7) - (i32.const 4) - ) - ) - ) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -12) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (i32.store - (tee_local $5 - (i32.add - (get_local $8) - (i32.const -4) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $6 - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - (i32.store - (get_local $5) - (i32.load - (tee_local $8 - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - ) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (set_local $8 - (tee_local $9 - (i32.add - (get_local $9) - (i32.const -40) - ) - ) - ) - (br_if $label$6 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $4) - ) - (i32.const -20) - ) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $0) - ) - ) - (br $label$4) - ) - (set_local $1 - (get_local $7) - ) - ) - (i32.store - (get_local $0) - (get_local $9) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $3) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $2) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (get_local $7) - (get_local $1) - ) - ) - (set_local $9 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const -24) - ) - ) - (loop $label$8 - (block $label$9 - (br_if $label$9 - (i32.eqz - (tee_local $8 - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 16) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (tee_local $8 - (i32.load - (get_local $7) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 4) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$8 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $9) - ) - (i32.const -24) - ) - ) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - ) - (func $_ZN5eosio6actionC2ERKS0_ (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (i64.store - (get_local $0) - (i64.load - (get_local $1) - ) - ) - (i64.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.const 0) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.eqz - (tee_local $5 - (i32.shr_s - (tee_local $4 - (i32.sub - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - (i32.load offset=16 - (get_local $1) - ) - ) - ) - (i32.const 4) - ) - ) - ) - ) - (br_if $label$1 - (i32.ge_u - (get_local $5) - (i32.const 268435456) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 16) - ) - (tee_local $4 - (call $_Znwj - (get_local $4) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.add - (get_local $4) - (i32.shl - (get_local $5) - (i32.const 4) - ) - ) - ) - (i32.store - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 20) - ) - ) - (get_local $4) - ) - (br_if $label$2 - (i32.lt_s - (tee_local $3 - (i32.sub - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - (tee_local $2 - (i32.load - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - ) - ) - (i32.const 1) - ) - ) - (drop - (call $memcpy - (get_local $4) - (get_local $2) - (get_local $3) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) - ) - (get_local $3) - ) - ) - ) - (i64.store offset=28 align=4 - (get_local $0) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $4 - (i32.sub - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - (i32.load offset=28 - (get_local $1) - ) - ) - ) - ) - ) - (br_if $label$0 - (i32.le_s - (get_local $4) - (i32.const -1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 28) - ) - (tee_local $5 - (call $_Znwj - (get_local $4) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.add - (get_local $5) - (get_local $4) - ) - ) - (i32.store - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - (get_local $5) - ) - (br_if $label$3 - (i32.lt_s - (tee_local $1 - (i32.sub - (i32.load - (i32.add - (get_local $1) - (i32.const 32) - ) - ) - (tee_local $3 - (i32.load - (i32.add - (get_local $1) - (i32.const 28) - ) - ) - ) - ) - ) - (i32.const 1) - ) - ) - (drop - (call $memcpy - (get_local $5) - (get_local $3) - (get_local $1) - ) - ) - (i32.store - (get_local $4) - (i32.add - (i32.load - (get_local $4) - ) - (get_local $1) - ) - ) - ) - (return - (get_local $0) - ) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - (unreachable) - ) - (func $_ZN16test_transaction35cancel_deferred_transaction_successEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -1) - ) - (call $eosio_assert - (i32.ne - (call $cancel_deferred - (get_local $0) - ) - (i32.const 0) - ) - (i32.const 18128) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN16test_transaction37cancel_deferred_transaction_not_foundEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const -1) - ) - (call $eosio_assert - (i32.eqz - (call $cancel_deferred - (get_local $0) - ) - ) - (i32.const 18160) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (func $_ZN16test_transaction14send_cf_actionEv - (local $0 i32) - (local $1 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $1 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (i64.store - (i32.add - (get_local $1) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $1) - (i32.const 40) - ) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $1) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $1) - (i64.const 5666987383162142720) - ) - (i64.store offset=16 - (get_local $1) - (i64.const 6256973794934521856) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 18224) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $1) - (i32.const 48) - ) - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (call $send_context_free_inline - (tee_local $0 - (i32.load offset=48 - (get_local $1) - ) - ) - (i32.sub - (i32.load offset=52 - (get_local $1) - ) - (get_local $0) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.eqz - (tee_local $0 - (i32.load offset=48 - (get_local $1) - ) - ) - ) - ) - (i32.store offset=52 - (get_local $1) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $0 - (i32.load offset=36 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 40) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$2 - (br_if $label$2 - (i32.eqz - (tee_local $0 - (i32.load - (i32.add - (get_local $1) - (i32.const 24) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 28) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $1) - (i32.const 64) - ) - ) - ) - (func $_ZN16test_transaction19send_cf_action_failEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $7 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 96) - ) - ) - ) - (i32.store offset=88 - (get_local $7) - (i32.const 0) - ) - (set_local $3 - (i64.const 0) - ) - (i64.store offset=80 - (get_local $7) - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 18272) - ) - (set_local $4 - (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 $3) - (i64.const 4) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 416) - ) - (set_local $6 - (i64.const 0) - ) - (loop $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (block $label$11 - (br_if $label$11 - (i64.gt_u - (get_local $3) - (i64.const 5) - ) - ) - (br_if $label$10 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$9) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$8 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$7) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $6 - (i64.or - (get_local $5) - (get_local $6) - ) - ) - (br_if $label$6 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (i64.store offset=16 - (get_local $7) - (get_local $6) - ) - (i64.store offset=8 - (get_local $7) - (get_local $4) - ) - (i32.store - (i32.add - (tee_local $1 - (call $_Znwj - (i32.const 16) - ) - ) - (i32.const 12) - ) - (i32.load - (i32.add - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.const 12) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (i32.load offset=12 - (get_local $7) - ) - ) - (i32.store offset=24 - (get_local $7) - (get_local $1) - ) - (i32.store - (get_local $1) - (i32.load offset=8 - (get_local $7) - ) - ) - (i32.store offset=32 - (get_local $7) - (tee_local $0 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=16 - (get_local $7) - ) - ) - (i32.store offset=28 - (get_local $7) - (get_local $0) - ) - (set_local $1 - (call $_ZN5eosio6actionC2I18test_action_actionILy5666987383162142720ELy6256973794934521856EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ - (i32.add - (get_local $7) - (i32.const 40) - ) - (i32.add - (get_local $7) - (i32.const 24) - ) - (i32.add - (get_local $7) - (i32.const 80) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $0 - (i32.load offset=24 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=28 - (get_local $7) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - (i32.load offset=16 - (get_local $1) - ) - ) - (i32.const 18224) - ) - (call $_ZN5eosio4packINS_6actionEEENSt3__16vectorIcNS2_9allocatorIcEEEERKT_ - (i32.add - (get_local $7) - (i32.const 8) - ) - (get_local $1) - ) - (call $send_context_free_inline - (tee_local $0 - (i32.load offset=8 - (get_local $7) - ) - ) - (i32.sub - (i32.load offset=12 - (get_local $7) - ) - (get_local $0) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $0 - (i32.load offset=8 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=12 - (get_local $7) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 18288) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $0 - (i32.load offset=28 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 32) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$15 - (br_if $label$15 - (i32.eqz - (tee_local $0 - (i32.load offset=16 - (get_local $1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 20) - ) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (block $label$16 - (br_if $label$16 - (i32.eqz - (tee_local $1 - (i32.load offset=80 - (get_local $7) - ) - ) - ) - ) - (i32.store offset=84 - (get_local $7) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 96) - ) - ) - ) - (func $_ZN5eosio6actionC2I18test_action_actionILy5666987383162142720ELy6256973794934521856EEEEONSt3__16vectorINS_16permission_levelENS4_9allocatorIS6_EEEERKT_ (param $0 i32) (param $1 i32) (param $2 i32) (result 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 16) - ) - ) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 24) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $0) - (i32.const 32) - ) - (i64.const 0) - ) - (i64.store - (get_local $0) - (i64.const 5666987383162142720) - ) - (i64.store offset=8 - (get_local $0) - (i64.const 6256973794934521856) - ) - (i32.store offset=16 - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 20) - ) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $6) - (i32.load offset=8 - (get_local $1) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i64.store align=4 - (get_local $1) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $7) - (i32.const 0) - ) - (i64.store - (get_local $7) - (i64.const 0) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.eq - (tee_local $1 - (i32.load - (get_local $2) - ) - ) - (tee_local $4 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (tee_local $3 - (i32.sub - (get_local $4) - (get_local $1) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $7) - (get_local $3) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $2) - ) - ) - (set_local $5 - (i32.load offset=4 - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $1) - (get_local $4) - ) - ) - (loop $label$2 - (i32.store8 offset=15 - (get_local $7) - (i32.load8_u - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (get_local $5) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $6) - (i32.add - (get_local $7) - (i32.const 15) - ) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $4) - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 28) - ) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 32) - ) - (get_local $1) - ) - (call $_ZdlPv - (get_local $1) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - ) - (i64.store align=4 - (get_local $6) - (i64.load - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 36) - ) - (i32.load - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN16test_transaction12stateful_apiEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (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) - ) - ) - ) - (i32.store offset=12 - (get_local $8) - (i32.const 1) - ) - (set_local $2 - (i64.const 0) - ) - (set_local $4 - (i64.const 59) - ) - (set_local $1 - (i32.const 18352) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$0 - (set_local $6 - (i64.const 0) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (i64.gt_u - (get_local $2) - (i64.const 15) - ) - ) - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$2 - (i64.gt_u - (get_local $2) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $4) - (i64.const 4294967295) - ) - ) - ) - (br $label$1) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $2 - (i64.add - (get_local $2) - (i64.const 1) - ) - ) - (set_local $3 - (i64.or - (get_local $6) - (get_local $3) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $4 - (i64.add - (get_local $4) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $2 - (i64.const 0) - ) - (set_local $4 - (i64.const 59) - ) - (set_local $1 - (i32.const 18384) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$5 - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (block $label$10 - (br_if $label$10 - (i64.gt_u - (get_local $2) - (i64.const 4) - ) - ) - (br_if $label$9 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$8) - ) - (set_local $6 - (i64.const 0) - ) - (br_if $label$7 - (i64.le_u - (get_local $2) - (i64.const 11) - ) - ) - (br $label$6) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $4) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $2 - (i64.add - (get_local $2) - (i64.const 1) - ) - ) - (set_local $5 - (i64.or - (get_local $6) - (get_local $5) - ) - ) - (br_if $label$5 - (i64.ne - (tee_local $4 - (i64.add - (get_local $4) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (set_local $2 - (i64.const 0) - ) - (set_local $4 - (i64.const 59) - ) - (set_local $1 - (i32.const 18352) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$11 - (set_local $6 - (i64.const 0) - ) - (block $label$12 - (block $label$13 - (br_if $label$13 - (i64.gt_u - (get_local $2) - (i64.const 15) - ) - ) - (block $label$14 - (block $label$15 - (br_if $label$15 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$14) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $6 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - (br_if $label$13 - (i64.gt_u - (get_local $2) - (i64.const 11) - ) - ) - (set_local $6 - (i64.shl - (i64.and - (get_local $6) - (i64.const 31) - ) - (i64.and - (get_local $4) - (i64.const 4294967295) - ) - ) - ) - (br $label$12) - ) - (set_local $6 - (i64.and - (get_local $6) - (i64.const 15) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $2 - (i64.add - (get_local $2) - (i64.const 1) - ) - ) - (set_local $7 - (i64.or - (get_local $6) - (get_local $7) - ) - ) - (br_if $label$11 - (i64.ne - (tee_local $4 - (i64.add - (get_local $4) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (drop - (call $db_store_i64 - (get_local $3) - (get_local $5) - (get_local $7) - (i64.const 0) - (i32.add - (get_local $8) - (i32.const 12) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - ) - (func $_ZN16test_transaction16context_free_apiEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 128) - ) - ) - ) - (drop - (call $get_context_free_data - (i32.const 0) - (tee_local $0 - (call $memset - (get_local $0) - (i32.const 0) - (i32.const 128) - ) - ) - (i32.const 128) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 128) - ) - ) - ) - (func $_ZN16test_transaction11new_featureEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 18400) - ) - (set_local $4 - (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 $3) - (i64.const 9) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i32.eqz - (call $is_feature_active - (get_local $4) - ) - ) - (i32.const 18416) - ) - ) - (func $_ZN16test_transaction18active_new_featureEv - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (set_local $3 - (i64.const 0) - ) - (set_local $2 - (i64.const 59) - ) - (set_local $1 - (i32.const 18400) - ) - (set_local $4 - (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 $3) - (i64.const 9) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $0 - (i32.load8_s - (get_local $1) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 165) - ) - ) - (br $label$3) - ) - (set_local $5 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $3) - (i64.const 11) - ) - ) - (br $label$1) - ) - (set_local $0 - (select - (i32.add - (get_local $0) - (i32.const 208) - ) - (i32.const 0) - (i32.lt_u - (i32.and - (i32.add - (get_local $0) - (i32.const -49) - ) - (i32.const 255) - ) - (i32.const 5) - ) - ) - ) - ) - (set_local $5 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $0) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $5 - (i64.shl - (i64.and - (get_local $5) - (i64.const 31) - ) - (i64.and - (get_local $2) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (set_local $4 - (i64.or - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $2 - (i64.add - (get_local $2) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $activate_feature - (get_local $4) - ) - ) - (func $_ZN14test_checktime14checktime_passEv - (call $printi - (i64.const 49995000) - ) - ) - (func $_ZN14test_checktime17checktime_failureEv - (local $0 i64) - (local $1 i64) - (local $2 i64) - (local $3 i64) - (set_local $2 - (i64.const 0) - ) - (set_local $1 - (i64.const 1) - ) - (set_local $3 - (i64.const 0) - ) - (loop $label$0 - (set_local $2 - (i64.add - (i64.and - (tee_local $0 - (get_local $2) - ) - (i64.const 4294967295) - ) - (get_local $3) - ) - ) - (set_local $3 - (i64.add - (get_local $3) - (i64.const 1) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $1 - (i64.add - (get_local $1) - (i64.const -1) - ) - ) - (i64.const 8446744073709551617) - ) - ) - ) - (call $printi - (i64.shr_s - (i64.shl - (i64.sub - (get_local $0) - (get_local $1) - ) - (i64.const 32) - ) - (i64.const 32) - ) - ) - ) - (func $_ZN14test_checktime22checktime_sha1_failureEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha1 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN14test_checktime29checktime_assert_sha1_failureEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $assert_sha1 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN14test_checktime24checktime_sha256_failureEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $sha256 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN14test_checktime31checktime_assert_sha256_failureEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $assert_sha256 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN14test_checktime24checktime_sha512_failureEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (call $sha512 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - (func $_ZN14test_checktime31checktime_assert_sha512_failureEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 64) - ) - ) - ) - (call $assert_sha512 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 64) - ) - ) - ) - (func $_ZN14test_checktime27checktime_ripemd160_failureEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $ripemd160 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN14test_checktime34checktime_assert_ripemd160_failureEv - (local $0 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $0 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 32) - ) - ) - ) - (call $assert_ripemd160 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (get_local $0) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $0) - (i32.const 32) - ) - ) - ) - (func $_ZN15test_permission19check_authorizationEyyy (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i32) - (local $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 64) - ) - ) - ) - (call $_ZN5eosio18unpack_action_dataI14check_auth_msgEET_v - (i32.add - (get_local $9) - (i32.const 16) - ) - ) - (i32.store offset=8 - (get_local $9) - (i32.const 0) - ) - (i64.store - (get_local $9) - (i64.const 0) - ) - (set_local $7 - (i32.const 34) - ) - (set_local $8 - (i64.extend_u/i32 - (i32.div_s - (tee_local $6 - (i32.sub - (tee_local $4 - (i32.load - (i32.add - (get_local $9) - (i32.const 36) - ) - ) - ) - (tee_local $5 - (i32.load offset=32 - (get_local $9) - ) - ) - ) - ) - (i32.const 34) - ) - ) - ) - (set_local $3 - (i32.add - (get_local $9) - (i32.const 32) - ) - ) - (loop $label$0 - (set_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $8 - (i64.shr_u - (get_local $8) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - ) - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $5) - (get_local $4) - ) - ) - (br_if $label$2 - (tee_local $7 - (i32.add - (i32.sub - (tee_local $4 - (i32.add - (get_local $6) - (i32.const -34) - ) - ) - (i32.rem_u - (get_local $4) - (i32.const 34) - ) - ) - (get_local $7) - ) - ) - ) - (set_local $4 - (i32.const 0) - ) - (set_local $7 - (i32.const 0) - ) - (br $label$1) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const -34) - ) - ) - ) - (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj - (get_local $9) - (get_local $7) - ) - (set_local $4 - (i32.load offset=4 - (get_local $9) - ) - ) - (set_local $7 - (i32.load - (get_local $9) - ) - ) - ) - (i32.store offset=52 - (get_local $9) - (get_local $7) - ) - (i32.store offset=48 - (get_local $9) - (get_local $7) - ) - (i32.store offset=56 - (get_local $9) - (get_local $4) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEE10public_keyEERT_S6_RKNSt3__16vectorIT0_NS7_9allocatorIS9_EEEE - (i32.add - (get_local $9) - (i32.const 48) - ) - (get_local $3) - ) - ) - (i64.store offset=48 - (get_local $9) - (i64.extend_s/i32 - (call $check_permission_authorization - (i64.load offset=16 - (get_local $9) - ) - (i64.load offset=24 - (get_local $9) - ) - (tee_local $7 - (i32.load - (get_local $9) - ) - ) - (i32.sub - (i32.load offset=4 - (get_local $9) - ) - (get_local $7) - ) - (i32.const 0) - (i32.const 0) - (i64.const 9223372036854775807) - ) - ) - ) - (block $label$4 - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.eq - (tee_local $7 - (call $db_lowerbound_i64 - (get_local $0) - (get_local $0) - (get_local $0) - (i64.const 1) - ) - ) - (i32.const -1) - ) - ) - (call $db_update_i64 - (get_local $7) - (get_local $0) - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.const 8) - ) - (br_if $label$5 - (tee_local $7 - (i32.load - (get_local $9) - ) - ) - ) - (br $label$4) - ) - (drop - (call $db_store_i64 - (get_local $0) - (get_local $0) - (get_local $0) - (i64.const 1) - (i32.add - (get_local $9) - (i32.const 48) - ) - (i32.const 8) - ) - ) - (br_if $label$4 - (i32.eqz - (tee_local $7 - (i32.load - (get_local $9) - ) - ) - ) - ) - ) - (i32.store offset=4 - (get_local $9) - (get_local $7) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (block $label$7 - (br_if $label$7 - (i32.eqz - (tee_local $7 - (i32.load offset=32 - (get_local $9) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $9) - (i32.const 36) - ) - (get_local $7) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $9) - (i32.const 64) - ) - ) - ) - (func $_ZN5eosio18unpack_action_dataI14check_auth_msgEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (set_local $4 - (tee_local $3 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $3) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $3 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $3 - (i32.sub - (get_local $3) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $3) - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.const 0) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i32.store - (get_local $4) - (get_local $3) - ) - (i32.store offset=8 - (get_local $4) - (tee_local $2 - (i32.add - (get_local $3) - (get_local $1) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (get_local $1) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $3) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (get_local $2) - (tee_local $1 - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - ) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $1) - (i32.const 8) - ) - ) - (i32.store offset=4 - (get_local $4) - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEE10public_keyEERT_S7_RNSt3__16vectorIT0_NS8_9allocatorISA_EEEE - (get_local $4) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEE10public_keyEERT_S6_RKNSt3__16vectorIT0_NS7_9allocatorIS9_EEEE (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) - (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) - ) - ) - ) - (set_local $6 - (i64.extend_u/i32 - (i32.div_s - (i32.sub - (i32.load offset=4 - (get_local $1) - ) - (i32.load - (get_local $1) - ) - ) - (i32.const 34) - ) - ) - ) - (set_local $7 - (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 $6) - ) - ) - (i32.store8 offset=40 - (get_local $8) - (i32.or - (i32.shl - (tee_local $3 - (i64.ne - (tee_local $6 - (i64.shr_u - (get_local $6) - (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 $7) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (get_local $5) - ) - (i32.add - (get_local $8) - (i32.const 40) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $5) - (tee_local $7 - (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.eq - (tee_local $5 - (i32.load - (get_local $1) - ) - ) - (tee_local $3 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$2 - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 6) - ) - (get_local $5) - (i32.const 34) - ) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 40) - ) - (i32.add - (get_local $8) - (i32.const 6) - ) - (i32.const 34) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $4) - ) - (get_local $7) - ) - (i32.const 33) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (get_local $2) - ) - (i32.add - (get_local $8) - (i32.const 40) - ) - (i32.const 34) - ) - ) - (i32.store - (get_local $2) - (tee_local $7 - (i32.add - (i32.load - (get_local $2) - ) - (i32.const 34) - ) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $3) - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 34) - ) - ) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 80) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEE10public_keyEERT_S7_RNSt3__16vectorIT0_NS8_9allocatorISA_EEEE (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 848) - ) - (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 - (block $label$3 - (br_if $label$3 - (i32.le_u - (tee_local $5 - (i32.wrap/i64 - (get_local $6) - ) - ) - (tee_local $7 - (i32.div_s - (i32.sub - (tee_local $3 - (i32.load offset=4 - (get_local $1) - ) - ) - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - ) - (i32.const 34) - ) - ) - ) - ) - (call $_ZNSt3__16vectorI10public_keyNS_9allocatorIS1_EEE8__appendEj - (get_local $1) - (i32.sub - (get_local $5) - (get_local $7) - ) - ) - (br_if $label$2 - (i32.ne - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - (tee_local $3 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (br $label$1) - ) - (block $label$4 - (br_if $label$4 - (i32.ge_u - (get_local $5) - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (tee_local $3 - (i32.add - (get_local $4) - (i32.mul - (get_local $5) - (i32.const 34) - ) - ) - ) - ) - ) - (br_if $label$1 - (i32.eq - (get_local $4) - (get_local $3) - ) - ) - ) - (set_local $7 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$5 - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $7) - ) - (i32.const 33) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $4) - (i32.load - (get_local $5) - ) - (i32.const 34) - ) - ) - (i32.store - (get_local $5) - (tee_local $7 - (i32.add - (i32.load - (get_local $5) - ) - (i32.const 34) - ) - ) - ) - (br_if $label$5 - (i32.ne - (get_local $3) - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 34) - ) - ) - ) - ) - ) - ) - (get_local $0) - ) - (func $_ZNSt3__16vectorI10public_keyNS_9allocatorIS1_EEE8__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.div_s - (i32.sub - (tee_local $2 - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (i32.const 34) - ) - (get_local $1) - ) - ) - (br_if $label$2 - (i32.ge_u - (tee_local $4 - (i32.add - (tee_local $3 - (i32.div_s - (i32.sub - (get_local $6) - (tee_local $5 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 34) - ) - ) - (get_local $1) - ) - ) - (i32.const 126322568) - ) - ) - (set_local $6 - (i32.const 126322567) - ) - (block $label$5 - (br_if $label$5 - (i32.gt_u - (tee_local $2 - (i32.div_s - (i32.sub - (get_local $2) - (get_local $5) - ) - (i32.const 34) - ) - ) - (i32.const 63161282) - ) - ) - (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 - (i32.mul - (get_local $6) - (i32.const 34) - ) - ) - ) - (br $label$1) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$6 - (drop - (call $memset - (get_local $6) - (i32.const 0) - (i32.const 34) - ) - ) - (i32.store - (get_local $0) - (tee_local $6 - (i32.add - (i32.load - (get_local $0) - ) - (i32.const 34) - ) - ) - ) - (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) - (i32.mul - (get_local $6) - (i32.const 34) - ) - ) - ) - (set_local $6 - (tee_local $5 - (i32.add - (get_local $2) - (i32.mul - (get_local $3) - (i32.const 34) - ) - ) - ) - ) - (loop $label$7 - (set_local $6 - (i32.add - (call $memset - (get_local $6) - (i32.const 0) - (i32.const 34) - ) - (i32.const 34) - ) - ) - (br_if $label$7 - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -1) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.mul - (i32.div_s - (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) - ) - ) - ) - ) - (i32.const -34) - ) - (i32.const 34) - ) - ) - ) - (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 $_ZN15test_permission25test_permission_last_usedEyyy (param $0 i64) (param $1 i64) (param $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 32) - ) - ) - ) - (call $_ZN5eosio18unpack_action_dataI29test_permission_last_used_msgEET_v - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - (call $eosio_assert - (i64.eq - (call $get_permission_last_used - (i64.load offset=8 - (get_local $3) - ) - (i64.load offset=16 - (get_local $3) - ) - ) - (i64.load offset=24 - (get_local $3) - ) - ) - (i32.const 18464) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 32) - ) - ) - ) - (func $_ZN5eosio18unpack_action_dataI29test_permission_last_used_msgEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (set_local $3 - (tee_local $2 - (i32.load offset=4 - (i32.const 0) - ) - ) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $2 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (get_local $2) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $2) - (get_local $1) - ) - ) - (call $eosio_assert - (i32.gt_u - (get_local $1) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $2) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (tee_local $1 - (i32.and - (get_local $1) - (i32.const -8) - ) - ) - (i32.const 8) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 8) - ) - (i32.add - (get_local $2) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.ne - (get_local $1) - (i32.const 16) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $0) - (i32.const 16) - ) - (i32.add - (get_local $2) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $3) - ) - ) - (func $_ZN15test_permission26test_account_creation_timeEyyy (param $0 i64) (param $1 i64) (param $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 32) - ) - ) - ) - (call $_ZN5eosio18unpack_action_dataI29test_permission_last_used_msgEET_v - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - (call $eosio_assert - (i64.eq - (call $get_account_creation_time - (i64.load offset=8 - (get_local $3) - ) - ) - (i64.load offset=24 - (get_local $3) - ) - ) - (i32.const 18512) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 32) - ) - ) - ) - (func $_ZN15test_datastream10test_basicEv - (local $0 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) - (local $9 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $8 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 160) - ) - ) - ) - (i32.store8 offset=144 - (get_local $8) - (i32.const 1) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.ne - (i32.load8_u offset=144 - (get_local $8) - ) - (i32.const 0) - ) - (i32.const 18560) - ) - (i32.store8 offset=144 - (get_local $8) - (i32.const 0) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.eqz - (i32.load8_u offset=144 - (get_local $8) - ) - ) - (i32.const 18560) - ) - (i32.store8 offset=8 - (get_local $8) - (i32.const 133) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load8_u offset=8 - (get_local $8) - ) - (i32.load8_u offset=144 - (get_local $8) - ) - ) - (i32.const 18576) - ) - (i32.store8 offset=8 - (get_local $8) - (i32.const 127) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 1) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load8_u offset=8 - (get_local $8) - ) - (i32.load8_u offset=144 - (get_local $8) - ) - ) - (i32.const 18592) - ) - (i32.store16 offset=8 - (get_local $8) - (i32.const 53191) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 2) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 2) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load16_u offset=8 - (get_local $8) - ) - (i32.load16_u offset=144 - (get_local $8) - ) - ) - (i32.const 18608) - ) - (i32.store16 offset=8 - (get_local $8) - (i32.const 12345) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 2) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 2) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load16_u offset=8 - (get_local $8) - ) - (i32.load16_u offset=144 - (get_local $8) - ) - ) - (i32.const 18624) - ) - (i32.store offset=8 - (get_local $8) - (i32.const -1234567890) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=8 - (get_local $8) - ) - (i32.load offset=144 - (get_local $8) - ) - ) - (i32.const 18640) - ) - (i32.store offset=8 - (get_local $8) - (i32.const -1060399406) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=8 - (get_local $8) - ) - (i32.load offset=144 - (get_local $8) - ) - ) - (i32.const 18656) - ) - (i64.store offset=8 - (get_local $8) - (i64.const -9223372036854775808) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $8) - ) - (i64.load offset=144 - (get_local $8) - ) - ) - (i32.const 18672) - ) - (i64.store offset=8 - (get_local $8) - (i64.const 9223372036854775807) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=8 - (get_local $8) - ) - (i64.load offset=144 - (get_local $8) - ) - ) - (i32.const 18688) - ) - (i32.store offset=8 - (get_local $8) - (i32.const 1067316150) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (f32.lt - (call $fabsf - (f32.sub - (f32.load offset=8 - (get_local $8) - ) - (f32.load offset=144 - (get_local $8) - ) - ) - ) - (f32.const 1.000000013351432e-10) - ) - (i32.const 18704) - ) - (i64.store offset=8 - (get_local $8) - (i64.const 4599676419421066581) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.add - (get_local $8) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (f64.lt - (call $fabs - (f64.sub - (f64.load offset=8 - (get_local $8) - ) - (f64.load offset=144 - (get_local $8) - ) - ) - ) - (f64.const 1e-20) - ) - (i32.const 18720) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 18728) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (tee_local $7 - (i32.or - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (i32.const 18736) - (i32.const 8) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (tee_local $2 - (i32.add - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.const 8) - ) - ) - (get_local $7) - (i32.const 8) - ) - ) - (set_local $6 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.ne - (i32.load offset=144 - (get_local $8) - ) - (i32.const 1) - ) - ) - (set_local $6 - (f64.lt - (call $fabs - (f64.sub - (f64.const 1.23456) - (f64.load - (get_local $2) - ) - ) - ) - (f64.const 1e-20) - ) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 18752) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 18760) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $7) - (i32.const 18764) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.or - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.const 4) - ) - (get_local $7) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.and - (i32.eq - (i32.load offset=144 - (get_local $8) - ) - (i32.const 10) - ) - (i32.eq - (i32.load offset=148 - (get_local $8) - ) - (i32.const 20) - ) - ) - (i32.const 18768) - ) - (i32.store - (i32.add - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 8) - ) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $8) - (i64.const 0) - ) - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.ge_u - (tee_local $6 - (call $strlen - (i32.const 1360) - ) - ) - (i32.const -16) - ) - ) - (block $label$8 - (block $label$9 - (block $label$10 - (br_if $label$10 - (i32.ge_u - (get_local $6) - (i32.const 11) - ) - ) - (i32.store8 offset=16 - (get_local $8) - (i32.shl - (get_local $6) - (i32.const 1) - ) - ) - (set_local $2 - (i32.or - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 1) - ) - ) - (br_if $label$9 - (get_local $6) - ) - (br $label$8) - ) - (set_local $2 - (call $_Znwj - (tee_local $3 - (i32.and - (i32.add - (get_local $6) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store offset=16 - (get_local $8) - (i32.or - (get_local $3) - (i32.const 1) - ) - ) - (i32.store offset=24 - (get_local $8) - (get_local $2) - ) - (i32.store offset=20 - (get_local $8) - (get_local $6) - ) - ) - (drop - (call $memcpy - (get_local $2) - (i32.const 1360) - (get_local $6) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $2) - (get_local $6) - ) - (i32.const 0) - ) - (call $_ZN8testtypeINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEE3runERKS6_PKc - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 18784) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (i32.and - (i32.load8_u offset=16 - (get_local $8) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load offset=24 - (get_local $8) - ) - ) - ) - (i32.store offset=24 - (get_local $8) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $8) - (i64.const 0) - ) - (i64.store align=4 - (tee_local $6 - (call $_Znwj - (i32.const 12) - ) - ) - (i64.const 85899345930) - ) - (i32.store offset=8 - (get_local $6) - (i32.const 30) - ) - (i32.store offset=16 - (get_local $8) - (get_local $6) - ) - (i32.store offset=24 - (get_local $8) - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 12) - ) - ) - ) - (i32.store offset=20 - (get_local $8) - (get_local $6) - ) - (call $_ZN8testtypeINSt3__16vectorIiNS0_9allocatorIiEEEEE3runERKS4_PKc - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 18800) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (tee_local $6 - (i32.load offset=16 - (get_local $8) - ) - ) - ) - ) - (i32.store offset=20 - (get_local $8) - (get_local $6) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - (set_local $6 - (i32.const 0) - ) - (i32.store offset=24 - (get_local $8) - (i32.const 0) - ) - (i64.store offset=16 - (get_local $8) - (i64.const 0) - ) - (call $_ZN8testtypeINSt3__16vectorIiNS0_9allocatorIiEEEEE3runERKS4_PKc - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 18816) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $2 - (i32.load offset=16 - (get_local $8) - ) - ) - ) - ) - (i32.store offset=20 - (get_local $8) - (get_local $2) - ) - (call $_ZdlPv - (get_local $2) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 18832) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (get_local $7) - (i32.const 18836) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (tee_local $2 - (i32.or - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 8) - ) - ) - (i32.const 18840) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.or - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.const 4) - ) - (get_local $7) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.const 8) - ) - (get_local $2) - (i32.const 4) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.ne - (i32.load offset=144 - (get_local $8) - ) - (i32.const 10) - ) - ) - (br_if $label$14 - (i32.ne - (i32.load offset=148 - (get_local $8) - ) - (i32.const 20) - ) - ) - (set_local $6 - (i32.eq - (i32.load - (i32.add - (get_local $8) - (i32.const 152) - ) - ) - (i32.const 30) - ) - ) - ) - (call $eosio_assert - (get_local $6) - (i32.const 18848) - ) - (i64.store align=4 - (i32.add - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 8) - ) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $8) - (i64.const 1) - ) - (set_local $6 - (i32.or - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (br_if $label$6 - (i32.ge_u - (tee_local $7 - (call $strlen - (i32.const 18864) - ) - ) - (i32.const -16) - ) - ) - (block $label$15 - (block $label$16 - (block $label$17 - (br_if $label$17 - (i32.ge_u - (get_local $7) - (i32.const 11) - ) - ) - (i32.store8 offset=20 - (get_local $8) - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$16 - (get_local $7) - ) - (br $label$15) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 28) - ) - (tee_local $6 - (call $_Znwj - (tee_local $2 - (i32.and - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 24) - ) - (get_local $7) - ) - (i32.store offset=20 - (get_local $8) - (i32.or - (get_local $2) - (i32.const 1) - ) - ) - ) - (drop - (call $memcpy - (get_local $6) - (i32.const 18864) - (get_local $7) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $6) - (get_local $7) - ) - (i32.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $8) - (i32.const 40) - ) - (i64.const 0) - ) - (i64.store offset=32 - (get_local $8) - (i64.const 2) - ) - (set_local $6 - (i32.add - (get_local $8) - (i32.const 36) - ) - ) - (br_if $label$5 - (i32.ge_u - (tee_local $7 - (call $strlen - (i32.const 18880) - ) - ) - (i32.const -16) - ) - ) - (block $label$18 - (block $label$19 - (block $label$20 - (br_if $label$20 - (i32.ge_u - (get_local $7) - (i32.const 11) - ) - ) - (i32.store8 - (i32.add - (get_local $8) - (i32.const 36) - ) - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$19 - (get_local $7) - ) - (br $label$18) - ) - (set_local $6 - (call $_Znwj - (tee_local $2 - (i32.and - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 36) - ) - (i32.or - (get_local $2) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 44) - ) - (get_local $6) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 40) - ) - (get_local $7) - ) - ) - (drop - (call $memcpy - (get_local $6) - (i32.const 18880) - (get_local $7) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $6) - (get_local $7) - ) - (i32.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $8) - (i32.const 56) - ) - (i64.const 0) - ) - (i64.store offset=48 - (get_local $8) - (i64.const 3) - ) - (set_local $6 - (i32.add - (get_local $8) - (i32.const 52) - ) - ) - (br_if $label$4 - (i32.ge_u - (tee_local $7 - (call $strlen - (i32.const 18896) - ) - ) - (i32.const -16) - ) - ) - (block $label$21 - (block $label$22 - (block $label$23 - (br_if $label$23 - (i32.ge_u - (get_local $7) - (i32.const 11) - ) - ) - (i32.store8 - (i32.add - (get_local $8) - (i32.const 52) - ) - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$22 - (get_local $7) - ) - (br $label$21) - ) - (set_local $6 - (call $_Znwj - (tee_local $2 - (i32.and - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 52) - ) - (i32.or - (get_local $2) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 60) - ) - (get_local $6) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 56) - ) - (get_local $7) - ) - ) - (drop - (call $memcpy - (get_local $6) - (i32.const 18896) - (get_local $7) - ) - ) - ) - (set_local $2 - (i32.const 0) - ) - (i32.store8 - (i32.add - (get_local $6) - (get_local $7) - ) - (i32.const 0) - ) - (i32.store offset=152 - (get_local $8) - (i32.const 0) - ) - (i32.store offset=148 - (get_local $8) - (i32.const 0) - ) - (i32.store offset=144 - (get_local $8) - (tee_local $1 - (i32.or - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.const 4) - ) - ) - ) - (set_local $0 - (i32.add - (get_local $8) - (i32.const 64) - ) - ) - (set_local $5 - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (set_local $4 - (i32.add - (get_local $8) - (i32.const 152) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $1) - (get_local $1) - ) - ) - (br $label$3) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (get_local $6) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (get_local $6) - ) - (unreachable) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (get_local $6) - ) - (unreachable) - ) - (set_local $9 - (i32.const 21) - ) - (br $label$1) - ) - (set_local $9 - (i32.const 3) - ) - ) - (loop $label$24 - (block $label$25 - (block $label$26 - (block $label$27 - (block $label$28 - (block $label$29 - (block $label$30 - (block $label$31 - (block $label$32 - (block $label$33 - (block $label$34 - (block $label$35 - (block $label$36 - (block $label$37 - (block $label$38 - (block $label$39 - (block $label$40 - (block $label$41 - (block $label$42 - (block $label$43 - (block $label$44 - (block $label$45 - (block $label$46 - (block $label$47 - (block $label$48 - (block $label$49 - (block $label$50 - (block $label$51 - (block $label$52 - (block $label$53 - (block $label$54 - (block $label$55 - (block $label$56 - (block $label$57 - (block $label$58 - (block $label$59 - (block $label$60 - (block $label$61 - (block $label$62 - (block $label$63 - (block $label$64 - (block $label$65 - (block $label$66 - (block $label$67 - (block $label$68 - (block $label$69 - (block $label$70 - (block $label$71 - (block $label$72 - (block $label$73 - (block $label$74 - (block $label$75 - (block $label$76 - (block $label$77 - (block $label$78 - (block $label$79 - (block $label$80 - (block $label$81 - (block $label$82 - (block $label$83 - (block $label$84 - (block $label$85 - (block $label$86 - (block $label$87 - (block $label$88 - (block $label$89 - (block $label$90 - (block $label$91 - (block $label$92 - (block $label$93 - (br_table $label$76 $label$72 $label$93 $label$92 $label$91 $label$87 $label$84 $label$81 $label$79 $label$77 $label$75 $label$74 $label$73 $label$78 $label$82 $label$80 $label$83 $label$86 $label$85 $label$89 $label$88 $label$90 $label$71 $label$70 $label$69 $label$68 $label$67 $label$66 $label$65 $label$64 $label$62 $label$61 $label$60 $label$59 $label$58 $label$63 $label$57 $label$57 - (get_local $9) - ) - ) - (set_local $2 - (i32.load offset=148 - (get_local $8) - ) - ) - (br_if $label$56 - (i32.eq - (i32.load offset=144 - (get_local $8) - ) - (get_local $1) - ) - ) - (set_local $9 - (i32.const 3) - ) - (br $label$24) - ) - (set_local $6 - (get_local $2) - ) - (br_if $label$41 - (i32.eqz - (get_local $2) - ) - ) - (set_local $9 - (i32.const 4) - ) - (br $label$24) - ) - (br_if $label$42 - (tee_local $6 - (i32.load offset=4 - (tee_local $7 - (get_local $6) - ) - ) - ) - ) - (br $label$43) - ) - (set_local $7 - (get_local $1) - ) - (br_if $label$33 - (get_local $2) - ) - (br $label$34) - ) - (set_local $6 - (get_local $1) - ) - (set_local $9 - (i32.const 20) - ) - (br $label$24) - ) - (set_local $3 - (i32.eq - (i32.load - (tee_local $7 - (i32.load offset=8 - (get_local $6) - ) - ) - ) - (get_local $6) - ) - ) - (set_local $6 - (get_local $7) - ) - (br_if $label$40 - (get_local $3) - ) - (set_local $9 - (i32.const 5) - ) - (br $label$24) - ) - (br_if $label$39 - (i32.ge_s - (i32.load offset=16 - (get_local $7) - ) - (tee_local $6 - (i32.load - (get_local $5) - ) - ) - ) - ) - (set_local $9 - (i32.const 17) - ) - (br $label$24) - ) - (br_if $label$55 - (i32.eqz - (get_local $2) - ) - ) - (set_local $9 - (i32.const 18) - ) - (br $label$24) - ) - (br_if $label$53 - (i32.load - (tee_local $2 - (i32.add - (get_local $7) - (i32.const 4) - ) - ) - ) - ) - (br $label$54) - ) - (set_local $3 - (get_local $1) - ) - (br_if $label$52 - (get_local $2) - ) - (set_local $9 - (i32.const 16) - ) - (br $label$24) - ) - (set_local $7 - (get_local $1) - ) - (br_if $label$45 - (i32.load - (tee_local $2 - (get_local $1) - ) - ) - ) - (br $label$46) - ) - (set_local $2 - (get_local $7) - ) - (set_local $9 - (i32.const 7) - ) - (br $label$24) - ) - (br_if $label$38 - (i32.ge_s - (get_local $6) - (tee_local $7 - (i32.load offset=16 - (get_local $2) - ) - ) - ) - ) - (set_local $9 - (i32.const 15) - ) - (br $label$24) - ) - (set_local $3 - (get_local $2) - ) - (br_if $label$47 - (tee_local $7 - (i32.load - (get_local $2) - ) - ) - ) - (br $label$48) - ) - (br_if $label$37 - (i32.ge_s - (get_local $7) - (get_local $6) - ) - ) - (set_local $9 - (i32.const 13) - ) - (br $label$24) - ) - (set_local $3 - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - (br_if $label$36 - (tee_local $7 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - (set_local $9 - (i32.const 9) - ) - (br $label$24) - ) - (set_local $7 - (get_local $2) - ) - (br_if $label$50 - (i32.load - (tee_local $2 - (get_local $3) - ) - ) - ) - (br $label$51) - ) - (set_local $7 - (get_local $2) - ) - (br_if $label$49 - (i32.load - (get_local $2) - ) - ) - (set_local $9 - (i32.const 10) - ) - (br $label$24) - ) - (i32.store offset=16 - (tee_local $6 - (call $_Znwj - (i32.const 32) - ) - ) - (i32.load - (get_local $5) - ) - ) - (drop - (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ - (i32.add - (get_local $6) - (i32.const 20) - ) - (i32.add - (get_local $5) - (i32.const 4) - ) - ) - ) - (i32.store offset=8 - (get_local $6) - (get_local $7) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (i32.store - (get_local $2) - (get_local $6) - ) - (br_if $label$35 - (i32.eqz - (tee_local $7 - (i32.load - (i32.load offset=144 - (get_local $8) - ) - ) - ) - ) - ) - (set_local $9 - (i32.const 11) - ) - (br $label$24) - ) - (i32.store offset=144 - (get_local $8) - (get_local $7) - ) - (set_local $6 - (i32.load - (get_local $2) - ) - ) - (set_local $9 - (i32.const 12) - ) - (br $label$24) - ) - (call $_ZNSt3__127__tree_balance_after_insertIPNS_16__tree_node_baseIPvEEEEvT_S5_ - (i32.load offset=148 - (get_local $8) - ) - (get_local $6) - ) - (i32.store - (get_local $4) - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 1) - ) - ) - (set_local $9 - (i32.const 1) - ) - (br $label$24) - ) - (br_if $label$44 - (i32.ne - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 16) - ) - ) - (get_local $0) - ) - ) - (set_local $9 - (i32.const 22) - ) - (br $label$24) - ) - (call $_ZN8testtypeINSt3__13mapIiNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_4lessIiEENS5_INS0_4pairIKiS7_EEEEEEE3runERKSE_PKc - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.const 18912) - ) - (call $_ZNSt3__16__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE - (i32.add - (get_local $8) - (i32.const 144) - ) - (i32.load offset=148 - (get_local $8) - ) - ) - (br_if $label$32 - (i32.eqz - (i32.and - (i32.load8_u - (i32.add - (get_local $8) - (i32.const 52) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $9 - (i32.const 23) - ) - (br $label$24) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $8) - (i32.const 60) - ) - ) - ) - (set_local $9 - (i32.const 24) - ) - (br $label$24) - ) - (br_if $label$31 - (i32.eqz - (i32.and - (i32.load8_u - (i32.add - (get_local $8) - (i32.const 36) - ) - ) - (i32.const 1) - ) - ) - ) - (set_local $9 - (i32.const 25) - ) - (br $label$24) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $8) - (i32.const 44) - ) - ) - ) - (set_local $9 - (i32.const 26) - ) - (br $label$24) - ) - (br_if $label$30 - (i32.eqz - (i32.and - (i32.load8_u offset=20 - (get_local $8) - ) - (i32.const 1) - ) - ) - ) - (set_local $9 - (i32.const 27) - ) - (br $label$24) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $8) - (i32.const 28) - ) - ) - ) - (set_local $9 - (i32.const 28) - ) - (br $label$24) - ) - (i64.store align=4 - (i32.add - (get_local $8) - (i32.const 24) - ) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $8) - (i64.const 1) - ) - (set_local $6 - (i32.or - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (br_if $label$29 - (i32.gt_u - (tee_local $7 - (call $strlen - (i32.const 7840) - ) - ) - (i32.const -17) - ) - ) - (set_local $9 - (i32.const 29) - ) - (br $label$24) - ) - (br_if $label$28 - (i32.ge_u - (get_local $7) - (i32.const 11) - ) - ) - (set_local $9 - (i32.const 35) - ) - (br $label$24) - ) - (i32.store8 offset=20 - (get_local $8) - (i32.shl - (get_local $7) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$26 - (get_local $7) - ) - (br $label$27) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 28) - ) - (tee_local $6 - (call $_Znwj - (tee_local $2 - (i32.and - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const 24) - ) - (get_local $7) - ) - (i32.store offset=20 - (get_local $8) - (i32.or - (get_local $2) - (i32.const 1) - ) - ) - (set_local $9 - (i32.const 31) - ) - (br $label$24) - ) - (drop - (call $memcpy - (get_local $6) - (i32.const 7840) - (get_local $7) - ) - ) - (set_local $9 - (i32.const 32) - ) - (br $label$24) - ) - (i32.store8 - (i32.add - (get_local $6) - (get_local $7) - ) - (i32.const 0) - ) - (i64.store offset=32 - (get_local $8) - (i64.const 4614688343118974445) - ) - (call $_ZN8testtypeINSt3__15tupleIJiNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEdEEEE3runERKS8_PKc - (i32.add - (get_local $8) - (i32.const 16) - ) - (i32.const 18928) - ) - (br_if $label$25 - (i32.eqz - (i32.and - (i32.load8_u offset=20 - (get_local $8) - ) - (i32.const 1) - ) - ) - ) - (set_local $9 - (i32.const 33) - ) - (br $label$24) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $8) - (i32.const 28) - ) - ) - ) - (set_local $9 - (i32.const 34) - ) - (br $label$24) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 160) - ) - ) - (return) - ) - (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv - (get_local $6) - ) - (unreachable) - ) - (set_local $9 - (i32.const 21) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 16) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 10) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 1) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 7) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 10) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 1) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 1) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 0) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 14) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 10) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 1) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 2) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 5) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 4) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 19) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 20) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 6) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 8) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 9) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 14) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 12) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 16) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 18) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 24) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 26) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 28) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 36) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 30) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 32) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 31) - ) - (br $label$24) - ) - (set_local $9 - (i32.const 34) - ) - (br $label$24) - ) - ) - (func $_ZN8testtypeINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEE3runERKS6_PKc (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (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 160) - ) - ) - ) - (i32.store offset=24 - (get_local $8) - (i32.add - (get_local $8) - (i32.const 160) - ) - ) - (i32.store offset=20 - (get_local $8) - (i32.add - (get_local $8) - (i32.const 32) - ) - ) - (i32.store offset=16 - (get_local $8) - (i32.add - (get_local $8) - (i32.const 32) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE - (i32.add - (get_local $8) - (i32.const 16) - ) - (get_local $0) - ) - ) - (i64.store - (get_local $8) - (i64.const 0) - ) - (set_local $7 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $8) - (i32.const 0) - ) - (i32.store offset=20 - (get_local $8) - (i32.load offset=16 - (get_local $8) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPcEEEERT_S5_RNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE - (i32.add - (get_local $8) - (i32.const 16) - ) - (get_local $8) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.ne - (tee_local $4 - (select - (i32.load offset=4 - (get_local $0) - ) - (tee_local $3 - (i32.shr_u - (tee_local $5 - (i32.load8_u - (get_local $0) - ) - ) - (i32.const 1) - ) - ) - (tee_local $2 - (i32.and - (get_local $5) - (i32.const 1) - ) - ) - ) - ) - (select - (i32.load offset=4 - (get_local $8) - ) - (i32.shr_u - (tee_local $5 - (i32.load8_u - (get_local $8) - ) - ) - (i32.const 1) - ) - (tee_local $5 - (i32.and - (get_local $5) - (i32.const 1) - ) - ) - ) - ) - ) - (set_local $5 - (select - (i32.load - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - (i32.or - (get_local $8) - (i32.const 1) - ) - (get_local $5) - ) - ) - (set_local $6 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (block $label$1 - (block $label$2 - (block $label$3 - (br_if $label$3 - (get_local $2) - ) - (br_if $label$2 - (i32.eqz - (get_local $4) - ) - ) - (set_local $0 - (i32.sub - (i32.const 0) - (get_local $3) - ) - ) - (loop $label$4 - (br_if $label$1 - (i32.ne - (i32.load8_u - (get_local $6) - ) - (i32.load8_u - (get_local $5) - ) - ) - ) - (set_local $7 - (i32.const 1) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$4 - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - ) - (br $label$0) - ) - ) - (br_if $label$2 - (i32.eqz - (get_local $4) - ) - ) - (set_local $7 - (i32.eqz - (call $memcmp - (select - (i32.load offset=8 - (get_local $0) - ) - (get_local $6) - (get_local $2) - ) - (get_local $5) - (get_local $4) - ) - ) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 1) - ) - (br $label$0) - ) - (set_local $7 - (i32.const 0) - ) - ) - (call $eosio_assert - (get_local $7) - (get_local $1) - ) - (block $label$5 - (br_if $label$5 - (i32.eqz - (i32.and - (i32.load8_u - (get_local $8) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 160) - ) - ) - ) - (func $_ZN8testtypeINSt3__16vectorIiNS0_9allocatorIiEEEEE3runERKS4_PKc (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (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 160) - ) - ) - ) - (i32.store offset=24 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 160) - ) - ) - (i32.store offset=20 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 32) - ) - ) - (i32.store offset=16 - (get_local $5) - (i32.add - (get_local $5) - (i32.const 32) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEiEERT_S5_RKNSt3__16vectorIT0_NS6_9allocatorIS8_EEEE - (i32.add - (get_local $5) - (i32.const 16) - ) - (get_local $0) - ) - ) - (i64.store - (get_local $5) - (i64.const 0) - ) - (set_local $4 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $5) - (i32.const 0) - ) - (i32.store offset=20 - (get_local $5) - (i32.load offset=16 - (get_local $5) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPcEEiEERT_S5_RNSt3__16vectorIT0_NS6_9allocatorIS8_EEEE - (i32.add - (get_local $5) - (i32.const 16) - ) - (get_local $5) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.ne - (i32.sub - (tee_local $2 - (i32.load offset=4 - (get_local $0) - ) - ) - (tee_local $0 - (i32.load - (get_local $0) - ) - ) - ) - (i32.sub - (i32.load offset=4 - (get_local $5) - ) - (tee_local $3 - (i32.load - (get_local $5) - ) - ) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (get_local $0) - (get_local $2) - ) - ) - (loop $label$2 - (br_if $label$0 - (i32.ne - (i32.load - (get_local $0) - ) - (i32.load - (get_local $3) - ) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 4) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $2) - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - ) - ) - (set_local $4 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $4) - (get_local $1) - ) - (block $label$3 - (br_if $label$3 - (i32.eqz - (tee_local $0 - (i32.load - (get_local $5) - ) - ) - ) - ) - (i32.store offset=4 - (get_local $5) - (get_local $0) - ) - (call $_ZdlPv - (get_local $0) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $5) - (i32.const 160) - ) - ) - ) - (func $_ZNSt3__127__tree_balance_after_insertIPNS_16__tree_node_baseIPvEEEEvT_S5_ (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (i32.store8 offset=12 - (get_local $1) - (tee_local $3 - (i32.eq - (get_local $1) - (get_local $0) - ) - ) - ) - (block $label$0 - (block $label$1 - (block $label$2 - (br_if $label$2 - (get_local $3) - ) - (block $label$3 - (block $label$4 - (block $label$5 - (loop $label$6 - (br_if $label$2 - (i32.load8_u offset=12 - (tee_local $2 - (i32.load offset=8 - (get_local $1) - ) - ) - ) - ) - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eq - (tee_local $4 - (i32.load - (tee_local $3 - (i32.load offset=8 - (get_local $2) - ) - ) - ) - ) - (get_local $2) - ) - ) - (br_if $label$7 - (i32.eqz - (get_local $4) - ) - ) - (br_if $label$7 - (i32.load8_u offset=12 - (get_local $4) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 12) - ) - ) - (br $label$8) - ) - (br_if $label$5 - (i32.eqz - (tee_local $4 - (i32.load offset=4 - (get_local $3) - ) - ) - ) - ) - (br_if $label$5 - (i32.load8_u offset=12 - (get_local $4) - ) - ) - (set_local $4 - (i32.add - (get_local $4) - (i32.const 12) - ) - ) - ) - (i32.store8 - (i32.add - (get_local $2) - (i32.const 12) - ) - (i32.const 1) - ) - (i32.store8 offset=12 - (get_local $3) - (tee_local $2 - (i32.eq - (get_local $3) - (get_local $0) - ) - ) - ) - (i32.store8 - (get_local $4) - (i32.const 1) - ) - (set_local $1 - (get_local $3) - ) - (br_if $label$6 - (i32.eqz - (get_local $2) - ) - ) - (br $label$2) - ) - ) - (br_if $label$4 - (i32.eq - (i32.load - (get_local $2) - ) - (get_local $1) - ) - ) - (set_local $4 - (get_local $2) - ) - (br $label$3) - ) - (br_if $label$1 - (i32.eq - (i32.load - (get_local $2) - ) - (get_local $1) - ) - ) - (i32.store offset=4 - (get_local $2) - (tee_local $1 - (i32.load - (tee_local $4 - (i32.load offset=4 - (get_local $2) - ) - ) - ) - ) - ) - (block $label$10 - (br_if $label$10 - (i32.eqz - (get_local $1) - ) - ) - (i32.store offset=8 - (get_local $1) - (get_local $2) - ) - (set_local $3 - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - ) - (i32.store offset=8 - (get_local $4) - (get_local $3) - ) - (i32.store - (select - (tee_local $3 - (i32.load - (tee_local $1 - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - ) - (i32.add - (get_local $3) - (i32.const 4) - ) - (i32.eq - (i32.load - (get_local $3) - ) - (get_local $2) - ) - ) - (get_local $4) - ) - (i32.store - (get_local $1) - (get_local $4) - ) - (i32.store - (get_local $4) - (get_local $2) - ) - (set_local $3 - (i32.load offset=8 - (get_local $4) - ) - ) - (br $label$0) - ) - (i32.store - (get_local $2) - (tee_local $1 - (i32.load offset=4 - (tee_local $4 - (i32.load - (get_local $2) - ) - ) - ) - ) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (get_local $1) - ) - ) - (i32.store offset=8 - (get_local $1) - (get_local $2) - ) - (set_local $3 - (i32.load - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - ) - (i32.store offset=8 - (get_local $4) - (get_local $3) - ) - (i32.store - (select - (tee_local $3 - (i32.load - (tee_local $1 - (i32.add - (get_local $2) - (i32.const 8) - ) - ) - ) - ) - (i32.add - (get_local $3) - (i32.const 4) - ) - (i32.eq - (i32.load - (get_local $3) - ) - (get_local $2) - ) - ) - (get_local $4) - ) - (i32.store - (get_local $1) - (get_local $4) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 4) - ) - (get_local $2) - ) - (set_local $3 - (i32.load offset=8 - (get_local $4) - ) - ) - ) - (i32.store8 offset=12 - (get_local $4) - (i32.const 1) - ) - (i32.store8 offset=12 - (get_local $3) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $3) - (tee_local $4 - (i32.load - (tee_local $2 - (i32.load offset=4 - (get_local $3) - ) - ) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (get_local $4) - ) - ) - (i32.store offset=8 - (get_local $4) - (get_local $3) - ) - ) - (i32.store offset=8 - (get_local $2) - (i32.load offset=8 - (get_local $3) - ) - ) - (i32.store - (select - (tee_local $4 - (i32.load offset=8 - (get_local $3) - ) - ) - (i32.add - (get_local $4) - (i32.const 4) - ) - (i32.eq - (i32.load - (get_local $4) - ) - (get_local $3) - ) - ) - (get_local $2) - ) - (i32.store offset=8 - (get_local $3) - (get_local $2) - ) - (i32.store - (get_local $2) - (get_local $3) - ) - ) - (return) - ) - (set_local $4 - (get_local $2) - ) - ) - (i32.store8 offset=12 - (get_local $4) - (i32.const 1) - ) - (i32.store8 offset=12 - (get_local $3) - (i32.const 0) - ) - (i32.store - (get_local $3) - (tee_local $4 - (i32.load offset=4 - (tee_local $2 - (i32.load - (get_local $3) - ) - ) - ) - ) - ) - (block $label$13 - (br_if $label$13 - (i32.eqz - (get_local $4) - ) - ) - (i32.store offset=8 - (get_local $4) - (get_local $3) - ) - ) - (i32.store offset=8 - (get_local $2) - (i32.load offset=8 - (get_local $3) - ) - ) - (i32.store - (select - (tee_local $4 - (i32.load offset=8 - (get_local $3) - ) - ) - (i32.add - (get_local $4) - (i32.const 4) - ) - (i32.eq - (i32.load - (get_local $4) - ) - (get_local $3) - ) - ) - (get_local $2) - ) - (i32.store offset=8 - (get_local $3) - (get_local $2) - ) - (i32.store - (i32.add - (get_local $2) - (i32.const 4) - ) - (get_local $3) - ) - ) - (func $_ZN8testtypeINSt3__13mapIiNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_4lessIiEENS5_INS0_4pairIKiS7_EEEEEEE3runERKSE_PKc (param $0 i32) (param $1 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) - (i32.store offset=4 - (i32.const 0) - (tee_local $10 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 160) - ) - ) - ) - (i32.store offset=24 - (get_local $10) - (i32.add - (get_local $10) - (i32.const 160) - ) - ) - (i32.store offset=20 - (get_local $10) - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - (i32.store offset=16 - (get_local $10) - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEiNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEERT_SC_RKNS4_3mapIT0_T1_NS4_4lessISE_EENS8_INS4_4pairIKSE_SF_EEEEEE - (i32.add - (get_local $10) - (i32.const 16) - ) - (get_local $0) - ) - ) - (i32.store - (get_local $10) - (i32.or - (get_local $10) - (i32.const 4) - ) - ) - (set_local $9 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $10) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $10) - (i32.const 0) - ) - (i32.store offset=20 - (get_local $10) - (i32.load offset=16 - (get_local $10) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPcEEiNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEERT_SC_RNS4_3mapIT0_T1_NS4_4lessISE_EENS8_INS4_4pairIKSE_SF_EEEEEE - (i32.add - (get_local $10) - (i32.const 16) - ) - (get_local $10) - ) - ) - (block $label$0 - (br_if $label$0 - (i32.ne - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=8 - (get_local $10) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eq - (tee_local $6 - (i32.load - (get_local $0) - ) - ) - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - (set_local $7 - (i32.load - (get_local $10) - ) - ) - (set_local $9 - (i32.const 0) - ) - (loop $label$2 - (br_if $label$0 - (i32.ne - (i32.load offset=16 - (tee_local $3 - (get_local $6) - ) - ) - (i32.load offset=16 - (tee_local $8 - (get_local $7) - ) - ) - ) - ) - (br_if $label$0 - (i32.ne - (tee_local $5 - (select - (i32.load offset=24 - (get_local $3) - ) - (tee_local $4 - (i32.shr_u - (tee_local $0 - (i32.load8_u offset=20 - (get_local $3) - ) - ) - (i32.const 1) - ) - ) - (tee_local $7 - (i32.and - (get_local $0) - (i32.const 1) - ) - ) - ) - ) - (select - (i32.load offset=24 - (get_local $8) - ) - (i32.shr_u - (tee_local $0 - (i32.load8_u offset=20 - (get_local $8) - ) - ) - (i32.const 1) - ) - (tee_local $0 - (i32.and - (get_local $0) - (i32.const 1) - ) - ) - ) - ) - ) - (set_local $0 - (select - (i32.load offset=28 - (get_local $8) - ) - (i32.add - (i32.add - (get_local $8) - (i32.const 20) - ) - (i32.const 1) - ) - (get_local $0) - ) - ) - (set_local $6 - (i32.add - (i32.add - (get_local $3) - (i32.const 20) - ) - (i32.const 1) - ) - ) - (block $label$3 - (block $label$4 - (br_if $label$4 - (get_local $7) - ) - (br_if $label$3 - (i32.eqz - (get_local $5) - ) - ) - (set_local $7 - (i32.sub - (i32.const 0) - (get_local $4) - ) - ) - (loop $label$5 - (br_if $label$0 - (i32.ne - (i32.load8_u - (get_local $6) - ) - (i32.load8_u - (get_local $0) - ) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - (br_if $label$5 - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - ) - (br $label$3) - ) - ) - (br_if $label$3 - (i32.eqz - (get_local $5) - ) - ) - (br_if $label$0 - (call $memcmp - (select - (i32.load offset=28 - (get_local $3) - ) - (get_local $6) - (get_local $7) - ) - (get_local $0) - (get_local $5) - ) - ) - ) - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.eqz - (tee_local $0 - (i32.load offset=4 - (get_local $3) - ) - ) - ) - ) - (loop $label$8 - (br_if $label$8 - (tee_local $0 - (i32.load - (tee_local $6 - (get_local $0) - ) - ) - ) - ) - (br $label$6) - ) - ) - (br_if $label$6 - (i32.eq - (i32.load - (tee_local $6 - (i32.load offset=8 - (get_local $3) - ) - ) - ) - (get_local $3) - ) - ) - (set_local $7 - (i32.add - (get_local $3) - (i32.const 8) - ) - ) - (loop $label$9 - (set_local $7 - (i32.add - (tee_local $0 - (i32.load - (get_local $7) - ) - ) - (i32.const 8) - ) - ) - (br_if $label$9 - (i32.ne - (get_local $0) - (i32.load - (tee_local $6 - (i32.load offset=8 - (get_local $0) - ) - ) - ) - ) - ) - ) - ) - (block $label$10 - (block $label$11 - (br_if $label$11 - (i32.eqz - (tee_local $0 - (i32.load offset=4 - (get_local $8) - ) - ) - ) - ) - (loop $label$12 - (br_if $label$12 - (tee_local $0 - (i32.load - (tee_local $7 - (get_local $0) - ) - ) - ) - ) - (br $label$10) - ) - ) - (br_if $label$10 - (i32.eq - (i32.load - (tee_local $7 - (i32.load offset=8 - (get_local $8) - ) - ) - ) - (get_local $8) - ) - ) - (set_local $8 - (i32.add - (get_local $8) - (i32.const 8) - ) - ) - (loop $label$13 - (set_local $8 - (i32.add - (tee_local $0 - (i32.load - (get_local $8) - ) - ) - (i32.const 8) - ) - ) - (br_if $label$13 - (i32.ne - (get_local $0) - (i32.load - (tee_local $7 - (i32.load offset=8 - (get_local $0) - ) - ) - ) - ) - ) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $6) - (get_local $2) - ) - ) - ) - ) - (set_local $9 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $9) - (get_local $1) - ) - (call $_ZNSt3__16__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE - (get_local $10) - (i32.load offset=4 - (get_local $10) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 160) - ) - ) - ) - (func $_ZNSt3__16__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE (param $0 i32) (param $1 i32) - (block $label$0 - (br_if $label$0 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZNSt3__16__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE - (get_local $0) - (i32.load - (get_local $1) - ) - ) - (call $_ZNSt3__16__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE - (get_local $0) - (i32.load offset=4 - (get_local $1) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (i32.load8_u - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $1) - (i32.const 28) - ) - ) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - ) - (func $_ZN8testtypeINSt3__15tupleIJiNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEdEEEE3runERKS8_PKc (param $0 i32) (param $1 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) - (i32.store offset=4 - (i32.const 0) - (tee_local $11 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 176) - ) - ) - ) - (i32.store offset=40 - (get_local $11) - (i32.add - (get_local $11) - (i32.const 176) - ) - ) - (i32.store offset=32 - (get_local $11) - (i32.add - (get_local $11) - (i32.const 48) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.add - (get_local $11) - (i32.const 48) - ) - (get_local $0) - (i32.const 4) - ) - ) - (i32.store offset=36 - (get_local $11) - (i32.or - (i32.add - (get_local $11) - (i32.const 48) - ) - (i32.const 4) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE - (i32.add - (get_local $11) - (i32.const 32) - ) - (tee_local $8 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load offset=40 - (get_local $11) - ) - (i32.load offset=36 - (get_local $11) - ) - ) - (i32.const 7) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load offset=36 - (get_local $11) - ) - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - (i32.const 8) - ) - ) - (i64.store - (tee_local $7 - (i32.add - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.const 8) - ) - ) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $11) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $11) - (i64.const 0) - ) - (i32.store offset=36 - (get_local $11) - (tee_local $9 - (i32.load offset=32 - (get_local $11) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=40 - (get_local $11) - ) - (get_local $9) - ) - (i32.const 3) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.load offset=36 - (get_local $11) - ) - (i32.const 4) - ) - ) - (i32.store offset=36 - (get_local $11) - (i32.add - (i32.load offset=36 - (get_local $11) - ) - (i32.const 4) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPcEEEERT_S5_RNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE - (i32.add - (get_local $11) - (i32.const 32) - ) - (tee_local $3 - (i32.or - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.const 4) - ) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=40 - (get_local $11) - ) - (i32.load offset=36 - (get_local $11) - ) - ) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.const 16) - ) - (i32.load offset=36 - (get_local $11) - ) - (i32.const 8) - ) - ) - (i32.store offset=36 - (get_local $11) - (i32.add - (i32.load offset=36 - (get_local $11) - ) - (i32.const 8) - ) - ) - (set_local $10 - (i32.const 0) - ) - (block $label$0 - (br_if $label$0 - (i32.ne - (i32.load - (get_local $0) - ) - (i32.load offset=8 - (get_local $11) - ) - ) - ) - (br_if $label$0 - (i32.ne - (tee_local $6 - (select - (i32.load - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (tee_local $5 - (i32.shr_u - (tee_local $9 - (i32.load8_u - (get_local $8) - ) - ) - (i32.const 1) - ) - ) - (tee_local $4 - (i32.and - (get_local $9) - (i32.const 1) - ) - ) - ) - ) - (select - (i32.load - (get_local $7) - ) - (i32.shr_u - (tee_local $9 - (i32.load8_u offset=12 - (get_local $11) - ) - ) - (i32.const 1) - ) - (tee_local $7 - (i32.and - (get_local $9) - (i32.const 1) - ) - ) - ) - ) - ) - (set_local $9 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (set_local $8 - (select - (i32.load - (i32.add - (i32.add - (get_local $11) - (i32.const 8) - ) - (i32.const 12) - ) - ) - (i32.add - (get_local $3) - (i32.const 1) - ) - (get_local $7) - ) - ) - (block $label$1 - (block $label$2 - (br_if $label$2 - (get_local $4) - ) - (br_if $label$1 - (i32.eqz - (get_local $6) - ) - ) - (set_local $10 - (i32.const 0) - ) - (set_local $0 - (i32.sub - (i32.const 0) - (get_local $5) - ) - ) - (loop $label$3 - (br_if $label$0 - (i32.ne - (i32.load8_u - (get_local $9) - ) - (i32.load8_u - (get_local $8) - ) - ) - ) - (set_local $8 - (i32.add - (get_local $8) - (i32.const 1) - ) - ) - (set_local $9 - (i32.add - (get_local $9) - (i32.const 1) - ) - ) - (br_if $label$3 - (tee_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - ) - (br $label$1) - ) - ) - (br_if $label$1 - (i32.eqz - (get_local $6) - ) - ) - (br_if $label$0 - (call $memcmp - (select - (i32.load - (i32.add - (get_local $0) - (i32.const 12) - ) - ) - (get_local $9) - (get_local $4) - ) - (get_local $8) - (get_local $6) - ) - ) - ) - (set_local $10 - (f64.eq - (f64.load - (get_local $2) - ) - (f64.load - (i32.add - (get_local $11) - (i32.const 24) - ) - ) - ) - ) - ) - (call $eosio_assert - (get_local $10) - (get_local $1) - ) - (block $label$4 - (br_if $label$4 - (i32.eqz - (i32.and - (i32.load8_u offset=12 - (get_local $11) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (i32.add - (get_local $11) - (i32.const 20) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $11) - (i32.const 176) - ) - ) - ) - (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 1424) - ) - (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 1424) - ) - (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 $_ZN5eosiorsINS_10datastreamIPcEEEERT_S5_RNSt3__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 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_10datastreamIPcEEEERT_S5_RNSt3__16vectorIcNS6_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 $_ZN5eosiorsINS_10datastreamIPcEEEERT_S5_RNSt3__16vectorIcNS6_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 848) - ) - (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 800) - ) - (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 $_ZN5eosiolsINS_10datastreamIPcEEiNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEERT_SC_RKNS4_3mapIT0_T1_NS4_4lessISE_EENS8_INS4_4pairIKSE_SF_EEEEEE (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) - (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 $6 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $4 - (i64.load32_u offset=8 - (get_local $1) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (set_local $5 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$0 - (set_local $7 - (i32.wrap/i64 - (get_local $4) - ) - ) - (i32.store8 offset=15 - (get_local $8) - (i32.or - (i32.shl - (tee_local $3 - (i64.ne - (tee_local $4 - (i64.shr_u - (get_local $4) - (i64.const 7) - ) - ) - (i64.const 0) - ) - ) - (i32.const 7) - ) - (i32.and - (get_local $7) - (i32.const 127) - ) - ) - ) - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $6) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (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.eq - (tee_local $7 - (i32.load - (get_local $1) - ) - ) - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$2 - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $1) - ) - (get_local $6) - ) - (i32.const 3) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.const 4) - ) - ) - (i32.store - (get_local $3) - (i32.add - (i32.load - (get_local $3) - ) - (i32.const 4) - ) - ) - (drop - (call $_ZN5eosiolsINS_10datastreamIPcEEEERT_S5_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE - (get_local $0) - (i32.add - (get_local $7) - (i32.const 20) - ) - ) - ) - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.eqz - (tee_local $6 - (i32.load offset=4 - (get_local $7) - ) - ) - ) - ) - (loop $label$5 - (br_if $label$5 - (tee_local $6 - (i32.load - (tee_local $5 - (get_local $6) - ) - ) - ) - ) - (br $label$3) - ) - ) - (br_if $label$3 - (i32.eq - (i32.load - (tee_local $5 - (i32.load offset=8 - (get_local $7) - ) - ) - ) - (get_local $7) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const 8) - ) - ) - (loop $label$6 - (set_local $7 - (i32.add - (tee_local $6 - (i32.load - (get_local $7) - ) - ) - (i32.const 8) - ) - ) - (br_if $label$6 - (i32.ne - (get_local $6) - (i32.load - (tee_local $5 - (i32.load offset=8 - (get_local $6) - ) - ) - ) - ) - ) - ) - ) - (br_if $label$1 - (i32.eq - (get_local $5) - (get_local $2) - ) - ) - (set_local $6 - (i32.load - (get_local $3) - ) - ) - (set_local $7 - (get_local $5) - ) - (br $label$2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiorsINS_10datastreamIPcEEiNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEERT_SC_RNS4_3mapIT0_T1_NS4_4lessISE_EENS8_INS4_4pairIKSE_SF_EEEEEE (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 i64) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (i32.store offset=4 - (i32.const 0) - (tee_local $13 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (call $_ZNSt3__16__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE - (get_local $1) - (i32.load offset=4 - (get_local $1) - ) - ) - (i32.store - (get_local $1) - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - (set_local $5 - (i32.const 0) - ) - (i32.store offset=8 - (get_local $1) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $1) - (i32.const 0) - ) - (set_local $6 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $10 - (i64.const 0) - ) - (set_local $9 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$0 - (call $eosio_assert - (i32.lt_u - (get_local $6) - (i32.load - (get_local $9) - ) - ) - (i32.const 848) - ) - (set_local $12 - (i32.load8_u - (tee_local $6 - (i32.load - (tee_local $7 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - ) - ) - (i32.store - (get_local $7) - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - ) - (set_local $10 - (i64.or - (i64.extend_u/i32 - (i32.shl - (i32.and - (get_local $12) - (i32.const 127) - ) - (tee_local $5 - (i32.and - (get_local $5) - (i32.const 255) - ) - ) - ) - ) - (get_local $10) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 7) - ) - ) - (br_if $label$0 - (i32.shr_u - (get_local $12) - (i32.const 7) - ) - ) - ) - (block $label$1 - (br_if $label$1 - (i32.eqz - (tee_local $3 - (i32.wrap/i64 - (get_local $10) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (set_local $11 - (i32.const 0) - ) - (loop $label$2 - (i32.store - (tee_local $8 - (i32.add - (get_local $13) - (i32.const 8) - ) - ) - (i32.const 0) - ) - (i64.store - (get_local $13) - (i64.const 0) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (get_local $6) - ) - (i32.const 3) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $13) - (i32.const 12) - ) - (i32.load - (tee_local $9 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (i32.const 4) - ) - ) - (i32.store - (get_local $9) - (i32.add - (i32.load - (get_local $9) - ) - (i32.const 4) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPcEEEERT_S5_RNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE - (get_local $0) - (get_local $13) - ) - ) - (block $label$3 - (block $label$4 - (block $label$5 - (block $label$6 - (block $label$7 - (br_if $label$7 - (i32.eqz - (tee_local $6 - (i32.load - (get_local $2) - ) - ) - ) - ) - (set_local $5 - (i32.load offset=12 - (get_local $13) - ) - ) - (set_local $7 - (get_local $4) - ) - (loop $label$8 - (block $label$9 - (block $label$10 - (br_if $label$10 - (i32.ge_s - (get_local $5) - (tee_local $12 - (i32.load offset=16 - (get_local $6) - ) - ) - ) - ) - (set_local $7 - (get_local $6) - ) - (br_if $label$9 - (tee_local $12 - (i32.load - (get_local $6) - ) - ) - ) - (br $label$6) - ) - (br_if $label$5 - (i32.ge_s - (get_local $12) - (get_local $5) - ) - ) - (set_local $7 - (i32.add - (get_local $6) - (i32.const 4) - ) - ) - (br_if $label$5 - (i32.eqz - (tee_local $12 - (i32.load offset=4 - (get_local $6) - ) - ) - ) - ) - ) - (set_local $6 - (get_local $12) - ) - (br $label$8) - ) - ) - (set_local $6 - (get_local $2) - ) - (br_if $label$3 - (i32.load - (tee_local $7 - (get_local $2) - ) - ) - ) - (br $label$4) - ) - (set_local $7 - (get_local $6) - ) - ) - (br_if $label$3 - (i32.load - (get_local $7) - ) - ) - ) - (i32.store offset=16 - (tee_local $12 - (call $_Znwj - (i32.const 32) - ) - ) - (i32.load offset=12 - (get_local $13) - ) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 28) - ) - (i32.load - (get_local $8) - ) - ) - (i32.store - (i32.add - (get_local $12) - (i32.const 24) - ) - (i32.load offset=4 - (get_local $13) - ) - ) - (i32.store offset=20 - (get_local $12) - (i32.load - (get_local $13) - ) - ) - (i32.store - (get_local $13) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $13) - (i32.const 0) - ) - (i32.store - (get_local $8) - (i32.const 0) - ) - (i32.store - (get_local $12) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $12) - (i32.const 0) - ) - (i32.store offset=8 - (get_local $12) - (get_local $6) - ) - (i32.store - (get_local $7) - (get_local $12) - ) - (block $label$11 - (br_if $label$11 - (i32.eqz - (tee_local $6 - (i32.load - (i32.load - (get_local $1) - ) - ) - ) - ) - ) - (i32.store - (get_local $1) - (get_local $6) - ) - (set_local $12 - (i32.load - (get_local $7) - ) - ) - ) - (call $_ZNSt3__127__tree_balance_after_insertIPNS_16__tree_node_baseIPvEEEEvT_S5_ - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (get_local $12) - ) - (i32.store - (tee_local $6 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - (i32.add - (i32.load - (get_local $6) - ) - (i32.const 1) - ) - ) - ) - (block $label$12 - (br_if $label$12 - (i32.eqz - (i32.and - (i32.load8_u - (get_local $13) - ) - (i32.const 1) - ) - ) - ) - (call $_ZdlPv - (i32.load - (get_local $8) - ) - ) - ) - (br_if $label$1 - (i32.eq - (tee_local $11 - (i32.add - (get_local $11) - (i32.const 1) - ) - ) - (get_local $3) - ) - ) - (set_local $6 - (i32.load - (get_local $9) - ) - ) - (br $label$2) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $13) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiolsINS_10datastreamIPcEEiEERT_S5_RKNSt3__16vectorIT0_NS6_9allocatorIS8_EEEE (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) - (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 $6 - (i64.extend_u/i32 - (i32.shr_s - (i32.sub - (i32.load offset=4 - (get_local $1) - ) - (i32.load - (get_local $1) - ) - ) - (i32.const 2) - ) - ) - ) - (set_local $7 - (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 $6) - ) - ) - (i32.store8 offset=15 - (get_local $8) - (i32.or - (i32.shl - (tee_local $3 - (i64.ne - (tee_local $6 - (i64.shr_u - (get_local $6) - (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 $7) - ) - (i32.const 0) - ) - (i32.const 1424) - ) - (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 $7 - (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.eq - (tee_local $5 - (i32.load - (get_local $1) - ) - ) - (tee_local $3 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$2 - (call $eosio_assert - (i32.gt_s - (i32.sub - (i32.load - (get_local $4) - ) - (get_local $7) - ) - (i32.const 3) - ) - (i32.const 1424) - ) - (drop - (call $memcpy - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (get_local $5) - (i32.const 4) - ) - ) - (i32.store - (get_local $2) - (tee_local $7 - (i32.add - (i32.load - (get_local $2) - ) - (i32.const 4) - ) - ) - ) - (br_if $label$2 - (i32.ne - (get_local $3) - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 4) - ) - ) - ) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $8) - (i32.const 16) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiorsINS_10datastreamIPcEEiEERT_S5_RNSt3__16vectorIT0_NS6_9allocatorIS8_EEEE (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 848) - ) - (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 - (block $label$3 - (br_if $label$3 - (i32.le_u - (tee_local $5 - (i32.wrap/i64 - (get_local $6) - ) - ) - (tee_local $7 - (i32.shr_s - (i32.sub - (tee_local $3 - (i32.load offset=4 - (get_local $1) - ) - ) - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - ) - (i32.const 2) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIiNS_9allocatorIiEEE8__appendEj - (get_local $1) - (i32.sub - (get_local $5) - (get_local $7) - ) - ) - (br_if $label$2 - (i32.ne - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - (tee_local $3 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - ) - (br $label$1) - ) - (block $label$4 - (br_if $label$4 - (i32.ge_u - (get_local $5) - (get_local $7) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (tee_local $3 - (i32.add - (get_local $4) - (i32.shl - (get_local $5) - (i32.const 2) - ) - ) - ) - ) - ) - (br_if $label$1 - (i32.eq - (get_local $4) - (get_local $3) - ) - ) - ) - (set_local $7 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$5 - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (get_local $2) - ) - (get_local $7) - ) - (i32.const 3) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $4) - (i32.load - (get_local $5) - ) - (i32.const 4) - ) - ) - (i32.store - (get_local $5) - (tee_local $7 - (i32.add - (i32.load - (get_local $5) - ) - (i32.const 4) - ) - ) - ) - (br_if $label$5 - (i32.ne - (get_local $3) - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 4) - ) - ) - ) - ) - ) - ) - (get_local $0) - ) - (func $_ZNSt3__16vectorIiNS_9allocatorIiEEE8__appendEj (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 - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.ge_u - (i32.shr_s - (i32.sub - (tee_local $7 - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $2 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (i32.const 2) - ) - (get_local $1) - ) - ) - (br_if $label$2 - (i32.ge_u - (tee_local $2 - (i32.add - (tee_local $4 - (i32.shr_s - (i32.sub - (get_local $2) - (tee_local $3 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 2) - ) - ) - (get_local $1) - ) - ) - (i32.const 1073741824) - ) - ) - (set_local $6 - (i32.const 1073741823) - ) - (block $label$5 - (br_if $label$5 - (i32.gt_u - (i32.shr_s - (tee_local $7 - (i32.sub - (get_local $7) - (get_local $3) - ) - ) - (i32.const 2) - ) - (i32.const 536870910) - ) - ) - (br_if $label$3 - (i32.eqz - (tee_local $6 - (select - (get_local $2) - (tee_local $6 - (i32.shr_s - (get_local $7) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $6) - (get_local $2) - ) - ) - ) - ) - ) - (br_if $label$1 - (i32.ge_u - (get_local $6) - (i32.const 1073741824) - ) - ) - ) - (set_local $7 - (call $_Znwj - (i32.shl - (get_local $6) - (i32.const 2) - ) - ) - ) - (br $label$0) - ) - (set_local $6 - (get_local $2) - ) - (set_local $7 - (get_local $1) - ) - (loop $label$6 - (i32.store - (get_local $6) - (i32.const 0) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 4) - ) - ) - (br_if $label$6 - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (i32.add - (get_local $2) - (i32.shl - (get_local $1) - (i32.const 2) - ) - ) - ) - (return) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $7 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (call $abort) - (unreachable) - ) - (set_local $3 - (i32.add - (get_local $7) - (i32.shl - (get_local $6) - (i32.const 2) - ) - ) - ) - (set_local $6 - (tee_local $2 - (i32.add - (get_local $7) - (i32.shl - (get_local $4) - (i32.const 2) - ) - ) - ) - ) - (set_local $7 - (get_local $1) - ) - (loop $label$7 - (i32.store - (get_local $6) - (i32.const 0) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 4) - ) - ) - (br_if $label$7 - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -1) - ) - ) - ) - ) - (set_local $4 - (i32.add - (get_local $2) - (i32.shl - (get_local $1) - (i32.const 2) - ) - ) - ) - (set_local $1 - (i32.sub - (get_local $2) - (tee_local $7 - (i32.sub - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $6 - (i32.load - (get_local $0) - ) - ) - ) - ) - ) - ) - (block $label$8 - (br_if $label$8 - (i32.lt_s - (get_local $7) - (i32.const 1) - ) - ) - (drop - (call $memcpy - (get_local $1) - (get_local $6) - (get_local $7) - ) - ) - (set_local $6 - (i32.load - (get_local $0) - ) - ) - ) - (i32.store - (get_local $0) - (get_local $1) - ) - (i32.store - (get_local $5) - (get_local $4) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $3) - ) - (block $label$9 - (br_if $label$9 - (i32.eqz - (get_local $6) - ) - ) - (call $_ZdlPv - (get_local $6) - ) - ) - ) - (func $apply (param $0 i64) (param $1 i64) (param $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i64) - (local $8 i64) - (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 384) - ) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 18944) - ) - (set_local $8 - (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 $7) - (i64.const 4) - ) - ) - (br_if $label$4 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $5) - ) - ) - (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 $9 - (i64.const 0) - ) - (br_if $label$2 - (i64.le_u - (get_local $7) - (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 $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$0 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (block $label$6 - (block $label$7 - (block $label$8 - (block $label$9 - (br_if $label$9 - (i64.ne - (get_local $8) - (get_local $1) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 18960) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$10 - (block $label$11 - (block $label$12 - (block $label$13 - (block $label$14 - (block $label$15 - (br_if $label$15 - (i64.gt_u - (get_local $7) - (i64.const 6) - ) - ) - (br_if $label$14 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$13) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$12 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$11) - ) - (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 $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$10 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (br_if $label$9 - (i64.ne - (get_local $8) - (get_local $2) - ) - ) - (call $_ZN5eosio18unpack_action_dataINS_7onerrorEEET_v - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - (call $prints - (i32.const 18976) - ) - (set_local $3 - (i32.load - (i32.add - (get_local $10) - (i32.const 52) - ) - ) - ) - (set_local $5 - (i32.load offset=48 - (get_local $10) - ) - ) - (set_local $7 - (call $current_time) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 236) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 240) - ) - (i32.const 0) - ) - (i32.store offset=220 - (get_local $10) - (i32.const 0) - ) - (i32.store8 offset=224 - (get_local $10) - (i32.const 0) - ) - (i32.store offset=228 - (get_local $10) - (i32.const 0) - ) - (i32.store offset=232 - (get_local $10) - (i32.const 0) - ) - (i32.store offset=208 - (get_local $10) - (i32.add - (i32.wrap/i64 - (i64.div_u - (get_local $7) - (i64.const 1000000) - ) - ) - (i32.const 60) - ) - ) - (i32.store offset=244 - (get_local $10) - (i32.const 0) - ) - (i32.store - (tee_local $4 - (i32.add - (get_local $10) - (i32.const 248) - ) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 252) - ) - (i32.const 0) - ) - (i32.store offset=256 - (get_local $10) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 260) - ) - (i32.const 0) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 264) - ) - (i32.const 0) - ) - (i32.store offset=20 - (get_local $10) - (get_local $5) - ) - (i32.store offset=16 - (get_local $10) - (get_local $5) - ) - (i32.store offset=24 - (get_local $10) - (get_local $3) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_18transaction_headerE - (i32.add - (get_local $10) - (i32.const 16) - ) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEENSt3__15tupleIJtNS5_6vectorIcNS5_9allocatorIcEEEEEEEEERT_SD_RNS7_IT0_NS8_ISE_EEEE - (call $_ZN5eosiorsINS_10datastreamIPKcEENS_6actionEEERT_S7_RNSt3__16vectorIT0_NS8_9allocatorISA_EEEE - (call $_ZN5eosiorsINS_10datastreamIPKcEENS_6actionEEERT_S7_RNSt3__16vectorIT0_NS8_9allocatorISA_EEEE - (i32.add - (get_local $10) - (i32.const 16) - ) - (i32.add - (get_local $10) - (i32.const 232) - ) - ) - (tee_local $3 - (i32.add - (get_local $10) - (i32.const 244) - ) - ) - ) - (i32.add - (get_local $10) - (i32.const 256) - ) - ) - ) - (br_if $label$8 - (i32.eq - (i32.load - (get_local $4) - ) - (tee_local $5 - (i32.load offset=244 - (get_local $10) - ) - ) - ) - ) - (block $label$16 - (br_if $label$16 - (i64.ne - (i64.load offset=8 - (get_local $5) - ) - (i64.const -8665432478290165179) - ) - ) - (call $_ZN16test_transaction26assert_false_error_handlerERKN5eosio11transactionE - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - ) - (drop - (call $_ZN5eosio11transactionD2Ev - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - ) - (br_if $label$6 - (i32.eqz - (tee_local $5 - (i32.load - (i32.add - (get_local $10) - (i32.const 48) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $10) - (i32.const 52) - ) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - (br $label$6) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 1440) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$17 - (block $label$18 - (block $label$19 - (block $label$20 - (block $label$21 - (block $label$22 - (br_if $label$22 - (i64.gt_u - (get_local $7) - (i64.const 8) - ) - ) - (br_if $label$21 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$20) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$19 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$18) - ) - (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 $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$17 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (block $label$23 - (br_if $label$23 - (i64.ne - (get_local $8) - (get_local $2) - ) - ) - (call $_ZN11test_action14test_cf_actionEv) - (br $label$6) - ) - (block $label$24 - (block $label$25 - (br_if $label$25 - (i64.eq - (get_local $2) - (i64.const -8665432478235101900) - ) - ) - (br_if $label$7 - (i64.eq - (get_local $2) - (i64.const -696013500020145514) - ) - ) - (br_if $label$24 - (i64.ne - (get_local $2) - (i64.const -696013499845391606) - ) - ) - (br $label$7) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1600) - ) - (br $label$6) - ) - (call $require_auth - (get_local $1) - ) - (block $label$26 - (block $label$27 - (block $label$28 - (block $label$29 - (block $label$30 - (block $label$31 - (block $label$32 - (block $label$33 - (block $label$34 - (block $label$35 - (block $label$36 - (block $label$37 - (block $label$38 - (block $label$39 - (block $label$40 - (block $label$41 - (block $label$42 - (block $label$43 - (block $label$44 - (block $label$45 - (block $label$46 - (block $label$47 - (block $label$48 - (block $label$49 - (block $label$50 - (block $label$51 - (block $label$52 - (block $label$53 - (br_if $label$53 - (i64.gt_s - (get_local $2) - (i64.const -6575469300789510042) - ) - ) - (br_if $label$52 - (i64.gt_s - (get_local $2) - (i64.const -8665432477288202419) - ) - ) - (br_if $label$50 - (i64.gt_s - (get_local $2) - (i64.const -8665432478290165180) - ) - ) - (br_if $label$46 - (i64.gt_s - (get_local $2) - (i64.const -8665432478739662526) - ) - ) - (br_if $label$41 - (i64.eq - (get_local $2) - (i64.const -8665432479170847876) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -8665432478848840241) - ) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 0) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 1632) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=208 - (get_local $10) - ) - (call $current_time) - ) - (i32.const 1744) - ) - (br $label$6) - ) - (br_if $label$51 - (i64.gt_s - (get_local $2) - (i64.const -6575469299402901114) - ) - ) - (br_if $label$49 - (i64.le_s - (get_local $2) - (i64.const -6575469300549176619) - ) - ) - (br_if $label$45 - (i64.gt_s - (get_local $2) - (i64.const -6575469299641207703) - ) - ) - (br_if $label$40 - (i64.eq - (get_local $2) - (i64.const -6575469300549176618) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -6575469300234199047) - ) - ) - (call $_ZN22test_compiler_builtins11test_divti3Ev) - (br $label$6) - ) - (br_if $label$48 - (i64.le_s - (get_local $2) - (i64.const -8665432476325739330) - ) - ) - (br_if $label$44 - (i64.gt_s - (get_local $2) - (i64.const -6575469302011795920) - ) - ) - (br_if $label$39 - (i64.eq - (get_local $2) - (i64.const -8665432476325739329) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -6575469302268922734) - ) - ) - (i64.store offset=216 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 0) - ) - (call $__divti3 - (i32.add - (get_local $10) - (i32.const 208) - ) - (i64.const 100) - (i64.const 0) - (i64.const 0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6544) - ) - (br $label$6) - ) - (br_if $label$47 - (i64.le_s - (get_local $2) - (i64.const -5790280401120060142) - ) - ) - (br_if $label$43 - (i64.gt_s - (get_local $2) - (i64.const -5790280400999598625) - ) - ) - (br_if $label$38 - (i64.eq - (get_local $2) - (i64.const -5790280401120060141) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -5790280401000535180) - ) - ) - (call $_ZN10test_types10types_sizeEv) - (br $label$6) - ) - (br_if $label$42 - (i64.gt_s - (get_local $2) - (i64.const -8665432477679290203) - ) - ) - (br_if $label$37 - (i64.eq - (get_local $2) - (i64.const -8665432478290165179) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -8665432478272688454) - ) - ) - (call $_ZN11test_action18read_action_normalEv) - (br $label$6) - ) - (br_if $label$36 - (i64.eq - (get_local $2) - (i64.const -6575469300789510041) - ) - ) - (br_if $label$35 - (i64.eq - (get_local $2) - (i64.const -6575469300788910535) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -6575469300561148988) - ) - ) - (call $_ZN22test_compiler_builtins11test_modti3Ev) - (br $label$6) - ) - (br_if $label$34 - (i64.eq - (get_local $2) - (i64.const -8665432477288202418) - ) - ) - (br_if $label$33 - (i64.eq - (get_local $2) - (i64.const -8665432477185147987) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -8665432476560123846) - ) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 0) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 1632) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=208 - (get_local $10) - ) - (call $publication_time) - ) - (i32.const 1664) - ) - (br $label$6) - ) - (br_if $label$32 - (i64.eq - (get_local $2) - (i64.const -6575469299402901113) - ) - ) - (br_if $label$31 - (i64.eq - (get_local $2) - (i64.const -6575469299349951025) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -6575469299199638822) - ) - ) - (i64.store offset=216 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 0) - ) - (call $__umodti3 - (i32.add - (get_local $10) - (i32.const 208) - ) - (i64.const 100) - (i64.const 0) - (i64.const 0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 7776) - ) - (br $label$6) - ) - (br_if $label$30 - (i64.eq - (get_local $2) - (i64.const -8665432478739662525) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -8665432478353100899) - ) - ) - (drop - (call $read_action_data - (i32.const 0) - (call $action_data_size) - ) - ) - (br $label$6) - ) - (br_if $label$29 - (i64.eq - (get_local $2) - (i64.const -6575469299641207702) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -6575469299640583116) - ) - ) - (call $_ZN22test_compiler_builtins12test_ashlti3Ev) - (br $label$6) - ) - (br_if $label$28 - (i64.eq - (get_local $2) - (i64.const -6575469302011795919) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -6575469301755127924) - ) - ) - (call $_ZN22test_compiler_builtins12test_udivti3Ev) - (br $label$6) - ) - (br_if $label$27 - (i64.eq - (get_local $2) - (i64.const -5790280400999598624) - ) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -5790280398527684980) - ) - ) - (call $_ZN10test_types14string_to_nameEv) - (br $label$6) - ) - (br_if $label$26 - (i64.ne - (get_local $2) - (i64.const -8665432477579625276) - ) - ) - (drop - (call $read_action_data - (i32.const 65534) - (call $action_data_size) - ) - ) - (br $label$6) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 0) - ) - (call $eosio_assert - (i32.eq - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 8) - ) - (i32.const 8) - ) - (i32.const 1632) - ) - (call $eosio_assert_code - (i32.const 0) - (i64.load offset=208 - (get_local $10) - ) - ) - (br $label$6) - ) - (call $_ZN22test_compiler_builtins11test_multi3Ev) - (br $label$6) - ) - (call $_ZN11test_action12require_authEv) - (br $label$6) - ) - (call $_ZN10test_types10name_classEv) - (br $label$6) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 1568) - ) - (br $label$6) - ) - (call $_ZN22test_compiler_builtins12test_lshrti3Ev) - (br $label$6) - ) - (call $_ZN22test_compiler_builtins12test_lshlti3Ev) - (br $label$6) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 1600) - ) - (br $label$6) - ) - (call $_ZN11test_action14require_noticeEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (i64.store offset=216 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 0) - ) - (call $__udivti3 - (i32.add - (get_local $10) - (i32.const 208) - ) - (i64.const 100) - (i64.const 0) - (i64.const 0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6544) - ) - (br $label$6) - ) - (i64.store offset=216 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 0) - ) - (call $__modti3 - (i32.add - (get_local $10) - (i32.const 208) - ) - (i64.const 100) - (i64.const 0) - (i64.const 0) - (i64.const 0) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 7776) - ) - (br $label$6) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 8) - ) - ) - (call $eosio_assert - (i64.eq - (i64.load offset=208 - (get_local $10) - ) - (get_local $0) - ) - (i32.const 1696) - ) - (br $label$6) - ) - (call $_ZN22test_compiler_builtins12test_ashrti3Ev) - (br $label$6) - ) - (call $_ZN22test_compiler_builtins12test_umodti3Ev) - (br $label$6) - ) - (call $_ZN10test_types14char_to_symbolEv) - (br $label$6) - ) - (br_if $label$7 - (i64.ne - (get_local $2) - (i64.const -8665432477679290202) - ) - ) - (call $abort) - (unreachable) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv - (get_local $3) - ) - (unreachable) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $9 - (i64.const 59) - ) - (set_local $5 - (i32.const 752) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$54 - (set_local $6 - (i64.const 0) - ) - (block $label$55 - (br_if $label$55 - (i64.gt_u - (get_local $7) - (i64.const 11) - ) - ) - (block $label$56 - (block $label$57 - (br_if $label$57 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$56) - ) - (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 $6 - (i64.shl - (i64.extend_u/i32 - (i32.and - (get_local $3) - (i32.const 31) - ) - ) - (i64.and - (get_local $9) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $6) - (get_local $8) - ) - ) - (br_if $label$54 - (i64.ne - (tee_local $9 - (i64.add - (get_local $9) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (block $label$58 - (br_if $label$58 - (i64.ne - (get_local $8) - (get_local $2) - ) - ) - (call $_ZN11test_action17test_dummy_actionEv) - (br $label$6) - ) - (block $label$59 - (block $label$60 - (block $label$61 - (block $label$62 - (block $label$63 - (block $label$64 - (block $label$65 - (block $label$66 - (block $label$67 - (block $label$68 - (block $label$69 - (block $label$70 - (block $label$71 - (block $label$72 - (block $label$73 - (block $label$74 - (block $label$75 - (block $label$76 - (block $label$77 - (block $label$78 - (block $label$79 - (block $label$80 - (block $label$81 - (block $label$82 - (block $label$83 - (block $label$84 - (block $label$85 - (block $label$86 - (block $label$87 - (block $label$88 - (block $label$89 - (block $label$90 - (block $label$91 - (block $label$92 - (block $label$93 - (block $label$94 - (block $label$95 - (block $label$96 - (block $label$97 - (block $label$98 - (block $label$99 - (block $label$100 - (block $label$101 - (block $label$102 - (block $label$103 - (block $label$104 - (block $label$105 - (block $label$106 - (block $label$107 - (block $label$108 - (block $label$109 - (block $label$110 - (block $label$111 - (block $label$112 - (block $label$113 - (block $label$114 - (block $label$115 - (block $label$116 - (block $label$117 - (block $label$118 - (block $label$119 - (block $label$120 - (block $label$121 - (block $label$122 - (block $label$123 - (block $label$124 - (block $label$125 - (block $label$126 - (block $label$127 - (block $label$128 - (block $label$129 - (block $label$130 - (block $label$131 - (block $label$132 - (block $label$133 - (block $label$134 - (block $label$135 - (br_if $label$135 - (i64.le_s - (get_local $2) - (i64.const -5767735918449313230) - ) - ) - (br_if $label$134 - (i64.le_s - (get_local $2) - (i64.const -696013502478964675) - ) - ) - (br_if $label$132 - (i64.gt_s - (get_local $2) - (i64.const -696013501204331988) - ) - ) - (br_if $label$128 - (i64.gt_s - (get_local $2) - (i64.const -696013502015841439) - ) - ) - (br_if $label$120 - (i64.le_s - (get_local $2) - (i64.const -696013502305735711) - ) - ) - (br_if $label$104 - (i64.eq - (get_local $2) - (i64.const -696013502305735710) - ) - ) - (br_if $label$103 - (i64.eq - (get_local $2) - (i64.const -696013502197092929) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013502194763679) - ) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 18400) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$136 - (block $label$137 - (block $label$138 - (block $label$139 - (block $label$140 - (block $label$141 - (br_if $label$141 - (i64.gt_u - (get_local $7) - (i64.const 9) - ) - ) - (br_if $label$140 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$139) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$138 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$137) - ) - (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 $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$136 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $activate_feature - (get_local $8) - ) - (br $label$6) - ) - (br_if $label$133 - (i64.gt_s - (get_local $2) - (i64.const -7587351443459632866) - ) - ) - (br_if $label$131 - (i64.le_s - (get_local $2) - (i64.const -7587351445379665367) - ) - ) - (br_if $label$127 - (i64.gt_s - (get_local $2) - (i64.const -7587351443887725216) - ) - ) - (br_if $label$119 - (i64.le_s - (get_local $2) - (i64.const -7587351445310893856) - ) - ) - (br_if $label$102 - (i64.eq - (get_local $2) - (i64.const -7587351445310893855) - ) - ) - (br_if $label$101 - (i64.eq - (get_local $2) - (i64.const -7587351445208375855) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7587351444330131777) - ) - ) - (set_local $3 - (i32.const 0) - ) - (call $sha256 - (i32.const 8960) - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$142 - (loop $label$143 - (br_if $label$142 - (i32.ne - (i32.load8_u - (i32.add - (get_local $5) - (i32.const 9024) - ) - ) - (i32.load8_u - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (get_local $5) - ) - ) - ) - ) - (br_if $label$143 - (i32.le_u - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $3 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $3) - (i32.const 9056) - ) - (br $label$6) - ) - (br_if $label$130 - (i64.le_s - (get_local $2) - (i64.const -4239006003814146663) - ) - ) - (br_if $label$126 - (i64.gt_s - (get_local $2) - (i64.const -696013503128813882) - ) - ) - (br_if $label$118 - (i64.le_s - (get_local $2) - (i64.const -4239006002805448792) - ) - ) - (br_if $label$100 - (i64.eq - (get_local $2) - (i64.const -4239006002805448791) - ) - ) - (br_if $label$99 - (i64.eq - (get_local $2) - (i64.const -696013503327366014) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013503202962952) - ) - ) - (i64.store offset=216 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=208 - (get_local $10) - (i64.const -1) - ) - (call $eosio_assert - (i32.ne - (call $cancel_deferred - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (i32.const 0) - ) - (i32.const 18128) - ) - (br $label$6) - ) - (br_if $label$129 - (i64.le_s - (get_local $2) - (i64.const -7078304395291034138) - ) - ) - (br_if $label$125 - (i64.gt_s - (get_local $2) - (i64.const -5767735919218491074) - ) - ) - (br_if $label$117 - (i64.le_s - (get_local $2) - (i64.const -5767735919218491584) - ) - ) - (br_if $label$98 - (i64.eq - (get_local $2) - (i64.const -5767735919218491583) - ) - ) - (br_if $label$97 - (i64.eq - (get_local $2) - (i64.const -5767735919218491512) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -5767735919218491446) - ) - ) - (i64.store offset=216 - (get_local $10) - (i64.const 4611123068473966592) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=40 - (get_local $10) - (i64.const -4611439727822766080) - ) - (i64.store offset=32 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $10) - (i64.const 4605605624503281953) - ) - (i64.store offset=16 - (get_local $10) - (i64.const 1865728291273748996) - ) - (call $printqf - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printqf - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printqf - (i32.add - (get_local $10) - (i32.const 16) - ) - ) - (call $prints - (i32.const 1824) - ) - (br $label$6) - ) - (br_if $label$124 - (i64.gt_s - (get_local $2) - (i64.const -696013500238724021) - ) - ) - (br_if $label$116 - (i64.le_s - (get_local $2) - (i64.const -696013501027893081) - ) - ) - (br_if $label$96 - (i64.eq - (get_local $2) - (i64.const -696013501027893080) - ) - ) - (br_if $label$95 - (i64.eq - (get_local $2) - (i64.const -696013500328286318) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013500268167086) - ) - ) - (i32.store offset=208 - (get_local $10) - (i32.const 0) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 4) - ) - ) - (set_local $5 - (call $transaction_size) - ) - (call $prints - (i32.const 17648) - ) - (call $printui - (i64.extend_u/i32 - (get_local $5) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=208 - (get_local $10) - ) - (call $transaction_size) - ) - (i32.const 17664) - ) - (br $label$6) - ) - (br_if $label$123 - (i64.le_s - (get_local $2) - (i64.const -8022470633028214611) - ) - ) - (br_if $label$115 - (i64.le_s - (get_local $2) - (i64.const -7587351446419414473) - ) - ) - (br_if $label$94 - (i64.eq - (get_local $2) - (i64.const -7587351446419414472) - ) - ) - (br_if $label$93 - (i64.eq - (get_local $2) - (i64.const -7587351446368672234) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7587351445800925699) - ) - ) - (call $sha512 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha512 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha512 - (i32.const 7904) - (i32.const 56) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha512 - (i32.const 7904) - (i32.const 56) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha512 - (i32.const 8016) - (i32.const 112) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha512 - (i32.const 8016) - (i32.const 112) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha512 - (i32.const 8192) - (i32.const 14) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha512 - (i32.const 8192) - (i32.const 14) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (br_if $label$122 - (i64.le_s - (get_local $2) - (i64.const -4239006005939931649) - ) - ) - (br_if $label$114 - (i64.le_s - (get_local $2) - (i64.const -4239006005058986438) - ) - ) - (br_if $label$92 - (i64.eq - (get_local $2) - (i64.const -4239006005058986437) - ) - ) - (br_if $label$91 - (i64.eq - (get_local $2) - (i64.const -4239006004389140451) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -4239006003864401096) - ) - ) - (call $printi - (i64.const 49995000) - ) - (br $label$6) - ) - (br_if $label$121 - (i64.le_s - (get_local $2) - (i64.const -7587351442891060093) - ) - ) - (br_if $label$113 - (i64.le_s - (get_local $2) - (i64.const -7587351442575377031) - ) - ) - (br_if $label$90 - (i64.eq - (get_local $2) - (i64.const -7587351442575377030) - ) - ) - (br_if $label$89 - (i64.eq - (get_local $2) - (i64.const -7078304397416668495) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7078304396558272662) - ) - ) - (call $_ZN5eosio18unpack_action_dataI29test_permission_last_used_msgEET_v - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $eosio_assert - (i64.eq - (call $get_permission_last_used - (i64.load offset=208 - (get_local $10) - ) - (i64.load offset=216 - (get_local $10) - ) - ) - (i64.load offset=224 - (get_local $10) - ) - ) - (i32.const 18464) - ) - (br $label$6) - ) - (br_if $label$112 - (i64.le_s - (get_local $2) - (i64.const -696013501554943132) - ) - ) - (br_if $label$88 - (i64.eq - (get_local $2) - (i64.const -696013501554943131) - ) - ) - (br_if $label$87 - (i64.eq - (get_local $2) - (i64.const -696013501453266856) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013501288626511) - ) - ) - (call $_ZN16test_transaction32send_deferred_tx_with_dtt_actionEv) - (br $label$6) - ) - (br_if $label$111 - (i64.le_s - (get_local $2) - (i64.const -7587351443763769797) - ) - ) - (br_if $label$86 - (i64.eq - (get_local $2) - (i64.const -7587351443763769796) - ) - ) - (br_if $label$85 - (i64.eq - (get_local $2) - (i64.const -7587351443732945056) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7587351443732941913) - ) - ) - (call $_ZN11test_crypto11test_sha256Ev) - (br $label$6) - ) - (br_if $label$110 - (i64.le_s - (get_local $2) - (i64.const -696013502719373095) - ) - ) - (br_if $label$84 - (i64.eq - (get_local $2) - (i64.const -696013502719373094) - ) - ) - (br_if $label$83 - (i64.eq - (get_local $2) - (i64.const -696013502690195168) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013502688730040) - ) - ) - (call $_ZN16test_transaction22send_transaction_emptyEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (br_if $label$109 - (i64.le_s - (get_local $2) - (i64.const -5767735918831569476) - ) - ) - (br_if $label$82 - (i64.eq - (get_local $2) - (i64.const -5767735918831569475) - ) - ) - (br_if $label$81 - (i64.eq - (get_local $2) - (i64.const -5767735918500807270) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -5767735918449313234) - ) - ) - (call $prints - (i32.const 1776) - ) - (call $prints - (i32.const 0) - ) - (call $prints - (i32.const 1792) - ) - (call $prints - (i32.const 0) - ) - (call $prints - (i32.const 1808) - ) - (call $prints - (i32.const 0) - ) - (br $label$6) - ) - (br_if $label$108 - (i64.le_s - (get_local $2) - (i64.const -696013499845391607) - ) - ) - (br_if $label$80 - (i64.eq - (get_local $2) - (i64.const -696013499845391606) - ) - ) - (br_if $label$79 - (i64.eq - (get_local $2) - (i64.const -696013499608977787) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -187209993639507722) - ) - ) - (call $_ZN15test_datastream10test_basicEv) - (br $label$6) - ) - (br_if $label$107 - (i64.gt_s - (get_local $2) - (i64.const -8022470633505015025) - ) - ) - (br_if $label$78 - (i64.eq - (get_local $2) - (i64.const -8022470634635220200) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -8022470633818130162) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5888) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5952) - ) - (br $label$6) - ) - (br_if $label$106 - (i64.gt_s - (get_local $2) - (i64.const -4239006006334808644) - ) - ) - (br_if $label$77 - (i64.eq - (get_local $2) - (i64.const -5767735918449313229) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -5767735918449313228) - ) - ) - (call $printi - (i64.const 0) - ) - (call $printi - (i64.const 556644) - ) - (call $printi - (i64.const -1) - ) - (br $label$6) - ) - (br_if $label$105 - (i64.gt_s - (get_local $2) - (i64.const -7587351443299599511) - ) - ) - (br_if $label$76 - (i64.eq - (get_local $2) - (i64.const -7587351443459632865) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7587351443325747446) - ) - ) - (call $ripemd160 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (i32.store8 offset=208 - (get_local $10) - (i32.xor - (i32.load8_u offset=208 - (get_local $10) - ) - (i32.const -1) - ) - ) - (call $assert_ripemd160 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 9200) - ) - (br $label$6) - ) - (br_if $label$75 - (i64.eq - (get_local $2) - (i64.const -696013502478964674) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013502330537453) - ) - ) - (call $_ZN16test_transaction23send_action_inline_failEv) - (br $label$6) - ) - (br_if $label$74 - (i64.eq - (get_local $2) - (i64.const -7587351445379665366) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7587351445375451046) - ) - ) - (call $sha256 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha256 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha256 - (i32.const 7904) - (i32.const 56) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha256 - (i32.const 7904) - (i32.const 56) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha256 - (i32.const 8016) - (i32.const 112) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha256 - (i32.const 8016) - (i32.const 112) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha256 - (i32.const 8192) - (i32.const 14) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha256 - (i32.const 8192) - (i32.const 14) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (br_if $label$73 - (i64.eq - (get_local $2) - (i64.const -4239006003814146662) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -4239006002882681946) - ) - ) - (call $ripemd160 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (br_if $label$72 - (i64.eq - (get_local $2) - (i64.const -7078304395291034137) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -5823726059754506790) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 169) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load8_u offset=208 - (get_local $10) - ) - (i32.const 21) - ) - (i32.const 9232) - ) - (set_local $5 - (i32.const 1) - ) - (drop - (call $get_active_producers - (i32.or - (i32.add - (get_local $10) - (i32.const 32) - ) - (i32.const 1) - ) - (i32.const 168) - ) - ) - (loop $label$144 - (call $eosio_assert - (i64.eq - (i64.load align=1 - (i32.add - (i32.add - (get_local $10) - (i32.const 32) - ) - (get_local $5) - ) - ) - (i64.load align=1 - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (get_local $5) - ) - ) - ) - (i32.const 9264) - ) - (br_if $label$144 - (i32.ne - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 8) - ) - ) - (i32.const 169) - ) - ) - (br $label$6) - ) - ) - (br_if $label$71 - (i64.eq - (get_local $2) - (i64.const -696013501204331987) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013501174438164) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=208 - (get_local $10) - ) - (call $tapos_block_prefix) - ) - (i32.const 17536) - ) - (br $label$6) - ) - (br_if $label$70 - (i64.eq - (get_local $2) - (i64.const -8022470633028214610) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -8022470632789685404) - ) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5232) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5312) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5376) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5440) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5504) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5568) - ) - (br $label$6) - ) - (br_if $label$69 - (i64.eq - (get_local $2) - (i64.const -4239006005939931648) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -4239006005769928793) - ) - ) - (call $assert_sha512 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (br_if $label$68 - (i64.eq - (get_local $2) - (i64.const -7587351442891060092) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7587351442863559481) - ) - ) - (call $_ZN11test_crypto9test_sha1Ev) - (br $label$6) - ) - (br_if $label$67 - (i64.eq - (get_local $2) - (i64.const -696013502015841438) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013501581368598) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 4) - ) - ) - (call $eosio_assert - (i32.eq - (i32.load offset=208 - (get_local $10) - ) - (call $tapos_block_num) - ) - (i32.const 17584) - ) - (br $label$6) - ) - (br_if $label$66 - (i64.eq - (get_local $2) - (i64.const -7587351443887725215) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7587351443788808834) - ) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 144) - ) - ) - (drop - (call $recover_key - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 66) - ) - (i32.const 66) - (i32.add - (get_local $10) - (i32.const 32) - ) - (i32.const 34) - ) - ) - (set_local $3 - (i32.add - (get_local $10) - (i32.const 240) - ) - ) - (set_local $5 - (i32.const 0) - ) - (loop $label$145 - (block $label$146 - (br_if $label$146 - (i32.eq - (i32.load8_u - (i32.add - (i32.add - (get_local $10) - (i32.const 32) - ) - (get_local $5) - ) - ) - (i32.load8_u - (i32.add - (get_local $3) - (get_local $5) - ) - ) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 7808) - ) - ) - (br_if $label$145 - (i32.ne - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 34) - ) - ) - (br $label$6) - ) - ) - (br_if $label$65 - (i64.eq - (get_local $2) - (i64.const -696013503128813881) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013502727104654) - ) - ) - (call $_ZN16test_transaction17send_action_emptyEv) - (br $label$6) - ) - (br_if $label$64 - (i64.eq - (get_local $2) - (i64.const -5767735919218491073) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -5767735918947814449) - ) - ) - (i64.store offset=216 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=208 - (get_local $10) - (i64.const 1) - ) - (i64.store offset=40 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=32 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $10) - (i64.const -9223372036854775808) - ) - (i64.store offset=16 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=8 - (get_local $10) - (i64.const -1) - ) - (i64.store - (get_local $10) - (i64.const -87654323456) - ) - (call $printi128 - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printi128 - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printi128 - (i32.add - (get_local $10) - (i32.const 16) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printi128 - (get_local $10) - ) - (call $prints - (i32.const 1824) - ) - (br $label$6) - ) - (br_if $label$63 - (i64.eq - (get_local $2) - (i64.const -696013500238724020) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -696013500020145514) - ) - ) - (drop - (call $memset - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 0) - (i32.const 128) - ) - ) - (drop - (call $get_context_free_data - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 128) - ) - ) - (br $label$6) - ) - (br_if $label$62 - (i64.eq - (get_local $2) - (i64.const -8022470633505015024) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -8022470633369446971) - ) - ) - (call $_ZN15test_fixedpoint13test_divisionEv) - (br $label$6) - ) - (br_if $label$61 - (i64.eq - (get_local $2) - (i64.const -4239006006334808643) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -4239006006118930912) - ) - ) - (call $assert_sha256 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (br_if $label$60 - (i64.eq - (get_local $2) - (i64.const -7587351443299599510) - ) - ) - (br_if $label$59 - (i64.ne - (get_local $2) - (i64.const -7587351442991046735) - ) - ) - (call $sha1 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (i32.store8 offset=208 - (get_local $10) - (i32.xor - (i32.load8_u offset=208 - (get_local $10) - ) - (i32.const -1) - ) - ) - (call $assert_sha1 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 9200) - ) - (br $label$6) - ) - (call $_ZN16test_transaction16send_transactionEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (call $_ZN16test_transaction19send_cf_action_failEv) - (br $label$6) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 144) - ) - ) - (call $assert_recover_key - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 66) - ) - (i32.const 66) - (i32.add - (get_local $10) - (i32.const 240) - ) - (i32.const 34) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 7776) - ) - (br $label$6) - ) - (call $sha256 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (i32.store8 offset=208 - (get_local $10) - (i32.xor - (i32.load8_u offset=208 - (get_local $10) - ) - (i32.const -1) - ) - ) - (call $assert_sha256 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 9200) - ) - (br $label$6) - ) - (set_local $6 - (i64.const 0) - ) - (set_local $9 - (i64.const 1) - ) - (set_local $7 - (i64.const 0) - ) - (loop $label$147 - (set_local $6 - (i64.add - (i64.and - (tee_local $8 - (get_local $6) - ) - (i64.const 4294967295) - ) - (get_local $7) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (br_if $label$147 - (i64.ne - (tee_local $9 - (i64.add - (get_local $9) - (i64.const -1) - ) - ) - (i64.const 8446744073709551617) - ) - ) - ) - (call $printi - (i64.shr_s - (i64.shl - (i64.sub - (get_local $8) - (get_local $9) - ) - (i64.const 32) - ) - (i64.const 32) - ) - ) - (br $label$6) - ) - (call $_ZN16test_transaction14send_cf_actionEv) - (br $label$6) - ) - (call $printui - (i64.const 0) - ) - (call $printui - (i64.const 556644) - ) - (call $printui - (i64.const -1) - ) - (br $label$6) - ) - (call $printsf - (f32.const 0.5) - ) - (call $prints - (i32.const 1824) - ) - (call $printsf - (f32.const -3.75) - ) - (call $prints - (i32.const 1824) - ) - (call $printsf - (f32.const 6.666666649834951e-07) - ) - (call $prints - (i32.const 1824) - ) - (br $label$6) - ) - (call $prints - (i32.const 18096) - ) - (br $label$6) - ) - (set_local $7 - (i64.const 0) - ) - (set_local $6 - (i64.const 59) - ) - (set_local $5 - (i32.const 18400) - ) - (set_local $8 - (i64.const 0) - ) - (loop $label$148 - (block $label$149 - (block $label$150 - (block $label$151 - (block $label$152 - (block $label$153 - (br_if $label$153 - (i64.gt_u - (get_local $7) - (i64.const 9) - ) - ) - (br_if $label$152 - (i32.gt_u - (i32.and - (i32.add - (tee_local $3 - (i32.load8_s - (get_local $5) - ) - ) - (i32.const -97) - ) - (i32.const 255) - ) - (i32.const 25) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 165) - ) - ) - (br $label$151) - ) - (set_local $9 - (i64.const 0) - ) - (br_if $label$150 - (i64.le_u - (get_local $7) - (i64.const 11) - ) - ) - (br $label$149) - ) - (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 $9 - (i64.shr_s - (i64.shl - (i64.extend_u/i32 - (get_local $3) - ) - (i64.const 56) - ) - (i64.const 56) - ) - ) - ) - (set_local $9 - (i64.shl - (i64.and - (get_local $9) - (i64.const 31) - ) - (i64.and - (get_local $6) - (i64.const 4294967295) - ) - ) - ) - ) - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (set_local $7 - (i64.add - (get_local $7) - (i64.const 1) - ) - ) - (set_local $8 - (i64.or - (get_local $9) - (get_local $8) - ) - ) - (br_if $label$148 - (i64.ne - (tee_local $6 - (i64.add - (get_local $6) - (i64.const -5) - ) - ) - (i64.const -6) - ) - ) - ) - (call $eosio_assert - (i32.eqz - (call $is_feature_active - (get_local $8) - ) - ) - (i32.const 18416) - ) - (br $label$6) - ) - (set_local $3 - (i32.const 0) - ) - (call $sha512 - (i32.const 8960) - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$154 - (loop $label$155 - (br_if $label$154 - (i32.ne - (i32.load8_u - (i32.add - (get_local $5) - (i32.const 9072) - ) - ) - (i32.load8_u - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (get_local $5) - ) - ) - ) - ) - (br_if $label$155 - (i32.le_u - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 63) - ) - ) - ) - (set_local $3 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $3) - (i32.const 9136) - ) - (br $label$6) - ) - (call $sha512 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (i32.store8 offset=208 - (get_local $10) - (i32.xor - (i32.load8_u offset=208 - (get_local $10) - ) - (i32.const -1) - ) - ) - (call $assert_sha512 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 9200) - ) - (br $label$6) - ) - (call $assert_ripemd160 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (call $sha256 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (call $sha1 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha1 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha1 - (i32.const 7904) - (i32.const 56) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha1 - (i32.const 7904) - (i32.const 56) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha1 - (i32.const 8016) - (i32.const 112) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha1 - (i32.const 8016) - (i32.const 112) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $sha1 - (i32.const 8192) - (i32.const 14) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_sha1 - (i32.const 8192) - (i32.const 14) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (call $_ZN5eosio18unpack_action_dataI29test_permission_last_used_msgEET_v - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $eosio_assert - (i64.eq - (call $get_account_creation_time - (i64.load offset=208 - (get_local $10) - ) - ) - (i64.load offset=224 - (get_local $10) - ) - ) - (i32.const 18512) - ) - (br $label$6) - ) - (call $_ZN16test_transaction21test_read_transactionEv) - (br $label$6) - ) - (call $_ZN16test_transaction11send_actionEv) - (br $label$6) - ) - (call $_ZN11test_crypto14test_ripemd160Ev) - (br $label$6) - ) - (call $_ZN11test_crypto11test_sha512Ev) - (br $label$6) - ) - (call $_ZN16test_transaction17send_action_largeEv) - (br $label$6) - ) - (call $_ZN16test_transaction22send_transaction_largeEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (i32.store16 offset=208 - (get_local $10) - (i32.const 25185) - ) - (call $prints_l - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 2) - ) - (call $prints_l - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 1) - ) - (call $prints_l - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 0) - ) - (call $prints_l - (i32.const 944) - (i32.const 4) - ) - (br $label$6) - ) - (i64.store offset=216 - (get_local $10) - (i64.const -1) - ) - (i64.store offset=208 - (get_local $10) - (i64.const -1) - ) - (i64.store offset=40 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=32 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=24 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=16 - (get_local $10) - (i64.const 87654323456) - ) - (call $printui128 - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printui128 - (i32.add - (get_local $10) - (i32.const 32) - ) - ) - (call $prints - (i32.const 1824) - ) - (call $printui128 - (i32.add - (get_local $10) - (i32.const 16) - ) - ) - (call $prints - (i32.const 1824) - ) - (br $label$6) - ) - (call $_ZN16test_transaction12stateful_apiEv) - (br $label$6) - ) - (call $_ZN16test_transaction38send_transaction_trigger_error_handlerEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5632) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5696) - ) - (br $label$6) - ) - (call $_ZN10test_print11test_printnEv) - (br $label$6) - ) - (set_local $3 - (i32.const 0) - ) - (call $sha1 - (i32.const 8960) - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$156 - (loop $label$157 - (br_if $label$156 - (i32.ne - (i32.load8_u - (i32.add - (get_local $5) - (i32.const 8976) - ) - ) - (i32.load8_u - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (get_local $5) - ) - ) - ) - ) - (br_if $label$157 - (i32.le_u - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $3 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $3) - (i32.const 9008) - ) - (br $label$6) - ) - (call $_ZN16test_transaction25send_deferred_transactionEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (drop - (call $read_action_data - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 144) - ) - ) - (call $assert_recover_key - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (i32.const 66) - ) - (i32.const 66) - (i32.add - (get_local $10) - (i32.const 240) - ) - (i32.const 34) - ) - (br $label$6) - ) - (call $sha512 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (call $_ZN15test_permission19check_authorizationEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (call $_ZN16test_transaction33send_deferred_transaction_replaceEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6016) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 6160) - ) - (br $label$6) - ) - (call $assert_sha1 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (set_local $3 - (i32.const 0) - ) - (call $ripemd160 - (i32.const 8960) - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (set_local $5 - (i32.const 0) - ) - (block $label$158 - (loop $label$159 - (br_if $label$158 - (i32.ne - (i32.load8_u - (i32.add - (get_local $5) - (i32.const 9152) - ) - ) - (i32.load8_u - (i32.add - (i32.add - (get_local $10) - (i32.const 208) - ) - (get_local $5) - ) - ) - ) - ) - (br_if $label$159 - (i32.le_u - (tee_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (i32.const 31) - ) - ) - ) - (set_local $3 - (i32.const 1) - ) - ) - (call $eosio_assert - (get_local $3) - (i32.const 9184) - ) - (br $label$6) - ) - (call $_ZN16test_transaction19send_action_recurseEv) - (br $label$6) - ) - (call $ripemd160 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_ripemd160 - (i32.const 7840) - (i32.const 3) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $ripemd160 - (i32.const 7904) - (i32.const 56) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_ripemd160 - (i32.const 7904) - (i32.const 56) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $ripemd160 - (i32.const 8016) - (i32.const 112) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_ripemd160 - (i32.const 8016) - (i32.const 112) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $ripemd160 - (i32.const 8192) - (i32.const 14) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (call $assert_ripemd160 - (i32.const 8192) - (i32.const 14) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (i64.store offset=216 - (get_local $10) - (i64.const 0) - ) - (i64.store offset=208 - (get_local $10) - (i64.const -1) - ) - (call $eosio_assert - (i32.eqz - (call $cancel_deferred - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - ) - (i32.const 18160) - ) - (br $label$6) - ) - (call $printdf - (f64.const 0.5) - ) - (call $prints - (i32.const 1824) - ) - (call $printdf - (f64.const -3.75) - ) - (call $prints - (i32.const 1824) - ) - (call $printdf - (f64.const 6.666666666666666e-07) - ) - (call $prints - (i32.const 1824) - ) - (br $label$6) - ) - (call $_ZN16test_transaction18send_action_senderEyyy - (get_local $0) - (get_local $7) - (get_local $7) - ) - (br $label$6) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5760) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5760) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5824) - ) - (call $eosio_assert - (i32.const 1) - (i32.const 5824) - ) - (br $label$6) - ) - (call $sha1 - (call $_Znaj - (i32.const 20000000) - ) - (i32.const 20000000) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (call $sha256 - (i32.const 0) - (i32.const 100) - (i32.add - (get_local $10) - (i32.const 208) - ) - ) - (br $label$6) - ) - (call $eosio_assert - (i32.const 0) - (i32.const 18992) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $10) - (i32.const 384) - ) - ) - ) - (func $_ZN5eosio18unpack_action_dataINS_7onerrorEEET_v (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (set_local $3 - (tee_local $2 - (i32.sub - (i32.load offset=4 - (i32.const 0) - ) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (get_local $2) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.lt_u - (tee_local $1 - (call $action_data_size) - ) - (i32.const 513) - ) - ) - (set_local $2 - (call $malloc - (get_local $1) - ) - ) - (br $label$0) - ) - (i32.store offset=4 - (i32.const 0) - (tee_local $2 - (i32.sub - (get_local $2) - (i32.and - (i32.add - (get_local $1) - (i32.const 15) - ) - (i32.const -16) - ) - ) - ) - ) - ) - (drop - (call $read_action_data - (get_local $2) - (get_local $1) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 24) - ) - (i32.const 0) - ) - (i64.store offset=16 align=4 - (get_local $0) - (i64.const 0) - ) - (i32.store offset=8 - (get_local $3) - (i32.add - (get_local $2) - (get_local $1) - ) - ) - (i32.store - (get_local $3) - (get_local $2) - ) - (call $eosio_assert - (i32.gt_u - (get_local $1) - (i32.const 15) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $0) - (get_local $2) - (i32.const 16) - ) - ) - (i32.store offset=4 - (get_local $3) - (i32.add - (get_local $2) - (i32.const 16) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__16vectorIcNS7_9allocatorIcEEEE - (get_local $3) - (i32.add - (get_local $0) - (i32.const 16) - ) - ) - ) - (i32.store offset=4 - (i32.const 0) - (i32.add - (get_local $3) - (i32.const 16) - ) - ) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNS_18transaction_headerE (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) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (i32.load offset=4 - (get_local $0) - ) - ) - (i32.const 3) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $1) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 1) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 4) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 2) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $2 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 2) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load offset=8 - (get_local $0) - ) - (get_local $2) - ) - (i32.const 3) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 8) - ) - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - (i32.store offset=4 - (get_local $0) - (tee_local $4 - (i32.add - (i32.load offset=4 - (get_local $0) - ) - (i32.const 4) - ) - ) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$0 - (call $eosio_assert - (i32.lt_u - (get_local $4) - (i32.load - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (i32.const 848) - ) - (set_local $2 - (i32.load8_u - (tee_local $4 - (i32.load - (tee_local $7 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - ) - ) - (i32.store - (get_local $7) - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 1) - ) - ) - ) - (set_local $5 - (i64.or - (i64.extend_u/i32 - (i32.shl - (i32.and - (get_local $2) - (i32.const 127) - ) - (tee_local $6 - (i32.and - (get_local $6) - (i32.const 255) - ) - ) - ) - ) - (get_local $5) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 7) - ) - ) - (br_if $label$0 - (i32.shr_u - (get_local $2) - (i32.const 7) - ) - ) - ) - (i64.store32 offset=12 - (get_local $1) - (get_local $5) - ) - (call $eosio_assert - (i32.ne - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (get_local $4) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $1) - (i32.const 16) - ) - (i32.load - (tee_local $4 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (i32.const 1) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 1) - ) - ) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $5 - (i64.const 0) - ) - (loop $label$1 - (call $eosio_assert - (i32.lt_u - (get_local $6) - (i32.load - (get_local $3) - ) - ) - (i32.const 848) - ) - (set_local $2 - (i32.load8_u - (tee_local $6 - (i32.load - (get_local $4) - ) - ) - ) - ) - (i32.store - (get_local $4) - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 1) - ) - ) - ) - (set_local $5 - (i64.or - (i64.extend_u/i32 - (i32.shl - (i32.and - (get_local $2) - (i32.const 127) - ) - (tee_local $7 - (i32.and - (get_local $7) - (i32.const 255) - ) - ) - ) - ) - (get_local $5) - ) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const 7) - ) - ) - (br_if $label$1 - (i32.shr_u - (get_local $2) - (i32.const 7) - ) - ) - ) - (i64.store32 offset=20 - (get_local $1) - (get_local $5) - ) - (get_local $0) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEENS_6actionEEERT_S7_RNSt3__16vectorIT0_NS8_9allocatorISA_EEEE (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) - (set_local $7 - (i32.load offset=4 - (get_local $0) - ) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $5 - (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 $7) - (i32.load - (get_local $2) - ) - ) - (i32.const 848) - ) - (set_local $4 - (i32.load8_u - (tee_local $7 - (i32.load - (get_local $3) - ) - ) - ) - ) - (i32.store - (get_local $3) - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 1) - ) - ) - ) - (set_local $5 - (i64.or - (i64.extend_u/i32 - (i32.shl - (i32.and - (get_local $4) - (i32.const 127) - ) - (tee_local $6 - (i32.and - (get_local $6) - (i32.const 255) - ) - ) - ) - ) - (get_local $5) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (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 $4 - (i32.wrap/i64 - (get_local $5) - ) - ) - (tee_local $7 - (i32.div_s - (i32.sub - (tee_local $2 - (i32.load offset=4 - (get_local $1) - ) - ) - (tee_local $6 - (i32.load - (get_local $1) - ) - ) - ) - (i32.const 40) - ) - ) - ) - ) - (call $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE8__appendEj - (get_local $1) - (i32.sub - (get_local $4) - (get_local $7) - ) - ) - (set_local $2 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - (br $label$1) - ) - (br_if $label$1 - (i32.ge_u - (get_local $4) - (get_local $7) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $2) - (tee_local $3 - (i32.add - (get_local $6) - (tee_local $4 - (i32.mul - (get_local $4) - (i32.const 40) - ) - ) - ) - ) - ) - ) - (set_local $6 - (i32.sub - (i32.sub - (i32.const 0) - (get_local $6) - ) - (get_local $4) - ) - ) - (set_local $4 - (i32.add - (get_local $2) - (i32.const -24) - ) - ) - (loop $label$4 - (block $label$5 - (br_if $label$5 - (i32.eqz - (tee_local $7 - (i32.load - (i32.add - (get_local $4) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 16) - ) - (get_local $7) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.eqz - (tee_local $7 - (i32.load - (get_local $4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 4) - ) - (get_local $7) - ) - (call $_ZdlPv - (get_local $7) - ) - ) - (br_if $label$4 - (i32.ne - (i32.add - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -40) - ) - ) - (get_local $6) - ) - (i32.const -24) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (get_local $3) - ) - (set_local $2 - (get_local $3) - ) - ) - (block $label$7 - (br_if $label$7 - (i32.eq - (tee_local $7 - (i32.load - (get_local $1) - ) - ) - (get_local $2) - ) - ) - (set_local $4 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$8 - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (tee_local $6 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - ) - (i32.load - (get_local $4) - ) - ) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $7) - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (tee_local $3 - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - ) - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (get_local $6) - ) - (get_local $3) - ) - (i32.const 7) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (i32.add - (get_local $7) - (i32.const 8) - ) - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - (i32.store - (get_local $4) - (i32.add - (i32.load - (get_local $4) - ) - (i32.const 8) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__16vectorIcNS7_9allocatorIcEEEE - (call $_ZN5eosiorsINS_10datastreamIPKcEENS_16permission_levelEEERT_S7_RNSt3__16vectorIT0_NS8_9allocatorISA_EEEE - (get_local $0) - (i32.add - (get_local $7) - (i32.const 16) - ) - ) - (i32.add - (get_local $7) - (i32.const 28) - ) - ) - ) - (br_if $label$8 - (i32.ne - (tee_local $7 - (i32.add - (get_local $7) - (i32.const 40) - ) - ) - (get_local $2) - ) - ) - ) - ) - (get_local $0) - ) - (func $_ZN5eosiorsINS_10datastreamIPKcEENSt3__15tupleIJtNS5_6vectorIcNS5_9allocatorIcEEEEEEEEERT_SD_RNS7_IT0_NS8_ISE_EEEE (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 848) - ) - (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 $4 - (i32.wrap/i64 - (get_local $6) - ) - ) - (tee_local $5 - (i32.shr_s - (i32.sub - (tee_local $7 - (i32.load offset=4 - (get_local $1) - ) - ) - (tee_local $3 - (i32.load - (get_local $1) - ) - ) - ) - (i32.const 4) - ) - ) - ) - ) - (call $_ZNSt3__16vectorINS_5tupleIJtNS0_IcNS_9allocatorIcEEEEEEENS2_IS5_EEE8__appendEj - (get_local $1) - (i32.sub - (get_local $4) - (get_local $5) - ) - ) - (set_local $7 - (i32.load - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - (br $label$1) - ) - (br_if $label$1 - (i32.ge_u - (get_local $4) - (get_local $5) - ) - ) - (block $label$3 - (br_if $label$3 - (i32.eq - (get_local $7) - (tee_local $2 - (i32.add - (get_local $3) - (tee_local $4 - (i32.shl - (get_local $4) - (i32.const 4) - ) - ) - ) - ) - ) - ) - (set_local $3 - (i32.sub - (i32.sub - (i32.const 0) - (get_local $3) - ) - (get_local $4) - ) - ) - (set_local $4 - (i32.add - (get_local $7) - (i32.const -12) - ) - ) - (loop $label$4 - (block $label$5 - (br_if $label$5 - (i32.eqz - (tee_local $5 - (i32.load - (get_local $4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $4) - (i32.const 4) - ) - (get_local $5) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - (br_if $label$4 - (i32.ne - (i32.add - (tee_local $4 - (i32.add - (get_local $4) - (i32.const -16) - ) - ) - (get_local $3) - ) - (i32.const -12) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $1) - (i32.const 4) - ) - (get_local $2) - ) - (set_local $7 - (get_local $2) - ) - ) - (block $label$6 - (br_if $label$6 - (i32.eq - (tee_local $4 - (i32.load - (get_local $1) - ) - ) - (get_local $7) - ) - ) - (set_local $3 - (i32.add - (get_local $0) - (i32.const 8) - ) - ) - (loop $label$7 - (call $eosio_assert - (i32.gt_u - (i32.sub - (i32.load - (get_local $3) - ) - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - ) - (i32.const 1) - ) - (i32.const 800) - ) - (drop - (call $memcpy - (get_local $4) - (i32.load - (get_local $5) - ) - (i32.const 2) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) - ) - (i32.const 2) - ) - ) - (drop - (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__16vectorIcNS7_9allocatorIcEEEE - (get_local $0) - (i32.add - (get_local $4) - (i32.const 4) - ) - ) - ) - (br_if $label$7 - (i32.ne - (tee_local $4 - (i32.add - (get_local $4) - (i32.const 16) - ) - ) - (get_local $7) - ) - ) - ) - ) - (get_local $0) - ) - (func $_ZNSt3__16vectorINS_5tupleIJtNS0_IcNS_9allocatorIcEEEEEEENS2_IS5_EEE8__appendEj (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.ge_u - (i32.shr_s - (i32.sub - (tee_local $8 - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $7 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (i32.const 4) - ) - (get_local $1) - ) - ) - (br_if $label$2 - (i32.ge_u - (tee_local $7 - (i32.add - (tee_local $4 - (i32.shr_s - (i32.sub - (get_local $7) - (tee_local $5 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 4) - ) - ) - (get_local $1) - ) - ) - (i32.const 268435456) - ) - ) - (set_local $6 - (i32.const 268435455) - ) - (block $label$5 - (br_if $label$5 - (i32.gt_u - (i32.shr_s - (tee_local $8 - (i32.sub - (get_local $8) - (get_local $5) - ) - ) - (i32.const 4) - ) - (i32.const 134217726) - ) - ) - (br_if $label$3 - (i32.eqz - (tee_local $6 - (select - (get_local $7) - (tee_local $6 - (i32.shr_s - (get_local $8) - (i32.const 3) - ) - ) - (i32.lt_u - (get_local $6) - (get_local $7) - ) - ) - ) - ) - ) - (br_if $label$1 - (i32.ge_u - (get_local $6) - (i32.const 268435456) - ) - ) - ) - (set_local $8 - (call $_Znwj - (i32.shl - (get_local $6) - (i32.const 4) - ) - ) - ) - (br $label$0) - ) - (set_local $6 - (get_local $7) - ) - (set_local $8 - (get_local $1) - ) - (loop $label$6 - (i32.store16 - (get_local $6) - (i32.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $6) - (i32.const 4) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $6) - (i32.const 12) - ) - (i32.const 0) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (br_if $label$6 - (tee_local $8 - (i32.add - (get_local $8) - (i32.const -1) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (i32.add - (get_local $7) - (i32.shl - (get_local $1) - (i32.const 4) - ) - ) - ) - (return) - ) - (set_local $6 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$0) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (call $abort) - (unreachable) - ) - (set_local $2 - (i32.add - (get_local $8) - (i32.shl - (get_local $6) - (i32.const 4) - ) - ) - ) - (set_local $6 - (tee_local $8 - (i32.add - (get_local $8) - (i32.shl - (get_local $4) - (i32.const 4) - ) - ) - ) - ) - (set_local $7 - (get_local $1) - ) - (loop $label$7 - (i32.store16 - (get_local $6) - (i32.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $6) - (i32.const 4) - ) - (i64.const 0) - ) - (i32.store - (i32.add - (get_local $6) - (i32.const 12) - ) - (i32.const 0) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const 16) - ) - ) - (br_if $label$7 - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -1) - ) - ) - ) - ) - (set_local $3 - (i32.add - (get_local $8) - (i32.shl - (get_local $1) - (i32.const 4) - ) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eq - (tee_local $7 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $6 - (i32.load - (get_local $0) - ) - ) - ) - ) - (set_local $4 - (i32.sub - (i32.const 0) - (get_local $6) - ) - ) - (set_local $6 - (i32.add - (get_local $7) - (i32.const -16) - ) - ) - (loop $label$10 - (i32.store16 - (i32.add - (get_local $8) - (i32.const -16) - ) - (i32.load16_u - (get_local $6) - ) - ) - (i64.store align=4 - (tee_local $7 - (i32.add - (get_local $8) - (i32.const -12) - ) - ) - (i64.const 0) - ) - (i32.store - (tee_local $1 - (i32.add - (get_local $8) - (i32.const -4) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $7) - (i32.load - (tee_local $5 - (i32.add - (get_local $6) - (i32.const 4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $6) - (i32.const 8) - ) - ) - ) - (i32.store - (get_local $1) - (i32.load - (tee_local $7 - (i32.add - (get_local $6) - (i32.const 12) - ) - ) - ) - ) - (i32.store - (get_local $7) - (i32.const 0) - ) - (i64.store align=4 - (get_local $5) - (i64.const 0) - ) - (set_local $8 - (i32.add - (get_local $8) - (i32.const -16) - ) - ) - (br_if $label$10 - (i32.ne - (i32.add - (tee_local $6 - (i32.add - (get_local $6) - (i32.const -16) - ) - ) - (get_local $4) - ) - (i32.const -16) - ) - ) - ) - (set_local $6 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $1 - (i32.load - (get_local $0) - ) - ) - (br $label$8) - ) - (set_local $1 - (get_local $6) - ) - ) - (i32.store - (get_local $0) - (get_local $8) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $3) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $2) - ) - (block $label$11 - (br_if $label$11 - (i32.eq - (get_local $6) - (get_local $1) - ) - ) - (set_local $7 - (i32.sub - (i32.const 0) - (get_local $1) - ) - ) - (set_local $6 - (i32.add - (get_local $6) - (i32.const -12) - ) - ) - (loop $label$12 - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $8 - (i32.load - (get_local $6) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $6) - (i32.const 4) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$12 - (i32.ne - (i32.add - (tee_local $6 - (i32.add - (get_local $6) - (i32.const -16) - ) - ) - (get_local $7) - ) - (i32.const -12) - ) - ) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (get_local $1) - ) - ) - (call $_ZdlPv - (get_local $1) - ) - ) - ) - (func $_ZNSt3__16vectorIN5eosio6actionENS_9allocatorIS2_EEE8__appendEj (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (block $label$0 - (block $label$1 - (block $label$2 - (block $label$3 - (block $label$4 - (br_if $label$4 - (i32.ge_u - (i32.div_s - (i32.sub - (tee_local $8 - (i32.load offset=8 - (get_local $0) - ) - ) - (tee_local $7 - (i32.load offset=4 - (get_local $0) - ) - ) - ) - (i32.const 40) - ) - (get_local $1) - ) - ) - (br_if $label$2 - (i32.ge_u - (tee_local $6 - (i32.add - (tee_local $5 - (i32.div_s - (i32.sub - (get_local $7) - (tee_local $4 - (i32.load - (get_local $0) - ) - ) - ) - (i32.const 40) - ) - ) - (get_local $1) - ) - ) - (i32.const 107374183) - ) - ) - (set_local $7 - (i32.const 107374182) - ) - (block $label$5 - (br_if $label$5 - (i32.gt_u - (tee_local $8 - (i32.div_s - (i32.sub - (get_local $8) - (get_local $4) - ) - (i32.const 40) - ) - ) - (i32.const 53687090) - ) - ) - (br_if $label$3 - (i32.eqz - (tee_local $7 - (select - (get_local $6) - (tee_local $7 - (i32.shl - (get_local $8) - (i32.const 1) - ) - ) - (i32.lt_u - (get_local $7) - (get_local $6) - ) - ) - ) - ) - ) - ) - (set_local $8 - (call $_Znwj - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (br $label$1) - ) - (set_local $8 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (loop $label$6 - (i64.store - (get_local $7) - (i64.const 0) - ) - (i64.store offset=16 align=4 - (get_local $7) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $7) - (i32.const 8) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $7) - (i32.const 24) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $7) - (i32.const 32) - ) - (i64.const 0) - ) - (i32.store - (get_local $8) - (tee_local $7 - (i32.add - (i32.load - (get_local $8) - ) - (i32.const 40) - ) - ) - ) - (br_if $label$6 - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -1) - ) - ) - ) - (br $label$0) - ) - ) - (set_local $7 - (i32.const 0) - ) - (set_local $8 - (i32.const 0) - ) - (br $label$1) - ) - (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv - (get_local $0) - ) - (unreachable) - ) - (set_local $2 - (i32.add - (get_local $8) - (i32.mul - (get_local $7) - (i32.const 40) - ) - ) - ) - (set_local $7 - (tee_local $8 - (i32.add - (get_local $8) - (i32.mul - (get_local $5) - (i32.const 40) - ) - ) - ) - ) - (loop $label$7 - (i64.store - (get_local $7) - (i64.const 0) - ) - (i64.store offset=16 align=4 - (get_local $7) - (i64.const 0) - ) - (i64.store - (i32.add - (get_local $7) - (i32.const 8) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $7) - (i32.const 24) - ) - (i64.const 0) - ) - (i64.store align=4 - (i32.add - (get_local $7) - (i32.const 32) - ) - (i64.const 0) - ) - (set_local $7 - (i32.add - (get_local $7) - (i32.const 40) - ) - ) - (br_if $label$7 - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -1) - ) - ) - ) - ) - (block $label$8 - (block $label$9 - (br_if $label$9 - (i32.eq - (tee_local $1 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (tee_local $4 - (i32.load - (get_local $0) - ) - ) - ) - ) - (set_local $3 - (i32.sub - (i32.const 0) - (get_local $4) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const -20) - ) - ) - (loop $label$10 - (i64.store - (i32.add - (get_local $8) - (i32.const -32) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const -12) - ) - ) - ) - (i64.store - (i32.add - (get_local $8) - (i32.const -40) - ) - (i64.load - (i32.add - (get_local $1) - (i32.const -20) - ) - ) - ) - (i64.store align=4 - (tee_local $4 - (i32.add - (get_local $8) - (i32.const -24) - ) - ) - (i64.const 0) - ) - (i32.store - (tee_local $5 - (i32.add - (get_local $8) - (i32.const -16) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $4) - (i32.load - (tee_local $6 - (i32.add - (get_local $1) - (i32.const -4) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -20) - ) - (i32.load - (get_local $1) - ) - ) - (i32.store - (get_local $5) - (i32.load - (tee_local $4 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (i64.store align=4 - (tee_local $4 - (i32.add - (get_local $8) - (i32.const -12) - ) - ) - (i64.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (i32.store - (tee_local $5 - (i32.add - (get_local $8) - (i32.const -4) - ) - ) - (i32.const 0) - ) - (i32.store - (get_local $4) - (i32.load - (tee_local $6 - (i32.add - (get_local $1) - (i32.const 8) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $8) - (i32.const -8) - ) - (i32.load - (i32.add - (get_local $1) - (i32.const 12) - ) - ) - ) - (i32.store - (get_local $5) - (i32.load - (tee_local $4 - (i32.add - (get_local $1) - (i32.const 16) - ) - ) - ) - ) - (i32.store - (get_local $4) - (i32.const 0) - ) - (i64.store align=4 - (get_local $6) - (i64.const 0) - ) - (set_local $8 - (i32.add - (get_local $8) - (i32.const -40) - ) - ) - (br_if $label$10 - (i32.ne - (i32.add - (tee_local $1 - (i32.add - (get_local $1) - (i32.const -40) - ) - ) - (get_local $3) - ) - (i32.const -20) - ) - ) - ) - (set_local $4 - (i32.load - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - ) - (set_local $5 - (i32.load - (get_local $0) - ) - ) - (br $label$8) - ) - (set_local $5 - (get_local $4) - ) - ) - (i32.store - (get_local $0) - (get_local $8) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 4) - ) - (get_local $7) - ) - (i32.store - (i32.add - (get_local $0) - (i32.const 8) - ) - (get_local $2) - ) - (block $label$11 - (br_if $label$11 - (i32.eq - (get_local $4) - (get_local $5) - ) - ) - (set_local $1 - (i32.sub - (i32.const 0) - (get_local $5) - ) - ) - (set_local $7 - (i32.add - (get_local $4) - (i32.const -24) - ) - ) - (loop $label$12 - (block $label$13 - (br_if $label$13 - (i32.eqz - (tee_local $8 - (i32.load - (i32.add - (get_local $7) - (i32.const 12) - ) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 16) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (block $label$14 - (br_if $label$14 - (i32.eqz - (tee_local $8 - (i32.load - (get_local $7) - ) - ) - ) - ) - (i32.store - (i32.add - (get_local $7) - (i32.const 4) - ) - (get_local $8) - ) - (call $_ZdlPv - (get_local $8) - ) - ) - (br_if $label$12 - (i32.ne - (i32.add - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -40) - ) - ) - (get_local $1) - ) - (i32.const -24) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (get_local $5) - ) - ) - (call $_ZdlPv - (get_local $5) - ) - ) - ) - (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=19008 - (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 $_Znaj (param $0 i32) (result i32) - (call $_Znwj - (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 $_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv (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 $fabs (param $0 f64) (result f64) - (f64.reinterpret/i64 - (i64.and - (i64.reinterpret/f64 - (get_local $0) - ) - (i64.const 9223372036854775807) - ) - ) - ) - (func $fabsf (param $0 f32) (result f32) - (f32.reinterpret/i32 - (i32.and - (i32.reinterpret/f32 - (get_local $0) - ) - (i32.const 2147483647) - ) - ) - ) - (func $memccpy (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (block $label$0 - (block $label$1 - (block $label$2 - (br_if $label$2 - (i32.eqz - (i32.and - (i32.xor - (get_local $1) - (get_local $0) - ) - (i32.const 3) - ) - ) - ) - (set_local $7 - (get_local $3) - ) - (br $label$1) - ) - (set_local $6 - (i32.ne - (tee_local $7 - (i32.and - (get_local $1) - (i32.const 3) - ) - ) - (i32.const 0) - ) - ) - (block $label$3 - (block $label$4 - (block $label$5 - (block $label$6 - (br_if $label$6 - (i32.eqz - (get_local $3) - ) - ) - (br_if $label$5 - (i32.eqz - (get_local $7) - ) - ) - (set_local $4 - (i32.and - (get_local $2) - (i32.const 255) - ) - ) - (loop $label$7 - (i32.store8 - (get_local $0) - (tee_local $7 - (i32.load8_u - (get_local $1) - ) - ) - ) - (br_if $label$0 - (i32.eq - (get_local $7) - (get_local $4) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (set_local $7 - (i32.add - (get_local $3) - (i32.const -1) - ) - ) - (set_local $6 - (i32.ne - (tee_local $5 - (i32.and - (tee_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.const 3) - ) - ) - (i32.const 0) - ) - ) - (br_if $label$4 - (i32.eq - (get_local $3) - (i32.const 1) - ) - ) - (set_local $3 - (get_local $7) - ) - (br_if $label$7 - (get_local $5) - ) - (br $label$4) - ) - ) - (set_local $7 - (get_local $3) - ) - (br_if $label$0 - (get_local $6) - ) - (br $label$3) - ) - (set_local $7 - (get_local $3) - ) - ) - (br_if $label$0 - (get_local $6) - ) - ) - (br_if $label$1 - (i32.lt_u - (get_local $7) - (i32.const 4) - ) - ) - (set_local $6 - (i32.mul - (i32.and - (get_local $2) - (i32.const 255) - ) - (i32.const 16843009) - ) - ) - (loop $label$8 - (br_if $label$1 - (i32.and - (i32.and - (i32.xor - (tee_local $3 - (i32.xor - (tee_local $5 - (i32.load - (get_local $1) - ) - ) - (get_local $6) - ) - ) - (i32.const -1) - ) - (i32.add - (get_local $3) - (i32.const -16843009) - ) - ) - (i32.const -2139062144) - ) - ) - (i32.store - (get_local $0) - (get_local $5) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 4) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 4) - ) - ) - (br_if $label$8 - (i32.gt_u - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -4) - ) - ) - (i32.const 3) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (get_local $7) - ) - ) - (set_local $5 - (i32.and - (get_local $2) - (i32.const 255) - ) - ) - (loop $label$9 - (i32.store8 - (get_local $0) - (tee_local $3 - (i32.load8_u - (get_local $1) - ) - ) - ) - (br_if $label$0 - (i32.eq - (get_local $3) - (get_local $5) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (br_if $label$9 - (tee_local $7 - (i32.add - (get_local $7) - (i32.const -1) - ) - ) - ) - ) - ) - (select - (i32.add - (get_local $0) - (i32.const 1) - ) - (i32.const 0) - (i32.eq - (i32.load8_u - (get_local $1) - ) - (i32.and - (get_local $2) - (i32.const 255) - ) - ) - ) - ) - (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 $strlen (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (set_local $2 - (get_local $0) - ) - (block $label$0 - (block $label$1 - (br_if $label$1 - (i32.eqz - (i32.and - (get_local $0) - (i32.const 3) - ) - ) - ) - (set_local $2 - (get_local $0) - ) - (loop $label$2 - (br_if $label$0 - (i32.eqz - (i32.load8_u - (get_local $2) - ) - ) - ) - (br_if $label$2 - (i32.and - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (i32.const 3) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const -4) - ) - ) - (loop $label$3 - (br_if $label$3 - (i32.eqz - (i32.and - (i32.and - (i32.xor - (tee_local $1 - (i32.load - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 4) - ) - ) - ) - ) - (i32.const -1) - ) - (i32.add - (get_local $1) - (i32.const -16843009) - ) - ) - (i32.const -2139062144) - ) - ) - ) - ) - (br_if $label$0 - (i32.eqz - (i32.and - (get_local $1) - (i32.const 255) - ) - ) - ) - (loop $label$4 - (br_if $label$4 - (i32.load8_u - (tee_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - ) - ) - ) - ) - (i32.sub - (get_local $2) - (get_local $0) - ) - ) - (func $malloc (param $0 i32) (result i32) - (call $_ZN5eosio14memory_manager6mallocEm - (i32.const 19012) - (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 27408) - ) - (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=27494 - (i32.const 0) - ) - ) - ) - (set_local $7 - (i32.load offset=27496 - (i32.const 0) - ) - ) - (br $label$0) - ) - (set_local $7 - (current_memory) - ) - (i32.store8 offset=27494 - (i32.const 0) - (i32.const 1) - ) - (i32.store offset=27496 - (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=27496 - (i32.const 0) - ) - ) - ) - (set_local $8 - (i32.const 0) - ) - (i32.store offset=27496 - (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=27494 - (i32.const 0) - ) - ) - (set_local $3 - (current_memory) - ) - (i32.store8 offset=27494 - (i32.const 0) - (i32.const 1) - ) - (i32.store offset=27496 - (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=27496 - (i32.const 0) - ) - ) - ) - (i32.store offset=27496 - (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=27396 - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - (set_local $3 - (i32.const 27204) - ) - (set_local $1 - (i32.add - (i32.mul - (get_local $2) - (i32.const 12) - ) - (i32.const 27204) - ) - ) - (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) - ) - ) - ) -)