Giter Site home page Giter Site logo

tronweb's Issues

how to get contract return value and transaction hash at the same time ?

async function triggercontract2() {
let contractInstance = await tronWeb.contract().at('TVPGpHt8GvpMSqpdhjKcXq6ehtEACiUq8Z');

let args = {
    callValue: 0,
    shouldPollResponse: true
}
let result = await contractInstance.create('2', '30', '3', '3433', 'abcd', 'efg', '0.2334', '0.5', '0.1', '10', '56', 'TEwbscPMyadgq5oAK7NsdPQTXBSUtLnnwf', 'TEwbscPMyadgq5oAK7NsdPQTXBSUtLnnwf', 'SELL').send(args);

return result;

}

In the above code, i am trying to store some details in the smart contract i have deployed on the tron network. According to the solidity code, when I store something in the contract , a unique hash is returned. When i keep shouldPollResponse as true in the args, I get the unique hash as response. When i keep shouldPollResponse as false, I get the tron transaction hash as response. But I wish to know if there is any way to get both together. I need to save the unique hash to later fetch the records from the smart contract. And I need the tron transaction hash to maintain a proof that the details have been stored in tron blockchain. This tx hash can be used in tron scan to verify if the transaction has actually happened.

Thank you in advance.

is there any good tutorial?

is there any good tutorial with examples on tronweb or ​​tronapi python other than here and documentation? thanks.

getUnconfirmedTransactionInfo results in 502 Bad Gateway sometimes

On Using getUnconfirmedTransactionInfo(), I Keep getting 502 Bad Gateway response.

const hashResponse = await tronWeb.trx.getUnconfirmedTransactionInfo(transactionID);

This is the error output.

{ Error: Request failed with status code 502
    at createError (/home/node_modules/tronweb/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/node_modules/tronweb/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/home/node_modules/tronweb/node_modules/axios/lib/adapters/http.js:237:11)
    at IncomingMessage.emit (events.js:194:15)
    at IncomingMessage.EventEmitter.emit (domain.js:441:20)
    at endReadableNT (_stream_readable.js:1125:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  config:
   { url: 'https://api.trongrid.io/wallet/gettransactioninfobyid',
     method: 'post',
     params: false,
     data:
      '{"value":"f623dcb16e2cb92eac7e2de630596aadd2e482a532192da4320161a6251766e3"}',
     headers:
      { Accept: 'application/json, text/plain, */*',
        'Content-Type': 'application/json;charset=utf-8',
        'User-Agent': 'axios/0.19.0',
        'Content-Length': 76 },
     auth: false,
     baseURL: 'https://api.trongrid.io',
     transformRequest: [ [Function: transformRequest] ],
     transformResponse: [ [Function: transformResponse] ],
     timeout: 30000,
     adapter: [Function: httpAdapter],
     xsrfCookieName: 'XSRF-TOKEN',
     xsrfHeaderName: 'X-XSRF-TOKEN',
     maxContentLength: -1,
     validateStatus: [Function: validateStatus] },
  request:
   ClientRequest {
     domain: null,
     _events:
      [Object: null prototype] {
        socket: [Function],
        abort: [Function],
        aborted: [Function],
        error: [Function],
        timeout: [Function],
        prefinish: [Function: requestOnPrefinish] },
     _eventsCount: 6,
     _maxListeners: undefined,
     output: [],
     outputEncodings: [],
     outputCallbacks: [],
     outputSize: 0,
     writable: true,
     _last: true,
     chunkedEncoding: false,
     shouldKeepAlive: false,
     useChunkedEncodingByDefault: true,
     sendDate: false,
     _removedConnection: false,
     _removedContLen: false,
     _removedTE: false,
     _contentLength: null,
     _hasBody: true,
     _trailer: '',
     finished: true,
     _headerSent: true,
     socket:
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: 'api.trongrid.io',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 8,
        connecting: false,
        _hadError: false,
        _handle: [TLSWrap],
        _parent: null,
        _host: 'api.trongrid.io',
        _readableState: [ReadableState],
        readable: true,
        domain: null,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: [TLSWrap],
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular],
        [Symbol(res)]: [TLSWrap],
        [Symbol(asyncId)]: 22470,
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: null,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: [Object] },
     connection:
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: 'api.trongrid.io',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 8,
        connecting: false,
        _hadError: false,
        _handle: [TLSWrap],
        _parent: null,
        _host: 'api.trongrid.io',
        _readableState: [ReadableState],
        readable: true,
        domain: null,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: [TLSWrap],
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular],
        [Symbol(res)]: [TLSWrap],
        [Symbol(asyncId)]: 22470,
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: null,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: [Object] },
     _header:
      'POST /wallet/gettransactioninfobyid HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json;charset=utf-8\r\nUser-Agent: axios/0.19.0\r\nContent-Length: 76\r\nHost: api.trongrid.io\r\nConnection: close\r\n\r\n',
     _onPendingData: [Function: noopPendingOutput],
     agent:
      Agent {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        defaultPort: 443,
        protocol: 'https:',
        options: [Object],
        requests: {},
        sockets: [Object],
        freeSockets: {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: 256,
        maxCachedSessions: 100,
        _sessionCache: [Object] },
     socketPath: undefined,
     timeout: undefined,
     method: 'POST',
     path: '/wallet/gettransactioninfobyid',
     _ended: true,
     res:
      IncomingMessage {
        _readableState: [ReadableState],
        readable: false,
        domain: null,
        _events: [Object],
        _eventsCount: 3,
        _maxListeners: undefined,
        socket: [TLSSocket],
        connection: [TLSSocket],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Array],
        trailers: {},
        rawTrailers: [],
        aborted: false,
        upgrade: false,
        url: '',
        method: null,
        statusCode: 502,
        statusMessage: 'Bad Gateway',
        client: [TLSSocket],
        _consuming: false,
        _dumped: false,
        req: [Circular],
        responseUrl: 'https://api.trongrid.io/wallet/gettransactioninfobyid',
        redirects: [] },
     aborted: undefined,
     timeoutCb: null,
     upgradeOrConnect: false,
     parser: null,
     maxHeadersCount: null,
     _redirectable:
      Writable {
        _writableState: [WritableState],
        writable: true,
        domain: null,
        _events: [Object],
        _eventsCount: 2,
        _maxListeners: undefined,
        _options: [Object],
        _redirectCount: 0,
        _redirects: [],
        _requestBodyLength: 76,
        _requestBodyBuffers: [],
        _onNativeResponse: [Function],
        _currentRequest: [Circular],
        _currentUrl: 'https://api.trongrid.io/wallet/gettransactioninfobyid' },
     [Symbol(isCorked)]: false,
     [Symbol(outHeadersKey)]:
      [Object: null prototype] {
        accept: [Array],
        'content-type': [Array],
        'user-agent': [Array],
        'content-length': [Array],
        host: [Array] } },
  response:
   { status: 502,
     statusText: 'Bad Gateway',
     headers:
      { server: 'awselb/2.0',
        date: 'Mon, 15 Jul 2019 13:53:36 GMT',
        'content-type': 'text/html',
        'content-length': '138',
        connection: 'close' },
     config:
      { url: 'https://api.trongrid.io/wallet/gettransactioninfobyid',
        method: 'post',
        params: false,
        data:
         '{"value":"f623dcb16e2cb92eac7e2de630596aadd2e482a532192da4320161a6251766e3"}',
        headers: [Object],
        auth: false,
        baseURL: 'https://api.trongrid.io',
        transformRequest: [Array],
        transformResponse: [Array],
        timeout: 30000,
        adapter: [Function: httpAdapter],
        xsrfCookieName: 'XSRF-TOKEN',
        xsrfHeaderName: 'X-XSRF-TOKEN',
        maxContentLength: -1,
        validateStatus: [Function: validateStatus] },
     request:
      ClientRequest {
        domain: null,
        _events: [Object],
        _eventsCount: 6,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: null,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [TLSSocket],
        connection: [TLSSocket],
        _header:
         'POST /wallet/gettransactioninfobyid HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json;charset=utf-8\r\nUser-Agent: axios/0.19.0\r\nContent-Length: 76\r\nHost: api.trongrid.io\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Agent],
        socketPath: undefined,
        timeout: undefined,
        method: 'POST',
        path: '/wallet/gettransactioninfobyid',
        _ended: true,
        res: [IncomingMessage],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        _redirectable: [Writable],
        [Symbol(isCorked)]: false,
        [Symbol(outHeadersKey)]: [Object] },
     data:
      '<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor="white">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n' },
  isAxiosError: true,
  toJSON: [Function] }

Any help on handling this will be appreciated.

How to get the transaction hash when a contract is triggered ?

I am using the following code to trigger a contract method. The contract is an TRC20 token. It has got a transfer method that returns nothing. But I want to retrieve the transaction hash whenever I trigger this method using tron web. I will be using that hash to track the status in future.

async function send(address, amount) {
let contractInstance = await tronWeb.contract().at('TNFHQFDf6o3hKTsMvoE19ZMNRepS5rUttr');

let args = {
    callValue: 0,
    shouldPollResponse: true
}
let result = await contractInstance.transfer(address, amount).send(args);

return result;

}

Couldn't send a token

Couldn't send a token. What the catch here?

const tronWeb = new TronWeb({
    fullHost: 'https://api.trongrid.io',
    solidityNode: 'https://api.trongrid.io',
    eventServer: 'https://api.trongrid.io'
})
tx = tronWeb.trx.sendTransaction("TQ5vcDELdXvzXszWXyM97Bq61aVT6qWwUw", 1, "WIN", "87a909d4ad639a936dc266a60b540d43dc730f6e22a5c726486cbbaf363507ec")
console.log(tx)

Output:

Promise { <pending> }
(node:30057) UnhandledPromiseRejectionWarning: TypeError: i is not a function
    at e.<anonymous> (/node_modules/tronweb/dist/TronWeb.node.js:1:81389)
    at tryCatch (/node_modules/regenerator-runtime/runtime.js:45:40)
    at Generator.invoke [as _invoke] (/node_modules/regenerator-runtime/runtime.js:271:22)
    at Generator.prototype.<computed> [as throw] (/node_modules/regenerator-runtime/runtime.js:97:21)
    at asyncGeneratorStep (/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _throw (/node_modules/@babel/runtime/helpers/asyncToGenerator.js:29:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:30057) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:30057) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

P.S: I'm aware about shasta, but amount on the account is small, so I'm not scared to actually lose it.
Account is: https://tronscan.org/#/address/TFEmx2iyqhoKV9BYvyfqhqrJMZDuFwedw1

Public Key to Address Conversion confusion

Public Key to Address Conversion for Testnet Output is different when done through:

  1. TronWeb
  2. https://shasta.tronscan.org/#/tools/tron-convert-tool

This is because ADDRESS_PREFIX is hardcoded here.

But as per the Shasta tool, it should be: 0x41 for Mainnet and 0xa0 from Testnet

Please clear the confusion on which format is actually valid.

For reference, here is what I have been doing:
const pubBytes = hexStr2byteArray(ecPoint); const addressBytes = TronWeb.utils.crypto.computeAddress(pubBytes); const base58Address = TronWeb.utils.crypto.getBase58CheckAddress(addressBytes);

寻找组织!!!

请问有没有波场的中文技术社群,哪位小伙伴可以拉我下,我看了半天的文档,硬是没搞明白他的sdk 怎么使用,或者怎么调通智能合约。。。哪位小伙伴可以拉我进群,万分感谢!!!

calling method on Smart contract without ABI, Failed to Execute error

Hi,
I am trying to call some methods (pure view) on Justswap smart contract. As you probably know the justswap smart contract was created by a factory contract and for this reason is without ABI.
I have tried to wrap the contract object with the Justswap ABI and then calling a constant view method without success.
I have tried to call the same method on Justswap template contract and it works.

it seems tronweb contract object failed to setup correctly if the smart contract is without ABI.

below my code, if I change the justswap contract with his template (address: TDNbPAZh1cWvdJDnJ5M56eCwbxFm7b1x8V) works!

const TronWeb = require('tronweb');
const TronGrid = require('trongrid');
const HttpProvider = TronWeb.providers.HttpProvider;
const fullNode = new HttpProvider("https://api.trongrid.io");
const solidityNode = new HttpProvider("https://api.trongrid.io");
const eventServer = new HttpProvider("https://api.trongrid.io");
const privateKey = "3481E79956D4BD95F358AC96D151C976392FC4E3FC132F78A847906DE588C145";
const tronWeb = new TronWeb(fullNode,solidityNode,eventServer,privateKey);

var testContract;
var factoryAddr;

// ABI, a portion of ABI, only for testing the factoryAddress call method. To be replaced with the complete Justswap ABI
const JSABI = [{
"outputs":[{"type":"address"}],
"constant":true,
"name":"factoryAddress",
"stateMutability":"View",
"type":"Function"
}]

// initiate justswap contract with a specified ABI
async function initiateContract() {
testContract = await tronWeb.contract(JSABI,"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE");
}

async function methodCalling() {
try {
factoryAddr = await testContract.factoryAddress().call(); //<------ here we have the error,
factoryAddr = tronWeb.address.fromHex(factoryAddr);
}
catch (error) {
console.log(error);
}
}

function init() {
await initiateContract();
await methodCalling();
}

init();

can't call function in smart contract

I have a contract on the shasta test network. I create a contract inside my smart contract and save its address in an array, but i can't call function(i use tronweb) from contract which i create in smart contract. how i can call functions from contracts which created first contract? please help me. thanks

i can call functions from first smart contract which i created, but i cant call functions from contract which created first contract

[https://shasta.tronscan.org/#/contract/TFWss73HdRqiA8RJuBaBAuiXYifXLidmiK/code] it is contract which created first contract and [https://shasta.tronscan.org/#/contract/TM1KE9o2Zr7huCf2cgSQGcyxf46v19vjmM/code] it is first contract.

Is it possible?

error 502 and CORS

I create some listeners to handle event emitted from Smart Contract and error happens:
Access to XMLHttpRequest at 'https://api.trongrid.io/event/contract/TGRcjrgNX2w3yJ8HZkGVEZAxza7fJSTSXB/LoseBet/latest?size=20&page=1&since=1560624083457&fromTimestamp=1560624083457&sort=block_timestamp' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

https://api.trongrid.io/event/contract/TGRcjrgNX2w3yJ8HZkGVEZAxza7fJSTSXB/LoseBet/latest?size=20&page=1&since=1560624083457&fromTimestamp=1560624083457&sort=block_timestamp
Return empty Array

But when I manually change to
https://api.trongrid.io/event/contract/TGRcjrgNX2w3yJ8HZkGVEZAxza7fJSTSXB/LoseBet/?fromTimestamp=1560624083457&sort=block_timestamp
it returns data

You can check because this is on MAINNET. Thanks

Contract has not been deployed on the network

I'm trying to deploy a contract using solc-js and tronweb on shasta testnet. However, when I call tronWeb.contract().new(opts), I get the following error which doesn't really tell me what is wrong:

Contract has not been deployed on the network

I am able to deploy a different contract with my code so it's not an issue with the account or setup of tronWeb object. Here's the full value of opts in JSON:

{
  "abi": [
    {
      "constant": true,
      "inputs": [
        {
          "name": "currencyKey",
          "type": "bytes32"
        }
      ],
      "name": "rateIsStale",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "currencyKeys",
          "type": "bytes32[]"
        }
      ],
      "name": "lastRateUpdateTimesForCurrencies",
      "outputs": [
        {
          "name": "",
          "type": "uint256[]"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "rateStalePeriod",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "_owner",
          "type": "address"
        }
      ],
      "name": "nominateNewOwner",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "initiationTime",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "_beneficiary",
          "type": "address"
        }
      ],
      "name": "setSelfDestructBeneficiary",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "currencyKey",
          "type": "bytes32"
        }
      ],
      "name": "removeAggregator",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "currencyKeys",
          "type": "bytes32[]"
        }
      ],
      "name": "anyRateIsStale",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "name": "invertedKeys",
      "outputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [],
      "name": "terminateSelfDestruct",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "currencyKey",
          "type": "bytes32"
        },
        {
          "name": "aggregatorAddress",
          "type": "address"
        }
      ],
      "name": "addAggregator",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "currencyKey",
          "type": "bytes32"
        }
      ],
      "name": "deleteRate",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "name": "aggregatorKeys",
      "outputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "nominatedOwner",
      "outputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "sourceCurrencyKey",
          "type": "bytes32"
        },
        {
          "name": "sourceAmount",
          "type": "uint256"
        },
        {
          "name": "destinationCurrencyKey",
          "type": "bytes32"
        }
      ],
      "name": "effectiveValue",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "name": "aggregators",
      "outputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "name": "inversePricing",
      "outputs": [
        {
          "name": "entryPoint",
          "type": "uint256"
        },
        {
          "name": "upperLimit",
          "type": "uint256"
        },
        {
          "name": "lowerLimit",
          "type": "uint256"
        },
        {
          "name": "frozen",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [],
      "name": "acceptOwnership",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "_time",
          "type": "uint256"
        }
      ],
      "name": "setRateStalePeriod",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "_oracle",
          "type": "address"
        }
      ],
      "name": "setOracle",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "oracle",
      "outputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "name": "isXDRParticipant",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "owner",
      "outputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [],
      "name": "selfDestruct",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "SELFDESTRUCT_DELAY",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "name": "xdrParticipants",
      "outputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "currencyKey",
          "type": "bytes32"
        }
      ],
      "name": "rateForCurrency",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "currencyKey",
          "type": "bytes32"
        }
      ],
      "name": "rateIsFrozen",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "currencyKey",
          "type": "bytes32"
        },
        {
          "name": "entryPoint",
          "type": "uint256"
        },
        {
          "name": "upperLimit",
          "type": "uint256"
        },
        {
          "name": "lowerLimit",
          "type": "uint256"
        },
        {
          "name": "freeze",
          "type": "bool"
        },
        {
          "name": "freezeAtUpperLimit",
          "type": "bool"
        }
      ],
      "name": "setInversePricing",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "selfDestructInitiated",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "currencyKeys",
          "type": "bytes32[]"
        }
      ],
      "name": "ratesAndStaleForCurrencies",
      "outputs": [
        {
          "name": "",
          "type": "uint256[]"
        },
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [],
      "name": "initiateSelfDestruct",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "currencyKeys",
          "type": "bytes32[]"
        },
        {
          "name": "newRates",
          "type": "uint256[]"
        },
        {
          "name": "timeSent",
          "type": "uint256"
        }
      ],
      "name": "updateRates",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "currencyKeys",
          "type": "bytes32[]"
        }
      ],
      "name": "ratesForCurrencies",
      "outputs": [
        {
          "name": "",
          "type": "uint256[]"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "selfDestructBeneficiary",
      "outputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "currencyKey",
          "type": "bytes32"
        }
      ],
      "name": "removeInversePricing",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "code",
          "type": "bytes32"
        }
      ],
      "name": "lastRateUpdateTimes",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "code",
          "type": "bytes32"
        }
      ],
      "name": "rates",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "name": "_owner",
          "type": "address"
        },
        {
          "name": "_oracle",
          "type": "address"
        },
        {
          "name": "_currencyKeys",
          "type": "bytes32[]"
        },
        {
          "name": "_newRates",
          "type": "uint256[]"
        }
      ],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "newOracle",
          "type": "address"
        }
      ],
      "name": "OracleUpdated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "rateStalePeriod",
          "type": "uint256"
        }
      ],
      "name": "RateStalePeriodUpdated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "currencyKeys",
          "type": "bytes32[]"
        },
        {
          "indexed": false,
          "name": "newRates",
          "type": "uint256[]"
        }
      ],
      "name": "RatesUpdated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "currencyKey",
          "type": "bytes32"
        }
      ],
      "name": "RateDeleted",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "currencyKey",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "name": "entryPoint",
          "type": "uint256"
        },
        {
          "indexed": false,
          "name": "upperLimit",
          "type": "uint256"
        },
        {
          "indexed": false,
          "name": "lowerLimit",
          "type": "uint256"
        }
      ],
      "name": "InversePriceConfigured",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "currencyKey",
          "type": "bytes32"
        }
      ],
      "name": "InversePriceFrozen",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "currencyKey",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "name": "aggregator",
          "type": "address"
        }
      ],
      "name": "AggregatorAdded",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "currencyKey",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "name": "aggregator",
          "type": "address"
        }
      ],
      "name": "AggregatorRemoved",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [],
      "name": "SelfDestructTerminated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "beneficiary",
          "type": "address"
        }
      ],
      "name": "SelfDestructed",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "selfDestructDelay",
          "type": "uint256"
        }
      ],
      "name": "SelfDestructInitiated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "newBeneficiary",
          "type": "address"
        }
      ],
      "name": "SelfDestructBeneficiaryUpdated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnerNominated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "name": "oldOwner",
          "type": "address"
        },
        {
          "indexed": false,
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnerChanged",
      "type": "event"
    }
  ],
  "bytecode": "6080604052612a306008553480156200001757600080fd5b50604051620040883803806200408883398101604090815281516020830151918301516060840151919390810191018380600160a060020a0381161515620000c057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b60008054600160a060020a031916600160a060020a038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600160a060020a03811615156200019157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f776e6572206d757374206e6f74206265207a65726f00000000000000000000604482015290519081900360640190fd5b60038054600160a060020a038316610100810261010060a860020a03199092169190911790915560408051918252517fd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c539181900360200190a15080518251146200028257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f43757272656e6379206b6579206c656e67746820616e642072617465206c656e60448201527f677468206d757374206d617463682e0000000000000000000000000000000000606482015290519081900360840190fd5b82600560006101000a815481600160a060020a030219169083600160a060020a031602179055506200036d7f735553440000000000000000000000000000000000000000000000000000000073c47efc93d47e81c61ce0ebca2749ce73f1332a6763907af6c06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156200032f57600080fd5b505af415801562000344573d6000803e3d6000fd5b505050506040513d60208110156200035b57600080fd5b50514264010000000062000565810204565b6040805160a0810182527f735553440000000000000000000000000000000000000000000000000000000081527f734155440000000000000000000000000000000000000000000000000000000060208201527f7343484600000000000000000000000000000000000000000000000000000000918101919091527f734555520000000000000000000000000000000000000000000000000000000060608201527f734742500000000000000000000000000000000000000000000000000000000060808201526200044490600990600562000ed1565b50600e6020527fd5bf9ee44f917da5fb87fccf9bbe28ed88b1daf1911303038cde0bbfc7f02db48054600160ff1991821681179092557f454cb1132dc71998e5cab516fb2b1a952254a63e76da36fa003b0be1332bec8580548216831790557f9f9848786a04bdcbd6492a2e5e7b940a8e74df2ca361df2419cb747d98ab3bb180548216831790557f6236122a3a6e83f96e638f3925a358c0113f4ca29f62b853055b475aa180400980548216831790557f73474250000000000000000000000000000000000000000000000000000000006000527f09c0da6c09d34a25499c48763bfafcd007810f764fd301bbbc9e7da06c13f08a805490911690911790556200055a828242640100000000620005f0810204565b505050505062000f4d565b604080518082018252600160d860020a03938416815264ffffffffff9283166020808301918252600096875260049052919094209351845491519092167b01000000000000000000000000000000000000000000000000000000029183167fffffffffff00000000000000000000000000000000000000000000000000000090911617909116179055565b6000806000845186511415156200068e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f43757272656e6379206b6579206172726179206c656e677468206d757374206d60448201527f61746368207261746573206172726179206c656e6774682e0000000000000000606482015290519081900360840190fd5b426102580184106200070157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f54696d6520697320746f6f2066617220696e746f207468652066757475726500604482015290519081900360640190fd5b600091505b85518210156200093e5785828151811015156200071f57fe5b90602001906020020151905084828151811015156200073a57fe5b602090810290910101511515620007d857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f5a65726f206973206e6f7420612076616c696420726174652c20706c6561736560448201527f2063616c6c2064656c6574655261746520696e73746561642e00000000000000606482015290519081900360840190fd5b7f73555344000000000000000000000000000000000000000000000000000000008114156200088e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f52617465206f6620735553442063616e6e6f7420626520757064617465642c2060448201527f6974277320616c7761797320554e49542e000000000000000000000000000000606482015290519081900360840190fd5b620008a28164010000000062000a09810204565b841015620008b05762000932565b620008e3818684815181101515620008c457fe5b9060200190602002015162000a30640100000000026401000000009004565b8583815181101515620008f257fe5b602090810290910101528451620009329082908790859081106200091257fe5b906020019060200201518662000565640100000000026401000000009004565b60019091019062000706565b7f1bc0fc8997efa076f59b5ef02c315bc5390f7a6d24d661ce12128c01a3b0ba578686604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015620009a75781810151838201526020016200098d565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015620009e8578181015183820152602001620009ce565b5050505090500194505050505060405180910390a150600195945050505050565b600062000a1f8264010000000062000b61810204565b6020015164ffffffffff1692915050565b6000828152600f60205260408120805482908190811062000a545784935062000b58565b62000a688664010000000062000e43810204565b600384015490925060ff16151562000b5457825462000a97906002640100000000620026fd62000e6982021704565b905084811162000aab576000915062000ac8565b62000ac581866401000000006200309162000ea682021704565b91505b6001830154821062000ae1578260010154915062000af5565b6002830154821162000af557826002015491505b826001015482148062000b0b5750826002015482145b1562000b545760038301805460ff191660011790556040805187815290517f4b3d3f51dab37576ab4ca08ebdb81d4a4c587f25df5cc1f9a620a7faff84aba89181900360200190a15b8193505b50505092915050565b62000b6b62000f16565b600080600062000b7a62000f16565b7f584452000000000000000000000000000000000000000000000000000000000086141562000c62576000935060009250600091505b600582101562000c375762000bdd6009836005811062000bcc57fe5b015464010000000062000b61810204565b805190915062000c06908590600160d860020a0316640100000000620025dd62000ebe82021704565b935082816020015164ffffffffff16111562000c2b57806020015164ffffffffff1692505b60019091019062000bb0565b60408051808201909152600160d860020a038516815264ffffffffff84166020820152945062000e3a565b600086815260066020526040902054600160a060020a03161562000de65760408051808201808352600089815260066020908152848220547f50d25bcd00000000000000000000000000000000000000000000000000000000909352935192938493600160a060020a03909316926350d25bcd92604480870193929182880390910190829087803b15801562000cf757600080fd5b505af115801562000d0c573d6000803e3d6000fd5b505050506040513d602081101562000d2357600080fd5b50516402540be40002600160d860020a0316815260008881526006602090815260408083205481517f8205bf6a000000000000000000000000000000000000000000000000000000008152915194830194600160a060020a0390911693638205bf6a93600480850194919392918390030190829087803b15801562000da757600080fd5b505af115801562000dbc573d6000803e3d6000fd5b505050506040513d602081101562000dd357600080fd5b505164ffffffffff169052945062000e3a565b600086815260046020908152604091829020825180840190935254600160d860020a03811683527b01000000000000000000000000000000000000000000000000000000900464ffffffffff169082015294505b50505050919050565b600062000e598264010000000062000b61810204565b51600160d860020a031692915050565b60008083151562000e7e576000915062000e9f565b5082820282848281151562000e8f57fe5b041462000e9b57600080fd5b8091505b5092915050565b6000808383111562000eb757600080fd5b5050900390565b60008282018381101562000e9b57600080fd5b826005810192821562000f04579160200282015b8281111562000f04578251825560209092019160019091019062000ee5565b5062000f1292915062000f2d565b5090565b604080518082019091526000808252602082015290565b62000f4a91905b8082111562000f12576000815560010162000f34565b90565b61312b8062000f5d6000396000f3006080604052600436106101d65763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416629919c081146101db57806305a046e5146102075780630ee4951b146102ac5780631627540c146102d357806317c70de41461030357806320714f88146103185780632bed9e0c146103465780632d2276741461035e5780632ea913d41461037e5780633278c960146103965780633f0e084f146103ab57806345938849146103dc5780634f72def6146103f457806353a47bb71461040c578063654a60ac1461044a5780637103353e14610468578063728dec291461048057806379ba5097146104c057806379cb657a146104d55780637adbf973146104ed5780637dc0d1d01461051b5780638208e677146105305780638da5cb5b146105485780639cb8a26a1461055d578063a461fc8214610572578063aa687daf14610587578063ac82f6081461059f578063af3aea86146105b7578063b199c764146105cf578063b8225dec146105fa578063babcb4231461060f578063bd32aa44146106c3578063bfa005ce146106d8578063c2c8a67614610707578063c58aaae61461075c578063c8e6f39514610771578063ce8480ea14610789578063dc726205146107a1575b600080fd5b3480156101e757600080fd5b506101f36004356107b9565b604080519115158252519081900360200190f35b34801561021357600080fd5b506040805160206004803580820135838102808601850190965280855261025c953695939460249493850192918291850190849080828437509497506108109650505050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610298578181015183820152602001610280565b505050509050019250505060405180910390f35b3480156102b857600080fd5b506102c1610898565b60408051918252519081900360200190f35b3480156102df57600080fd5b5061030173ffffffffffffffffffffffffffffffffffffffff6004351661089e565b005b34801561030f57600080fd5b506102c16109c3565b34801561032457600080fd5b5061030173ffffffffffffffffffffffffffffffffffffffff600435166109c9565b34801561035257600080fd5b50610301600435610b79565b34801561036a57600080fd5b506101f36004803560248101910135610d5a565b34801561038a57600080fd5b506102c1600435610df5565b3480156103a257600080fd5b50610301610e14565b3480156103b757600080fd5b5061030160043573ffffffffffffffffffffffffffffffffffffffff60243516610f18565b3480156103e857600080fd5b506103016004356111b6565b34801561040057600080fd5b506102c1600435611322565b34801561041857600080fd5b50610421611330565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561045657600080fd5b506102c160043560243560443561134c565b34801561047457600080fd5b506104216004356114d3565b34801561048c57600080fd5b506104986004356114fb565b6040805194855260208501939093528383019190915215156060830152519081900360800190f35b3480156104cc57600080fd5b50610301611525565b3480156104e157600080fd5b50610301600435611676565b3480156104f957600080fd5b5061030173ffffffffffffffffffffffffffffffffffffffff6004351661175d565b34801561052757600080fd5b50610421611888565b34801561053c57600080fd5b506101f36004356118a4565b34801561055457600080fd5b506104216118b9565b34801561056957600080fd5b506103016118d5565b34801561057e57600080fd5b506102c1611ade565b34801561059357600080fd5b506102c1600435611ae5565b3480156105ab57600080fd5b506102c1600435611af9565b3480156105c357600080fd5b506101f3600435611b0a565b3480156105db57600080fd5b50610301600435602435604435606435608435151560a4351515611b22565b34801561060657600080fd5b506101f3611faf565b34801561061b57600080fd5b506040805160206004803580820135838102808601850190965280855261066495369593946024949385019291829185019084908082843750949750611fb89650505050505050565b604051808060200183151515158152602001828103825284818151815260200191508051906020019060200280838360005b838110156106ae578181015183820152602001610696565b50505050905001935050505060405180910390f35b3480156106cf57600080fd5b506103016120f1565b3480156106e457600080fd5b506101f36024600480358281019290820135918135918201910135604435612204565b34801561071357600080fd5b506040805160206004803580820135838102808601850190965280855261025c953695939460249493850192918291850190849080828437509497506123209650505050505050565b34801561076857600080fd5b506104216123a1565b34801561077d57600080fd5b506103016004356123c2565b34801561079557600080fd5b506102c1600435612592565b3480156107ad57600080fd5b506102c16004356125ae565b60007f73555344000000000000000000000000000000000000000000000000000000008214156107eb5750600061080b565b426108076008546107fb85612592565b9063ffffffff6125dd16565b1090505b919050565b60608060008351604051908082528060200260200182016040528015610840578160200160208202803883390190505b509150600090505b835181101561089157610871848281518110151561086257fe5b90602001906020020151612592565b828281518110151561087f57fe5b60209081029091010152600101610848565b5092915050565b60085481565b60005473ffffffffffffffffffffffffffffffffffffffff16331461094a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60025481565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a7557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b73ffffffffffffffffffffffffffffffffffffffff81161515610af957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f42656e6566696369617279206d757374206e6f74206265207a65726f00000000604482015290519081900360640190fd5b6003805473ffffffffffffffffffffffffffffffffffffffff831661010081027fffffffffffffffffffffff0000000000000000000000000000000000000000ff9092169190911790915560408051918252517fd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c539181900360200190a150565b60008054819073ffffffffffffffffffffffffffffffffffffffff163314610c2857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b60008381526006602052604090205473ffffffffffffffffffffffffffffffffffffffff169150811515610cbd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4e6f2061676772656761746f722065786973747320666f72206b657900000000604482015290519081900360640190fd5b600083815260066020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610cfc8360076125f6565b90508015610d55576040805184815273ffffffffffffffffffffffffffffffffffffffff8416602082015281517fec70e890fc7db7de4059b114c9093a1f41283d18ffcfbcac45566feea4d4f777929181900390910190a15b505050565b6000805b82811015610deb57838382818110610d7257fe5b9050602002013560001916600019167f735553440000000000000000000000000000000000000000000000000000000014158015610dd5575042610dd36008546107fb8787868181101515610dc357fe5b9050602002013560001916612592565b105b15610de35760019150610891565b600101610d5e565b5060009392505050565b6010805482908110610e0357fe5b600091825260209091200154905081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ec057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b60006002819055600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556040517f6adcc7125002935e0aa31697538ebbd65cfddf20431eb6ecdcfc3e238bfd082c9190a1565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610fc557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b81905060008173ffffffffffffffffffffffffffffffffffffffff16638205bf6a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561102e57600080fd5b505af1158015611042573d6000803e3d6000fd5b505050506040513d602081101561105857600080fd5b505110156110c757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f476976656e2041676772656761746f7220697320696e76616c69640000000000604482015290519081900360640190fd5b60008381526006602052604090205473ffffffffffffffffffffffffffffffffffffffff16151561112857600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018390555b60008381526006602090815260409182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff851690811790915582518681529182015281517f0bcae573430f69c5361e5d76534d3f61d2d803958778680cd74be9dc6299bc63929181900390910190a1505050565b60055473ffffffffffffffffffffffffffffffffffffffff16331461126257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4f6e6c7920746865206f7261636c652063616e20706572666f726d207468697360448201527f20616374696f6e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600061126d826125ae565b116112d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f52617465206973207a65726f0000000000000000000000000000000000000000604482015290519081900360640190fd5b600081815260046020908152604080832092909255815183815291517fe69d655565c7ff1353d8eaeea62fb7904fa9696987431ec351be288c865f1ae19281900390910190a150565b6007805482908110610e0357fe5b60015473ffffffffffffffffffffffffffffffffffffffff1681565b600083611358816107b9565b156113ea57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f52617465207374616c65206f72206e6f6e6578697374616e742063757272656e60448201527f6379000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b826113f4816107b9565b1561148657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f52617465207374616c65206f72206e6f6e6578697374616e742063757272656e60448201527f6379000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b85841415611496578492506114ca565b6114c76114a285611af9565b6114bb6114ae89611af9565b889063ffffffff6126d316565b9063ffffffff6126e816565b92505b50509392505050565b60066020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b600f6020526000908152604090208054600182015460028301546003909301549192909160ff1684565b60015473ffffffffffffffffffffffffffffffffffffffff1633146115d157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527f2063616e20616363657074206f776e6572736869700000000000000000000000606482015290519081900360840190fd5b6000546001546040805173ffffffffffffffffffffffffffffffffffffffff938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461172257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b60088190556040805182815290517f16529d8c407b08938da67de7fa4319199baffce4f5d1971f812cc770b0237e669181900360200190a150565b60005473ffffffffffffffffffffffffffffffffffffffff16331461180957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116919091179182905560408051929091168252517f3df77beb5db05fcdd70a30fc8adf3f83f9501b68579455adbd100b8180940394916020908290030190a150565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b600e6020526000908152604090205460ff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461198257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b60035460ff1615156119f557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f53656c66204465737472756374206e6f742079657420696e6974696174656400604482015290519081900360640190fd5b426224ea0060025401101515611a6c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f53656c662064657374727563742064656c6179206e6f74206d65740000000000604482015290519081900360640190fd5b506003546040805173ffffffffffffffffffffffffffffffffffffffff61010090930492909216808352905190917f8a09e1677ced846cb537dc2b172043bd05a1a81ad7e0033a7ef8ba762df990b7919081900360200190a18073ffffffffffffffffffffffffffffffffffffffff16ff5b6224ea0081565b60098160058110611af257fe5b0154905081565b6000611b04826125ae565b92915050565b6000908152600f602052604090206003015460ff1690565b60005473ffffffffffffffffffffffffffffffffffffffff163314611bce57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b60008511611c3d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f656e747279506f696e74206d7573742062652061626f76652030000000000000604482015290519081900360640190fd5b60008311611cac57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f6c6f7765724c696d6974206d7573742062652061626f76652030000000000000604482015290519081900360640190fd5b848411611d4057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f75707065724c696d6974206d7573742062652061626f76652074686520656e7460448201527f7279506f696e7400000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b611d5185600263ffffffff6126fd16565b8410611de457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f75707065724c696d6974206d757374206265206c657373207468616e20646f7560448201527f626c6520656e747279506f696e74000000000000000000000000000000000000606482015290519081900360840190fd5b848310611e7857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f6c6f7765724c696d6974206d7573742062652062656c6f772074686520656e7460448201527f7279506f696e7400000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6000868152600f602052604081205411611ec257601080546001810182556000919091527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672018690555b6000868152600f6020908152604091829020878155600181018790556002810186905560030180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151517905581518881529081018790528082018690526060810185905290517f37efb38e92b0f94698f6df0c9070e2f00946862a042ac09e34ae8c547684240a916080908290030190a18115611fa7576040805187815290517f4b3d3f51dab37576ab4ca08ebdb81d4a4c587f25df5cc1f9a620a7faff84aba89181900360200190a1611fa78682611f9f5784611fa1565b855b4261272b565b505050505050565b60035460ff1681565b6060600060606000806000611fcb6130a8565b8751604051908082528060200260200182016040528015611ff6578160200160208202803883390190505b509450600093506008549250600091505b87518210156120e357612030888381518110151561202157fe5b906020019060200201516127ca565b905080600001517affffffffffffffffffffffffffffffffffffffffffffffffffffff16858381518110151561206257fe5b602090810290910101528315156120d857878281518110151561208157fe5b602090810290910101517f7355534400000000000000000000000000000000000000000000000000000000148015906120d55750602081015142906120d39064ffffffffff168563ffffffff6125dd16565b105b93505b600190910190612007565b509296919550909350505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461219d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b42600255600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055604080516224ea00815290517fcbd94ca75b8dc45c9d80c77e851670e78843c0d75180cb81db3e2158228fa9a69181900360200190a1565b60055460009073ffffffffffffffffffffffffffffffffffffffff1633146122b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4f6e6c7920746865206f7261636c652063616e20706572666f726d207468697360448201527f20616374696f6e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6123168686808060200260200160405190810160405280939291908181526020018383602002808284375050604080516020808c0282810182019093528b82529095508b94508a935083925085019084908082843750899450612afc9350505050565b9695505050505050565b60608060008351604051908082528060200260200182016040528015612350578160200160208202803883390190505b509150600090505b835181101561089157612381848281518110151561237257fe5b906020019060200201516125ae565b828281518110151561238f57fe5b60209081029091010152600101612358565b600354610100900473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461246f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b6000828152600f6020526040812054116124ea57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f20696e766572746564207072696365206578697374730000000000000000604482015290519081900360640190fd5b6000828152600f6020526040812081815560018101829055600281019190915560030180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905561253e8260106125f6565b9050801561258e5760408051838152600060208201819052818301819052606082015290517f37efb38e92b0f94698f6df0c9070e2f00946862a042ac09e34ae8c547684240a9181900360800190a15b5050565b600061259d826127ca565b6020015164ffffffffff1692915050565b60006125b9826127ca565b517affffffffffffffffffffffffffffffffffffffffffffffffffffff1692915050565b6000828201838110156125ef57600080fd5b9392505050565b6000805b8254811015610deb578254849084908390811061261357fe5b60009182526020909120015414156126cb57828181548110151561263357fe5b6000918252602082200155825483907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061266e57fe5b9060005260206000200154838281548110151561268757fe5b60009182526020909120015582546126c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83016130bf565b5060019150610891565b6001016125fa565b60006125ef8383670de0b6b3a7640000612ed7565b60006125ef8383670de0b6b3a7640000612f16565b6000808315156127105760009150610891565b5082820282848281151561272057fe5b04146125ef57600080fd5b6040805180820182527affffffffffffffffffffffffffffffffffffffffffffffffffffff938416815264ffffffffff9283166020808301918252600096875260049052919094209351845491519092167b01000000000000000000000000000000000000000000000000000000029183167fffffffffff00000000000000000000000000000000000000000000000000000090911617909116179055565b6127d26130a8565b60008060006127df6130a8565b7f58445200000000000000000000000000000000000000000000000000000000008614156128d4576000935060009250600091505b6005821015612896576128346009836005811061282d57fe5b01546127ca565b80519091506128679085907affffffffffffffffffffffffffffffffffffffffffffffffffffff1663ffffffff6125dd16565b935082816020015164ffffffffff16111561288b57806020015164ffffffffff1692505b600190910190612814565b604080518082019091527affffffffffffffffffffffffffffffffffffffffffffffffffffff8516815264ffffffffff841660208201529450612af3565b60008681526006602052604090205473ffffffffffffffffffffffffffffffffffffffff1615612a8b5760408051808201808352600089815260066020908152848220547f50d25bcd0000000000000000000000000000000000000000000000000000000090935293519293849373ffffffffffffffffffffffffffffffffffffffff909316926350d25bcd92604480870193929182880390910190829087803b15801561298157600080fd5b505af1158015612995573d6000803e3d6000fd5b505050506040513d60208110156129ab57600080fd5b50516402540be400027affffffffffffffffffffffffffffffffffffffffffffffffffffff16815260008881526006602090815260408083205481517f8205bf6a00000000000000000000000000000000000000000000000000000000815291519483019473ffffffffffffffffffffffffffffffffffffffff90911693638205bf6a93600480850194919392918390030190829087803b158015612a4f57600080fd5b505af1158015612a63573d6000803e3d6000fd5b505050506040513d6020811015612a7957600080fd5b505164ffffffffff1690529450612af3565b6000868152600460209081526040918290208251808401909352547affffffffffffffffffffffffffffffffffffffffffffffffffffff811683527b01000000000000000000000000000000000000000000000000000000900464ffffffffff169082015294505b50505050919050565b600080600084518651141515612b9957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f43757272656e6379206b6579206172726179206c656e677468206d757374206d60448201527f61746368207261746573206172726179206c656e6774682e0000000000000000606482015290519081900360840190fd5b42610258018410612c0b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f54696d6520697320746f6f2066617220696e746f207468652066757475726500604482015290519081900360640190fd5b600091505b8551821015612e10578582815181101515612c2757fe5b9060200190602002015190508482815181101515612c4157fe5b602090810290910101511515612cde57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f5a65726f206973206e6f7420612076616c696420726174652c20706c6561736560448201527f2063616c6c2064656c6574655261746520696e73746561642e00000000000000606482015290519081900360840190fd5b7f7355534400000000000000000000000000000000000000000000000000000000811415612d9357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f52617465206f6620735553442063616e6e6f7420626520757064617465642c2060448201527f6974277320616c7761797320554e49542e000000000000000000000000000000606482015290519081900360840190fd5b612d9c81612592565b841015612da857612e05565b612dc9818684815181101515612dba57fe5b90602001906020020151612f48565b8583815181101515612dd757fe5b602090810290910101528451612e05908290879085908110612df557fe5b906020019060200201518661272b565b600190910190612c10565b7f1bc0fc8997efa076f59b5ef02c315bc5390f7a6d24d661ce12128c01a3b0ba578686604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015612e77578181015183820152602001612e5f565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015612eb6578181015183820152602001612e9e565b5050505090500194505050505060405180910390a150600195945050505050565b600080600a8304612eee868663ffffffff6126fd16565b811515612ef757fe5b0490506005600a825b0610612f0a57600a015b600a9004949350505050565b600080612f3c84612f3087600a870263ffffffff6126fd16565b9063ffffffff61306e16565b90506005600a82612f00565b6000828152600f602052604081208054829081908110612f6a57849350613065565b612f73866125ae565b600384015490925060ff161515613061578254612f9790600263ffffffff6126fd16565b9050848111612fa95760009150612fbc565b612fb9818663ffffffff61309116565b91505b60018301548210612fd35782600101549150612fe6565b60028301548211612fe657826002015491505b8260010154821480612ffb5750826002015482145b15613061576003830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556040805187815290517f4b3d3f51dab37576ab4ca08ebdb81d4a4c587f25df5cc1f9a620a7faff84aba89181900360200190a15b8193505b50505092915050565b60008080831161307d57600080fd5b828481151561308857fe5b04949350505050565b600080838311156130a157600080fd5b5050900390565b604080518082019091526000808252602082015290565b815481835581811115610d5557600083815260209020610d559181019083016130fc91905b808211156130f857600081556001016130e4565b5090565b905600a165627a7a723058204b73a6604ea38654bc0894dbe7dfc7fff5fadf6a43994d82ce83f5e7bc18ff6b0029",
  "parameters": [
    "TRLpnm6Uz9s2Fcy3Q235k3SiAEBXGJCNq2",
    "TRLpnm6Uz9s2Fcy3Q235k3SiAEBXGJCNq2",
    [
      "0x534e580000000000000000000000000000000000000000000000000000000000"
    ],
    [
      "200000"
    ]
  ],
  "feeLimit": 6900000,
  "callValue": 0,
  "userFeePercentage": 1
}

Any idea of what might be wrong?

Tronlink android application uses tronweb?

Hello, I have a question

I can't find sources of tronlink android application.
I am wondering if it uses tronweb library to sign messages, transactions

I realized that tronlink chrome extension signed message is different from one which is generated by tronlink android application. Furthermore, I noticed that trx.verifyMessage(trx.signMessage) returns true for tronlink chrome extension but, it's always false when using interface provided by android tronlink application, so it seems verify function doesn't much sign function

I will be very glad to get any help or hits related to this subject

TRC20 Transfer Error

image

{ error: 'CONTRACT_VALIDATE_ERROR', message: 'contract validate error : account does not exist' }
it's ok

Can't use the instance of the contract deployed using factory contract

I'm using a factory contract to deploy contracts but unable to use an instance of that deployed contract using tronweb.

I have tried both contract().at('contract _address') and contract(abi,'contract_address') methods but getting "Failed to execute error" on any method call of that contract.

according to the feedback from some people, it looks like it's an issue of tronweb.

Subscribe for account/network change

Is there a way to subscribe for account/network change?

Something like

tronWeb.on('accountChange', (newAccount) => {   
  // Callback
})

tronWeb.on('networkChange', (newNetwork) => {   
  // Callback
})

For now i'm using intervals to check for updates. And it's sure enough not the best way to do this.

[Question] Can I use sendToken function to transfer trc20 token? if not, how?

Use sendToken function transfer trc20 token, but got class org.tron.core.exception.ContractValidateException : No asset! error, code like below:

const tronNode = new TronWeb({
    fullHost: "https://api.shasta.trongrid.io",
});

const tx2 = await tronNode.transactionBuilder.sendToken(from, 100, 'XZJ', to) // XZJ have been recorded
const signedTx2 = TronWeb.utils.crypto.signTransaction(privateKey, tx2)
// console.log(signedTx2)
 tronNode.trx.sendRawTransaction(signedTx2);

The wanted process flow: Create an unsigned tx -> sign transaction with privateKey -> broadcast transaction

PLEASE HELP!

Failed to initialise TronWeb

Hi I get the following error when trying to interact with a webpage with TronLink:

[ERROR]: Failed to initialise TronWeb TypeError: Cannot read property 'filter' of undefined at pageHook.js:44451

This is the line at pageHook.js:44451:

var c = phishingList.filter(function (_ref2) {

`

Error at getTransactionFromAddress(...)

I've got an error from the lib when I would like to retrieve the transactions of an account.

const sendedTransactions = await this.client.trx.getTransactionsFromAddress(account, offset, page);

The error:

Debug: internal, implementation, error 
  TypeError: Cannot read property 'transaction' of null
  at address (/home/ubuntu/bicyclechain/node_modules/tronweb/dist/webpack:/src/lib/trx.js:278:17)
 at process._tickCallback (internal/process/next_tick.js:68:7)

I have synced FullNode and SolidityNode also. From my SolidityNode's config would be important the index.switch = "off".

Can't pass big number to smart contract method

Error: invalid number value (arg="", coderType="uint256", value=1000000000000000000, version=4.0.33)
at Object.n [as throwError] (pageHook.js:22646)
at I.encode (pageHook.js:22646)
at pageHook.js:22646
at Array.forEach ()
at X (pageHook.js:22646)
at ne.encode (pageHook.js:22646)
at ue.encode (pageHook.js:22646)
at e.value (pageHook.js:36175)
at pageHook.js:25264
at new Promise ()

Cannot deploy on mainnet

Hi all, I've tried without success to deploy a contract on the mainnet, the same contract works fine on the testnet but when I tried to deploy it on the mainnet, I obtain a contract address that is relative to an account instead of a contract ( checking with tronscan) I don't understand what is wrong, I am following the same procedure for testnet and mainnet.

getTransactionFromBlock returns only a single tx

Despite the method name, the description for getTransactionFromBlock suggests that all transactions in the given block will be returned.

Gets the array of transactions from a block, if there are any

However, it seems to only return the first transaction.

e.g.

tronWeb.trx.getTransactionFromBlock(11013000).then(console.log)
// {ret: Array(1), signature: Array(1), txID: "33f71d0b00b0accf03ec1e1df00430d0e4f37dbff25dc0a38f626e584cc773b7", raw_data: {…}, raw_data_hex: "0a020b7422085bac0f6559db97da40f8c992c4bf2d5a680801…3d5730b05f06a3ceda2d06c2018cafd9a1f70e2898fc4bf2d"}

That block has 35 txs.

Transaction index can be provided as a second argument, but this appears undocumented.

tronWeb.trx.getTransactionFromBlock(11013000, 10).then(console.log)
// {ret: Array(1), signature: Array(1), txID: "0831386a100ce7c87742f601ae36385e770139aa50f17611be63c6b24d76f8b9", raw_data: {…}, raw_data_hex: "0a020b872208a8d1d05adc8abf0b40b0e192c4bf2d5ab30108…00000000000000000000001709a8f8fc4bf2d9001809bee02"}

How to pass a tuple as an argument?

I need to call a function in my smart contract that accept a tuple as a parameter, but when I do I always get this message:

error Error: types/value length mismatch (coderType="tuple", value=["EMP","DSSADA-DASDASDAS-DSADSAD"], version=4.0.48)

This is how I do it:

 let data = [
            'EMP',
            'DSSADA-DASDASDAS-DSADSAD'
        ]
        let result = await contract.addEmployee(data).send();

How to calculate the bytes size of a transaction?

I want to calculate the net usage before broadcasting the transaction, can I do that with tronweb?
I have found that there is a getRowBytesFromTransactionBase64 function in src/utils/crypto.js, is it the solution? If so, how can I convert a transaction into base64 format?
Thanks a lot!

How to call the fallback function with parameters?

I want to send arbitrary calldata to fallback function. How can i do this?

This code throws an exception: "Error: Invalid argument count provided"

let result = await contract.Fallback('0xff').send({
     feeLimit: 1e7,
     callValue: 0,
     shouldPollResponse: true
});

Some watched events randomly don't show up

I'm using await contract.Method().watch({resourceNode: 'solidityNode'}, (err, res) => {...}); used on a few different methods.

It seems that some of the events do not trigger the function at all and simply go missing, meaning that the Dapp has an incomplete view of the state updates. This is a real nuisance.

I had the same events being listened to on both a Node.js instance and on some webpages using TronLink, and I discovered that the events that go missing are different for each instance (one page showed all the events). This means that the problem is not with the contract invocations or the events themselves but something to do with the code that retrieves the events.

Looking at the code it only seems to check for events every 3 seconds and only gets events for the latest block, so it is possible that it could be completely missing blocks. The getEvents function should check all blocks since the last time it was called, not just the latest block, and even if the interval is set for 20 seconds (simulating some sort of processing delay) it should still pick up all the events for the last few blocks to ensure that none are missed.

It is entirely possible that in a web page processing the UI could delay the getEvents function considerably, so that it gets called every 3 seconds cannot be relied upon. Same in the server, if there are a bunch of events to process from one block that involve heavy processing each, then the next block will be missed, which is not acceptable.

TronWeb.trx.getTransaction can not get fee column.

use shasta testnet to test transaction, the getTransaction not have fee column.

async function getTransaction(id){
    const tx = await tronWeb.trx.getTransaction(id);
    //const tx = await tronWeb.trx.getConfirmedTransaction(id);
    console.log(JSON.stringify(tx, null, 4));
 }

 getTransaction('3e8e9eaadc7ad92e1f7d3674b43468832fb47b73a63bc5ac9795af7019f28104')
{
    "ret": [
        {}
    ],
    "signature": [
        "23f687987f96e337ab76f9837cebbf555a52a8c9b590234ad610c3b6fd3754e857460b1ed3e149c47278ab3214a5b764f4690df5b8c54858ccea6daca3b94ea500"
    ],
    "txID": "3e8e9eaadc7ad92e1f7d3674b43468832fb47b73a63bc5ac9795af7019f28104",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "amount": 1,
                        "owner_address": "41135a0eb3c276fd7c025227fae43e7877ed004fb5",
                        "to_address": "41aaf31a20c9732ec64ffcd60ed9727c31770a27da"
                    },
                    "type_url": "type.googleapis.com/protocol.TransferContract"
                },
                "type": "TransferContract"
            }
        ],
        "ref_block_bytes": "e5d8",
        "ref_block_hash": "a6acddf7c7fcbbba",
        "expiration": 1562831607000,
        "timestamp": 1562831547960
    },
    "raw_data_hex": "0a02e5d82208a6acddf7c7fcbbba40d8a99780be2d5a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541135a0eb3c276fd7c025227fae43e7877ed004fb5121541aaf31a20c9732ec64ffcd60ed9727c31770a27da180170b8dc9380be2d"
}

I also use java/tron to print transaction info, the ret has value but fee always is zero.

String txId = "3e8e9eaadc7ad92e1f7d3674b43468832fb47b73a63bc5ac9795af7019f28104";
Optional<Transaction> result2 = WalletApi.getTransactionById(txId);

hash: b19fc7306233c90e0e0cd4d9d375f9a3efe5d079a47c9a712774b5608641e140
txid: 3e8e9eaadc7ad92e1f7d3674b43468832fb47b73a63bc5ac9795af7019f28104
raw_data: {
	ref_block_bytes: e5d8
	ref_block_hash: a6acddf7c7fcbbba
	contract: {
		contract 0 :::
		[
			contract_type: TransferContract
			owner_address: TBjXj1AqTPMYxs7RHY7C6cnDtdkXBHHG3t
			to_address: TRZ76hR2JmAqfQTsZSM2GApmM6WHK4QSWj
			amount: 1
		]
	}
	timestamp: Thu Jul 11 16:52:27 JST 2019
	fee_limit: 0
}
signature: {
	signature 0 :23f687987f96e337ab76f9837cebbf555a52a8c9b590234ad610c3b6fd3754e857460b1ed3e149c47278ab3214a5b764f4690df5b8c54858ccea6daca3b94ea500
}
ret: {
	result: 0 ::: 
	[
		code ::: SUCESS
		fee ::: 0
		ContractRet ::: DEFAULT
	]
}

I cant get TRC20 transactions to an address

I am using tron web to query transactions of an address but it does not return transactions sent to that address where token transferred is TRC20.

This does not work. I want to get the transactions on an address and get both TRX, trc10 and trc20 transactions.

What am I doing wrong or how to do that?

Here is my code block:

tronWeb.setDefaultBlock("latest");
var result = await tronGrid.account.getTransactions(address, {
only_confirmed: true,
only_to: true,
limit: 10
});
console.log(JSON.stringify(result));
})();

can not get status of transaction

`tronWeb.trx.getTransaction(tx).then(t => {
console.log(JSON.stringify(t, null, 2));
}).catch(err => console.error(err));

{
"ret": [
{}
],
"signature": [
"4cb0051824e370d1dbd251be0e0467910b8ca7495ac1e472ecfe317fd238c2a6604b44a27ab2c8d957e4453d36fbcddf01203fb84ad38be80629ea326043219701"
],
"txID": "2500376771711f9d142941ab1c6dcb70c2bfba8bc9225ce63e650e54cae53df8",
}

there is not status return

"Failed to execute" error when calling contract method

I am trying to implement a Proxy contract that uses delegatecall to proxy method calls to a proxied contract. When I attempt to call one of the proxied method await proxyContract.synthetixProxy().call();, tronweb returns "Failed to execute" and its transaction object looks like:

{ visible: false,
  txID:
   'ca5bc1666d60656d245379fe54336a2e17950963d5c5f5a0b4cc6627650d2e51',
  raw_data:
   { contract: [ [Object] ],
     ref_block_bytes: '3f09',
     ref_block_hash: '3ac9c15edcb67855',
     expiration: 1583557074000,
     fee_limit: 1000000000,
     timestamp: 1583557016105 },
  raw_data_hex:
   '0a023f0922083ac9c15edcb6785540d0b8ed9a8b2e5a6d081f12690a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412340a1541a8a07f09def5e6a4462df90068c11abf6224e865121541337f3081a1fd68f222ccc0c398691ccf811e734b2204bdd1248270a9f4e99a8b2e90018094ebdc03' }

I am not sure how to further debug this issue. From what I understand, the problem is that the transaction does not contain a constant_result property. Why not? How can I debug this issue... I'm lost.

I could provide full code to reproduce if it helps.

High vulnerability issue found when installing tronweb

The elliptic library used should be upgraded to 6.5.3 or later in order to get this issue solved. The version that is comming from tronweb's package.json is 6.4.1 (https://github.com/tronprotocol/tronweb/blob/master/package.json#L28).

Also, ethers library isnt using this elliptic anymore on latest version.

My recommendation:
elliptic to 6.5.3
ethers to 5.0.8

image

Elliptic issue: indutny/elliptic#226
https://vigilance.fr/vulnerability/Node-js-elliptic-information-disclosure-via-ECDSA-Signature-Malleability-32975

Thanks in advance.

How to listen for events from contract that created from other contract

I'm trying to listen to events (or get events) from justSwap liquidity pool. The pool contract is created from JustswapFactory.

My code:

const results = await tronGrid.contract.getEvents(poolAddress, options)
console.log(results.data.length) // 0

The code above is working with normal contract (deployed from tronbox), but CreatedFromContract.
I tried to find the answer on tronWeb.transactionBuilder but no luck.
So, How to listen for events from contract that created from other contract?

Thanks,

error: 'CONTRACT_VALIDATE_ERROR', message: 'contract validate error : Owner no asset!'

method send

const TronWeb = require('tronweb');
const tronWeb = new TronWeb({
	fullHost: 'https://api.shasta.trongrid.io',
	privateKey: 'privatekey'
});

const userBalance = await tronWeb.contract().at('contractaddress');
	const sendf = await userBalance
		.registerStudent(param1, param2 .... paramn)
		.send({
			feeLimit: 100_000_000,
			callValue: 0,
			tokenId: 1000036,
			tokenValue: 100,
			shouldPollResponse: true
		})
		.then((res) => console.log(res))
		.catch((ex) => console.log(ex));

this is my code im getting the above error

i can able to use call() method and get the data in blockchain which is posted from tron ide

contract balanceOf call, response "owner_address isn't set."

// init tronWeb
const TronWeb = require('tronweb')

const tronWeb = new TronWeb({
  fullNode: 'https://api.trongrid.io',
  solidityNode: 'https://api.trongrid.io',
})

// read trc20 account balance
let contract = await tronWeb.contract().at("TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"); 
let result = await contract.balanceOf('TZ13rQk53DDvK2pR4nfBLyuYTR4EGAFBwT').call();

// response error
//(node:49919) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 14): class java.security.InvalidParameterException : owner_address isn't set

Can't trigger specific contracts (ones not returning ABI)

I'm not able to trigger call() on specific contracts - the one's that I have tested and are not working, are created by JustSwap factory (eg TUEYcyPAqc4hTg1fSuBCPc18vGWcJDECVw, TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE ).

I'm submitting it as an issue as:
a) the code below works with different contracts
b) I can call the balanceOf() of JustSwap contracts using http API, so it might suggest tronweb problems with "unpublished ABI" contracts
c) it has also been reported on Tron developers Discord channel by several people.

The error that I get is Failed to execute

As I do only need the balanceOf() this is my defined abi :

[
  {
    "constant": true,
    "inputs": [{ "name": "who", "type": "address" }],
    "name": "balanceOf",
    "outputs": [{ "name": "", "type": "uint256" }],
    "payable": false,
    "stateMutability": "view",
    "type": "function"
  }
]

and my code:

import ABI from "./abi.json";
const getDataToken = async (contractAddress, account, account2) => {
  try {
    let abi = ABI;
    const instance = await window.tronWeb.contract(abi, contractAddress);
    if (instance.balanceOf) {
      const tokenBalance = await instance.balanceOf(account).call();
      return {
        tokenBalance: (tokenBalance / Math.pow(10, 18)).toString(),
        tokenContract: instance,
      };
    }
  } catch (error) {
    console.log("error  getData  :" + error);
  }
};

TAPOS_ERROR

when I submit my transaction. return this error(TAPOS_ERROR) to me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.