You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First - sorry for my noobness, with a little initial guidance I should be able to wrap my head around this quickly.
I'm trying to automate sending Membership Commissions pending to each member's USDT Wallet from the Commissions USDT Wallet. globals: $usdtradd, $privkey, and $pendamt for a function that returns $txhash. Will hard code USDT Send Address and contract address. The more I search for examples, the more random results I get, each completely different than the last so I'm getting confused and frustrated. And help or advice greatly appreciated.
I came across web3 snippet to send USDT and was hoping to convert it to php:
var { Web3 } = require("web3");
var provider = "https://mainnet.infura.io/v3/YOUR-API-KEY";
var web3Provider = new Web3.providers.HttpProvider(provider);
var web3 = new Web3(web3Provider);
// just the transfer() function is sufficient in this case
const ERC20_ABI = [
{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},
];
async function run() {
const tokenContract = new Web3.eth.Contract(USDTAddress, ERC20_ABI);
const to = "0x123"; //$usdtaddr
const amount = "1000000"; // $amt: send 1 USDT - don't forget to account for the decimals - 6 for USDT
// invoking the `transfer()` function of the contract
const transaction = await tokenContract.methods.transfer(to, amount).send({from: SENDER_ADDRESS});
} //SENDER_ADDRESS is USDT_ADDRESS (contract address)? Not clear on this value needed here
run();
//end
This is what I have so far for php (not much but struggling to convert the web3.js script)
use Web3\Web3;
use Web3\Providers\HttpProvider;
use Web3\Contract;
function sendUSDT() {
global $pkey, $usdtadd, $commpend;
$web3 = new Web3(new HttpProvider('https://mainnet.infura.io/v3/API_KEY'));
$eth = $web3->eth;
}
The text was updated successfully, but these errors were encountered:
skykingisepic
changed the title
No Composer - Files/Folders Required? Convert ether.js USDT Script to php?
Convert ether.js USDT Script to php?
Sep 29, 2024
skykingisepic
changed the title
Convert ether.js USDT Script to php?
Convert ether.js USDT Script to web3.php?
Sep 29, 2024
First - sorry for my noobness, with a little initial guidance I should be able to wrap my head around this quickly.
I'm trying to automate sending Membership Commissions pending to each member's USDT Wallet from the Commissions USDT Wallet. globals: $usdtradd, $privkey, and $pendamt for a function that returns $txhash. Will hard code USDT Send Address and contract address. The more I search for examples, the more random results I get, each completely different than the last so I'm getting confused and frustrated. And help or advice greatly appreciated.
I came across web3 snippet to send USDT and was hoping to convert it to php:
var { Web3 } = require("web3");
var provider = "https://mainnet.infura.io/v3/YOUR-API-KEY";
var web3Provider = new Web3.providers.HttpProvider(provider);
var web3 = new Web3(web3Provider);
const USDTAddress = "0xAB0874D3e7Cd256Cd3F1A9480c3b0C01109E2117"; //sender contract address?
// just the
transfer()
function is sufficient in this caseconst ERC20_ABI = [
{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},
];
web3.eth.accounts.wallet.add(SENDER_PRIVATE_KEY); //$pkey
async function run() {
const tokenContract = new Web3.eth.Contract(USDTAddress, ERC20_ABI);
} //SENDER_ADDRESS is USDT_ADDRESS (contract address)? Not clear on this value needed here
run();
//end
This is what I have so far for php (not much but struggling to convert the web3.js script)
use Web3\Web3;
use Web3\Providers\HttpProvider;
use Web3\Contract;
function sendUSDT() {
global $pkey, $usdtadd, $commpend;
$web3 = new Web3(new HttpProvider('https://mainnet.infura.io/v3/API_KEY'));
$eth = $web3->eth;
}
The text was updated successfully, but these errors were encountered: