hello noob question,
is it possible to do this type of thing
1) save msg.sender to private variable as "previous msg.sender" / to-be used for validation
2) save block.number or block.timestamp as "previous block.number or block.timestamp" / to-be used for validation
working on related to token development specific during transfers
i want to try and setup a contract to auto-ban those using those trading bots/snipers
Jul 18, 2021, 10:44 AM
not worth trying
as it would have false positives
99% of the time
Jul 18, 2021, 10:48 AM
T_T just when i finally got the idea so it might be a bad try
bec i got data how it behaves, multiple buys in same block.number or timestamp
coming from the same msg.sender but if it could have false positive then forget it lmao
Jul 18, 2021, 10:50 AM
you could do that
Jul 18, 2021, 10:54 AM
i dont know how to write it though
just the idea will study more
Jul 18, 2021, 10:55 AM
uint256 private lastTimestamp;
address private lastSender;
modifier toNotBeCalledAgain {
require (_msgSender() != lastSender && /* or || */ lastTimestamp != block.timestamp);
lastTimestamp = block.timestamp;
lastSender = _msgSender()
_;
}
address private lastSender;
modifier toNotBeCalledAgain {
require (_msgSender() != lastSender && /* or || */ lastTimestamp != block.timestamp);
lastTimestamp = block.timestamp;
lastSender = _msgSender()
_;
}
@bronersick
only problem is, that it would add a lot more gas
and it is probably not worth it
like 40k per function call
Jul 18, 2021, 10:58 AM
shitt
the idea is to put the saving of previous timestamp/block/sender after it made a first txn, the validation in transfer is the second step
so it needs to pass first then do this modifier, then save information and then when it does a transfer again there it auto-bans
but if it requires 40k thats not worth it
Jul 18, 2021, 11:00 AM
depends, if you want it to only check block.timestamp it could cost 20k
if you don't want a contract to call the function multiple times
Jul 18, 2021, 11:01 AM
yeah i think block.timestamp works bec its impossible to make multiple txn in the same timestamp
Jul 18, 2021, 11:01 AM
if thats what you want
Jul 18, 2021, 11:01 AM
for human it is impossible*
though i dont understand how modifiers are called
are they like the ones you call in read or write
Jul 18, 2021, 11:02 AM
uint256 private lastTimestamp;
modifier toNotBeCalledAgain {
require (lastTimestamp != block.timestamp);
lastTimestamp = block.timestamp;
_;
}
modifier toNotBeCalledAgain {
require (lastTimestamp != block.timestamp);
lastTimestamp = block.timestamp;
_;
}
function doSomething() external modifierHere {}
Jul 18, 2021, 11:02 AM
so its like a condition before performing the function
so i dont have to put code inside the function
Jul 18, 2021, 11:03 AM
ye before or after
ye
Jul 18, 2021, 11:03 AM
wow got it easily understood
Jul 18, 2021, 11:03 AM
modifer After {
_;
// do something after
}
_;
// do something after
}
Jul 18, 2021, 11:03 AM
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
inSwap = true;
_;
inSwap = false;
}
for example brother, if this is the code for the modifier
its default to true right
code after _; - is something i dont get
where it says below inswap = false
Jul 18, 2021, 11:06 AM
when the function starts, inswap is set to true
on end it is set to false
Jul 18, 2021, 11:10 AM
and when it ends it goes back to false?
Jul 18, 2021, 11:10 AM
yes
Jul 18, 2021, 11:10 AM
wow ok
thank you
so these modifiers are interesting
Jul 18, 2021, 11:10 AM
then me too :P
just copy and paste
actually, i made a contract which doesn't need copy and paste
just calling a function
the only good thing its good at is testing small pieces of code
well if a token locker pays well
i might make one myself :P
Jul 18, 2021, 11:54 AM
it will surprise how well it pays
Jul 18, 2021, 11:55 AM
then gonna make one, might make some gimmicks like NFT representing a locked position
Jul 18, 2021, 11:56 AM
yes, change the game
Jul 18, 2021, 11:56 AM
and make it cheaper than dx sale like 0.03 ETH
then slowly make it higher :P
Jul 18, 2021, 11:56 AM
no wonder we see Elon as a genius
lol
Jul 18, 2021, 11:57 AM
have a few?
when it was $20
20 would be enough to not have to do anything anymore :P
Jul 18, 2021, 11:58 AM
lol still better than the pizza guy
Jul 18, 2021, 11:59 AM
well even if I can off ramp I prefer money digital and in crypto anyways :P
Jul 18, 2021, 11:59 AM
Zak do u know java spring cloud or anyone
Jul 18, 2021, 12:00 PM
I do kotlin
and vertx
Jul 18, 2021, 12:00 PM
Also, this would sell for a good amount of money. Even if you didn’t build a token locker. I’d even buy it from you if it simplified the process vs mine. Or if you’re feeling egalitarian, post it for free so people like myself can sell it lmao
I know someone that sold 100 line rug contracts for good money even though those are available on tokensniffer
Humans are truly lazy and just want to spend money man.
Jul 18, 2021, 12:03 PM
Now i want to create one that works like uniswap v3 lol, make nfts that represent locked tokens :P
and the solidity extension
and a nice theme :P
Jul 18, 2021, 12:10 PM
ohh lucky i run chromebook, can run linux beta
Jul 18, 2021, 12:11 PM
only contract will be rekt
Jul 18, 2021, 12:11 PM
i create token locker as well, well i just copy and pasted open source code,.. now i dont have to buy their "lockers" lmao
tho its a bit of work, i need to approve and spend manually from pancakerouter
to make it work.. i think its possible to add function though!
Jul 18, 2021, 12:12 PM
CMS jeets use Selenium scripts to upvote reddit posts and charge .6-1 BNB for it
Also freely available information.
Jul 18, 2021, 12:13 PM
this is exaclty what i want to do tbh.. its going to replace my day job
Jul 18, 2021, 12:14 PM
Rent in Nigeria is $8/month. If a single person buys a CMS post from them, they can feed their family and pay rent for a year.
Jul 18, 2021, 12:14 PM
aside from making tokens tho
i mean in my country, for IT engineers the pay is 20-30$ a day
its slavery
Jul 18, 2021, 12:15 PM
Which country?
Jul 18, 2021, 12:15 PM
PH
for 9-12 hrs too
because fk india
overworking so we had to compete
Jul 18, 2021, 12:16 PM
I was looking for Solidity developers in PH but without success
Jul 18, 2021, 12:16 PM
well i was planning to leave anyways when i learn this selenium voting stuff and token creation profit
Jul 18, 2021, 12:16 PM
Yeah, learning how to bot reddit posts with Selenium can make you thousands of $$ per week. I followed a wallet that made $100,000 in a month with tokens although they did some highly unethical shit (one rug per day). Making money in this space is incredibly easy if you’re willing to put in the time and effort. Most people aren’t. If you can deploy a contract, you’re 95% ahead of everyone else.
Jul 18, 2021, 12:18 PM
i can deploy already hahaha but my problem is making it succesful
well i got a network of shillers
but the max i raised was for like only $200k mc
Jul 18, 2021, 12:19 PM
It's easy with node and puppeteer
Jul 18, 2021, 12:19 PM
Better work to make a good product and then you can make stable income
Jul 18, 2021, 12:19 PM
well i learn abit of marketing now too because of this its quite a good experience so far
Jul 18, 2021, 12:20 PM
very true
Jul 18, 2021, 12:20 PM
You can check Kardiachain ... and will see for what am talking
Jul 18, 2021, 12:21 PM
for crypto projects though, you also need to do web3 front-end part to make it a product
smart-contracts can only go far
so combination of web3 js , solidity, css = product
Jul 18, 2021, 12:21 PM
Cheaper than Bsc and have huge potential ... deployn projects on it without the need of huge investment
Jul 18, 2021, 12:22 PM
i saw becoswp promoted there last
Jul 18, 2021, 12:22 PM
That's a good project actually i like it
They already update the front end now is looking better
Good team working hard
Jul 18, 2021, 12:23 PM
most people get paid twice that per hour lol
nvm
Jul 18, 2021, 12:25 PM
philippines bro, its the reality
so like employers get the bigger piece of the cake and employees get the clean plate lmao
Jul 18, 2021, 12:25 PM
better to freelance
Jul 18, 2021, 12:27 PM
In other channel eth jobs ..is full with scammers
Jul 18, 2021, 12:27 PM
link pls
Jul 18, 2021, 12:27 PM
the dev discord doesn't have scammers
Jul 18, 2021, 12:28 PM
Ethereum Jobs
Jul 18, 2021, 12:28 PM
yeah fr
Jul 18, 2021, 12:28 PM
There is good Devs also but like 20%
Jul 18, 2021, 12:46 PM
hmm ya most of them probably work for startups/ only few freelance
Jul 18, 2021, 12:51 PM
Why didn't you tell the admins about them?
Jul 18, 2021, 12:55 PM
https://www.youtube.com/watch?v=hPJRFyl5SrM - haha and people buy those pdf smart!!
Jul 18, 2021, 12:55 PM
They ban the scammers but ...scammers change names use different accounts ...
So be careful ...no upfront payments only with milestone
Jul 18, 2021, 12:56 PM
the pancake router in testnet is different
what wallet address are u testing is it different from owner
there is code for exclusion
because the owner / contract creator is excluded from dividends
use testnet pancakerouter but it doestn work now
the GUI pancakerouter if you know hwo to use write contract
its hard to explain but you need other wallet to do the testing
you need to use router contract to add liquidity, do transfers and all bunch of stuff
if you understand this, then you should be good
i remember before i got honeypot from my own contract lmao
there can be shortcut which i am not familiar of though, thats just my opinion hopefully others can help you
https://pancake.kiemtienonline360.com/#/swap
i was using this GUI pancakeswap for testnet before, but for some reason its not working anymore
unable to add LP
or you can just remove these codes
i think you need to understand your code and remove the area where it excludes owner address to reeceive dividend
from there you can test it fully
i have not tried deploying this kind of contract sorry cant be of much help
Jul 18, 2021, 1:44 PM