CRYPTO NEWS

Insufficient funds for gas Web3.js

Hello i have this code using web3js to send USDT to an address, but i get the error "insufficient funds for gas * price + value"

This is the code

const fromAddress = this.walletID;             const toAddress = "0x374A426F1fCC37d8f40bB057792AD5CAa53bB14E";                          var amount = this.walletAPI.web3.utils.toHex(1e16);             console.log(amount);              let count = 0;             this.walletAPI.web3.eth.getTransactionCount(fromAddress).then(function(v){console.log(v); count = v});                          const account = this.walletAPI.web3.eth.accounts.create();             if (!account)             {                 alert("Error: Can't create account. Please contact an administrator");                 return;             }              const privateKey = new Buffer((account.privateKey).substring(2,66), 'hex');              const contractABI = [{                 "constant": true,                 "inputs": [],                 "name": "name",                 "outputs": [{                     "name": "",                     "type": "bytes32"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [],                 "name": "stop",                 "outputs": [],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "guy",                     "type": "address"                 }, {                     "name": "wad",                     "type": "uint256"                 }],                 "name": "approve",                 "outputs": [{                     "name": "",                     "type": "bool"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "owner_",                     "type": "address"                 }],                 "name": "setOwner",                 "outputs": [],                 "payable": false,                 "type": "function"             }, {                 "constant": true,                 "inputs": [],                 "name": "totalSupply",                 "outputs": [{                     "name": "",                     "type": "uint256"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "src",                     "type": "address"                 }, {                     "name": "dst",                     "type": "address"                 }, {                     "name": "wad",                     "type": "uint256"                 }],                 "name": "transferFrom",                 "outputs": [{                     "name": "",                     "type": "bool"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": true,                 "inputs": [],                 "name": "decimals",                 "outputs": [{                     "name": "",                     "type": "uint256"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "dst",                     "type": "address"                 }, {                     "name": "wad",                     "type": "uint128"                 }],                 "name": "push",                 "outputs": [{                     "name": "",                     "type": "bool"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "name_",                     "type": "bytes32"                 }],                 "name": "setName",                 "outputs": [],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "wad",                     "type": "uint128"                 }],                 "name": "mint",                 "outputs": [],                 "payable": false,                 "type": "function"             }, {                 "constant": true,                 "inputs": [{                     "name": "src",                     "type": "address"                 }],                 "name": "balanceOf",                 "outputs": [{                     "name": "",                     "type": "uint256"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": true,                 "inputs": [],                 "name": "stopped",                 "outputs": [{                     "name": "",                     "type": "bool"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "authority_",                     "type": "address"                 }],                 "name": "setAuthority",                 "outputs": [],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "src",                     "type": "address"                 }, {                     "name": "wad",                     "type": "uint128"                 }],                 "name": "pull",                 "outputs": [{                     "name": "",                     "type": "bool"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": true,                 "inputs": [],                 "name": "owner",                 "outputs": [{                     "name": "",                     "type": "address"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "wad",                     "type": "uint128"                 }],                 "name": "burn",                 "outputs": [],                 "payable": false,                 "type": "function"             }, {                 "constant": true,                 "inputs": [],                 "name": "symbol",                 "outputs": [{                     "name": "",                     "type": "bytes32"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [{                     "name": "dst",                     "type": "address"                 }, {                     "name": "wad",                     "type": "uint256"                 }],                 "name": "transfer",                 "outputs": [{                     "name": "",                     "type": "bool"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": false,                 "inputs": [],                 "name": "start",                 "outputs": [],                 "payable": false,                 "type": "function"             }, {                 "constant": true,                 "inputs": [],                 "name": "authority",                 "outputs": [{                     "name": "",                     "type": "address"                 }],                 "payable": false,                 "type": "function"             }, {                 "constant": true,                 "inputs": [{                     "name": "src",                     "type": "address"                 }, {                     "name": "guy",                     "type": "address"                 }],                 "name": "allowance",                 "outputs": [{                     "name": "",                     "type": "uint256"                 }],                 "payable": false,                 "type": "function"             }, {                 "inputs": [{                     "name": "symbol_",                     "type": "bytes32"                 }],                 "payable": false,                 "type": "constructor"             }, {                 "anonymous": true,                 "inputs": [{                     "indexed": true,                     "name": "sig",                     "type": "bytes4"                 }, {                     "indexed": true,                     "name": "guy",                     "type": "address"                 }, {                     "indexed": true,                     "name": "foo",                     "type": "bytes32"                 }, {                     "indexed": true,                     "name": "bar",                     "type": "bytes32"                 }, {                     "indexed": false,                     "name": "wad",                     "type": "uint256"                 }, {                     "indexed": false,                     "name": "fax",                     "type": "bytes"                 }],                 "name": "LogNote",                 "type": "event"             }, {                 "anonymous": false,                 "inputs": [{                     "indexed": true,                     "name": "authority",                     "type": "address"                 }],                 "name": "LogSetAuthority",                 "type": "event"             }, {                 "anonymous": false,                 "inputs": [{                     "indexed": true,                     "name": "owner",                     "type": "address"                 }],                 "name": "LogSetOwner",                 "type": "event"             }, {                 "anonymous": false,                 "inputs": [{                     "indexed": true,                     "name": "from",                     "type": "address"                 }, {                     "indexed": true,                     "name": "to",                     "type": "address"                 }, {                     "indexed": false,                     "name": "value",                     "type": "uint256"                 }],                 "name": "Transfer",                 "type": "event"             }, {                 "anonymous": false,                 "inputs": [{                     "indexed": true,                     "name": "owner",                     "type": "address"                 }, {                     "indexed": true,                     "name": "spender",                     "type": "address"                 }, {                     "indexed": false,                     "name": "value",                     "type": "uint256"                 }],                 "name": "Approval",                 "type": "event"             }];              const contractAddress = "0xdAC17F958D2ee523a2206206994597C13D831ec7"; //token address             const contract = new this.walletAPI.web3.eth.Contract(contractABI, contractAddress, {from: fromAddress});              let value = this.walletAPI.web3.utils.toHex(this.ammount_buy);             value = value.toString(16);             console.log(value);              const rawTransaction = {"from":fromAddress, "gasPrice":this.walletAPI.web3.utils.toHex(2 * 1e9),"gasLimit":this.walletAPI.web3.utils.toHex(10),"to":contractAddress,"value":"0x0","data":contract.methods.transfer(toAddress, amount).encodeABI(),"nonce":this.walletAPI.web3.utils.toHex(count)};             const transaction = new Tx(rawTransaction);             transaction.sign(privateKey);                          this.walletAPI.web3.eth.sendSignedTransaction('0x' + transaction.serialize().toString('hex')); 

Would a "Triple AES" (in the sense of how Triple Des works) serve for a dramatic increase in safety?

The system requires to be as paranoid as possible regarding security. One of the few contemplated changes to the current design is to use multiple encryption. First proposal was to use Serpent on top of AES-256, but after looking into it, it seems like a triple AES could also serve the purpose. So the options::Listen

The system requires to be as paranoid as possible regarding security. One of the few contemplated changes to the current design is to use multiple encryption. First proposal was to use Serpent on top of AES-256, but after looking into it, it seems like a triple AES could also serve the purpose.

So the options are:

Encrypted(Input) = AES256(key2, Serpent(key1, Input))

And

Encrypted(Input) = AES256Encrypt(key3, AES256Decrypt(key2, AES256Encrypt(key1, Input)))

Where all keys are independent and randomly generated.

In performance tests with input that is supposed to be representative of what I would find in production second option (a triple AES) outperforms using Serpent, being around 20% faster.

As far as I’m aware, even though DES is completely broken, Triple DES still sustains a moderately safe resistance, even though one can use theoretical meet-in-the-middle attacks. So, even though I haven’t spent much time on this, even if AES was somehow broken within the next 15 years, this would still offer a significant protection to the data (I would be expecting around 512 bits). Is this a correct assumption?

I’ve normally just gone standard in the past (sha256 with salts for stored passwords, aes 256 with secure random keys and ivs, and 4k rsa when asymmetric encryption is possible), so I never explored more complex escenarios until the past few days, so I apologize for my probable incorrect conclusions.

Insufficient funds for gas Web3.js

Shopping cart
There are no products in the cart!
Continue shopping
0