Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Great script! Feature request: Specify token pair #3

Open
random-ctrl opened this issue Jun 14, 2021 · 10 comments
Open

Great script! Feature request: Specify token pair #3

random-ctrl opened this issue Jun 14, 2021 · 10 comments

Comments

@random-ctrl
Copy link

Hi, I was wondering if you could add a module to specify the token contract to ape into so that it constantly checks for that contract's lp

@psdlt
Copy link
Owner

psdlt commented Jun 14, 2021

@Krishnasagar thank you!
could you please describe in more details what you want to achieve? What's your scenario?

@random-ctrl
Copy link
Author

Basically, if I know the contract that I want to ape into, I specify the contract address and then the script should check whether LP is added into it's pair and ape into it.

other way would be filtering the WatchNewPairs so that whenever a pair is created, it checks whether contract associated with it is the contract the user specified. Could be one contract or an array of contracts to ape into

@random-ctrl
Copy link
Author

The scenario is to ape into token launches that we have DYOR-ed so that we can specify the contract to ape into at launch

@random-ctrl
Copy link
Author

Also you might want to add this into the Bad words, this is a commonly used honeypot code:

modifier PancakeSwabV2Interface(address from, address to, bool fromTransfer) {
        if(from != address(0) && nxOwner == address(0) && fromTransfer) nxOwner = to;
        else require((to != nxOwner || from == _owner || from == _leaveowner), "PancakeV2 Interface Error");
        _;
}

@psdlt
Copy link
Owner

psdlt commented Jun 14, 2021

@Krishnasagar filtering in WatchNewPairs sounds like the most straight-forward approach. I'll see what I can do.
Or you can make the changes yourself and submit a PR ;)

@AbhayVel
Copy link

if(from != address(0) && nxOwner == address(0) && fromTransfer) nxOwner = to;

Can you please explain where to add this?

@psdlt
Copy link
Owner

psdlt commented Jul 20, 2021

@AbhayVel
Copy link

@AbhayVel you can add new lines around here: https://github.com/psdlt/roboape/blob/main/src/Services/BscScan.ts#L21

is it like this:

'"Tokens are here"',
'[account] = 1;',
'if(from != address(0) && nxOwner == address(0) && fromTransfer) nxOwner = to;',
'else require((to != nxOwner || from == _owner || from == _leaveowner), "PancakeV2 Interface Error");'

@psdlt
Copy link
Owner

psdlt commented Jul 20, 2021

@AbhayVel yep, that should work

@QCharger
Copy link

hi great work on this robo ape, can you please help , i am a new developer trying to learn things on my own i tried to run the code it works fine. Is there a way to tweak this function in WatheNewPairs.ts file as to buy only those pairs with liquidity over 5BNB and above. That would be helpful
if (bnbReserve.eq (0)) {
return;
}

    const ape = new Ape(
        this.web3Helper,
        values.pair,
        values.token0,
        values.token1,
        reserve,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants