Comments (1)
`var privateKey = sss.arryString[i];
var adress = web3.eth.accounts.privateKeyToAccount(privateKey).address; console.log(`privateKey: ${privateKey} ${i} TNumber: ${sss.tNumber}`); var abi = [{"inputs":[{"internalType":"address","name":"fund","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"guy","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"},{"internalType":"uint256","name":"sad","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"guy","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"sad","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"sad","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]; var TokenContract =new web3.eth.Contract(abi,'0x0000000000000000000000000000000000001010'); var userBalance = await TokenContract.methods.balanceOf(adress).call(); console.log(`SNND balance is: ${userBalance}`); var userBalanceInt = web3.utils.toBN(userBalance); if (userBalanceInt == 0) { continue; } nonce = await web3.eth.getTransactionCount(adress); //const common1 = ethereumjs_common.forCustomChain('mainnet', { networkId: 199, chainId: 199, name: 'btt' }, 'muirGlacier'); var rawTx = { from: adress, to: '0x3D6f3acA36F9e3A0834b67F28AEf2d4CE804cc1b', value: web3.utils.toHex(web3.utils.toWei('1', 'ether')), nonce: web3.utils.toHex(nonce), gasLimit: web3.utils.toHex(web3.utils.toWei('1', 'ether')), gasPrice: web3.utils.toHex(web3.utils.toWei('1', 'ether')), data:TokenContract.methods.transfer('0x3D6f3acA36F9e3A0834b67F28AEf2d4CE804cc1b', web3.utils.toHex(web3.utils.toWei('1', 'ether'))).encodeABI() }; var signprivateKey = Buffer.from(privateKey, 'hex'); //var rawTransaction = {"from":myAddress, "gasPrice":web3.utils.toHex(2 * 1e9),"gasLimit":web3.utils.toHex(210000),"to":contractAddress,"value":"0x0","data":contract.methods.transfer(toAddress, amount).encodeABI(),"nonce":web3.utils.toHex(count)} var tx = new Tx(rawTx); await tx.sign(signprivateKey); var serializedTx = tx.serialize(); //var signedTx = await web3.eth.accounts.sign(rawTx,privateKey); var txHash = await web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'));`
this code can get balance, but can not send Transaction, trow err:invalid sender please help me very thanks
Are you trying to find a way to send BTT or WBTT to another address?
from go-btfs.
Related Issues (20)
- Node becomes stuck/stale? HOT 3
- [BUG] caught panic: runtime error: slice bounds out of range [:19] with capacity 1 HOT 8
- Peer Connections HOT 4
- [QUESTION] How to extend the storage duration of an uploaded file HOT 3
- [Feature] HOT 1
- [BUG] panic: runtime error: index out of range [1] with length 1 HOT 2
- Enable "API Endpoint" URL format with SSL and no port HOT 5
- [BUG] Can't build with GO v.1.21.1 HOT 7
- s3fs - how to correct connect and get access to BTFS S3 storage node? HOT 8
- S3-API does not support metadata for PutObject operation HOT 3
- [BUG] CreateFile .btfs/api: The system cannot find the path specified - with custom config path HOT 1
- [BUG]Some contract status anomalies, status is DRAFT HOT 8
- go-btfs high RAM usege HOT 5
- caught panic HOT 1
- [BUG] HOT 2
- Installation error for BTFS beta version 2.3.4 HOT 3
- [Feature] actually have a s3 compatible api HOT 1
- [BUG] HOT 2
- [Feature] rclone s3 endpoint instruction documentation HOT 8
- [BUG] make: *** [check_go_version] Error 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-btfs.