You are on page 1of 4

Hướng dẫn làm Bot MetaMask by VUONG LEE Tele: @Vuonleee

https://medium.com/coinmonks/how-to-snipe-bsc-token-launches-like-a-degen-ape-eff4d28b23ce

Bước 1 tải nodejs nha mn

cài đặt settup xong rồi vô cmd thao tác

cmd thì mn cài kiểu này nè

npm install --save ethers

npm install --save prompt-sync

là cài xong 2 cái package

&&& COPY CODE này về sửa lại

*============================================================================
const ethers = require('ethers');
const prompt = require('prompt-sync')({sigint: true});

const addresses = {
WBNB: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
router: "0x10ed43c718714eb63d5aa57b78b54704e256024e",
target: "0x8129686c77E63C22bE6a7F06F9C61f135BD0a0CF" // Change this to your
address ELSE YOU GONNA SEND YOUR BEANS TO ME
}

const BNBAmount = ethers.utils.parseEther('0.1').toHexString();


const gasPrice = ethers.utils.parseUnits('10', 'gwei');
const gas = {
gasPrice: gasPrice,
gasLimit: 300000
}

const mnemonic = 'PUT YOUR MNEMONIC HERE';


const provider = new ethers.providers.WebSocketProvider('wss://bsc-ws-
node.nariox.org:443');
const wallet = ethers.Wallet.fromMnemonic(mnemonic);
const account = wallet.connect(provider);

const router = new ethers.Contract(


addresses.router,
[
'function swapExactETHForTokens(uint amountOutMin, address[] calldata
path, address to, uint deadline) external payable returns (uint[] memory
amounts)'
],
account
);

const snipe = async (token) => {


const tx = await router.swapExactETHForTokens(
0, // Degen ape don't give a fuxk about slippage
[addresses.WBNB, token],
addresses.target,
Math.floor(Date.now() / 1000) + 60 * 10, // 10 minutes from now
{
...gas,
value: BNBAmount
}
);
console.log(`Swapping BNB for tokens...`);
const receipt = await tx.wait();
console.log(`Transaction hash: ${receipt.transactionHash}`);
}

const token = prompt('Input token address:');

(async () => {
await snipe(token);
})();

*================================================================================

xong sau đó thì mn lưu file code trên medium thành pcsbuy.js

đuôi js nha

lưu bằng ide hay notepad gì cũng đc

Sau đó mình sẽ edit một số code ở đây nha mn

const privateKey = 'private key';

const provider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed.binance.org/');

const wallet = new ethers.Wallet(privateKey);

const account = wallet.connect(provider);

đổi mnenomic thành đoạn privite key

Đổi target này thành ví của mình nha mn, cái nãy kĩ nên nhớ
Đoạn code này là chỉnh gas và số min bnb mua được

Mn tuỳ chỉnh theo ý muốn nha

Ví dụ như chỉnh code là 0.1 bnb thì trong ví phải có ít nhất 0.1 bnb và phí gas thì mới giao dịch được

Mn test thì cứ test thử 0.01bnb mua thử token nào cũng được

Vuong Lee, [12/19/2021 12:33 AM]

[ Photo ]

Cái này code chỉnh slip, ko biết đúng ko nữa ai confirm lại giúp em mà đổi đoạn này thì vẫn mua được

(0 là chấp nhận mọi trượt giá, ko quan tâm slippage – LUAN HA Confirm)

mn chỉnh xong lưu lại nha

xong vô cmd mở file pcsbuy.js (file code vừa sửa xong á)

file nằm ở đâu thì cd tới đó

ví dụ file nằm ở document thì cd documents

xong bước cuối là gõ : node pcsbuy.js

là xong
Như này là xong nha

You might also like