slisBNBx
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
git clone https://github.com/slisBNBx/smart-contracts.git
cd smart-contractstruffle compiletruffle migrate --network bscTestnetconst Web3 = require('web3');
const provider = new Web3.providers.HttpProvider('https://data-seed-prebsc-1-s1.binance.org:8545');
const web3 = new Web3(provider);const liquidityContract = new web3.eth.Contract(liquidityABI, liquidityAddress);
liquidityContract.methods.addLiquidity(tokenA, tokenB, amountA, amountB).send({ from: userAddress })
.then(function(result) {
console.log('Liquidity added:', result);
})
.catch(function(error) {
console.error('Error adding liquidity:', error);
});