Hi ! i want to write a smart contract witch receive my ERC20 token. i write a transferFrom but i need an allowance. Should i write a "approve in my contract ?"

Jan 21, 2023, 2:13 PM
the approve can't be called from that contract
the user has to call it on the erc20 contract
Jan 21, 2023, 2:14 PM
ERC20(myTokenAddress).approve(address(this),amount)?
This line before the transferFrom ?
Jan 21, 2023, 2:22 PM
where is this
not in token contract right?
in this way you are telling that contract to approve itself
Jan 21, 2023, 2:23 PM
Yes .. i wonder if i can write this in the contract but that not make sence
how can i do if i want that the user (any wallet) can approve (or not) the transferFrom?
when i try transferFrom, i get error because of allowance
Jan 21, 2023, 2:25 PM
I told you
.
Jan 21, 2023, 2:26 PM
sorry i don't get really get yet.. 1- i write a smart contract: contract FreezyToken is ERC20{constructor() ERC20("FreezyToken","FZ"){_mint(msg.sender,10*10**10)}} 2- i write another smart contract: contract FreezyJoke{}
Jan 21, 2023, 2:34 PM
Gosh, if you (msg.sender), you need to call approve manually
then the contract you are interacting with, can call transferFrom
the contract calls approve when it gives allowance to another contract to the tokens its address owns
Jan 21, 2023, 2:35 PM
ok ! i get this
but when i interact with exchange, with the same button there are two transactions : approve and transferFrom without i previously approve the dex smartContract. Thus, how this contract is write?
Jan 21, 2023, 2:39 PM
exactly
the approve tx is not on the router contract
is on the erc20 contract
Jan 21, 2023, 2:39 PM
you give approve to the router for the tokens you have, then the router calls transferFrom and transfers the tokens to the pair
https://github.com/Uniswap/v2-periphery/blob/0335e8f7e1bd1e8d8329fd300aea2ef2f36dd19f/contracts/UniswapV2Router02.sol#L267
Jan 21, 2023, 2:45 PM
Ok. I think that i get it more.. thanks
Jan 21, 2023, 2:49 PM
Hey Freezy

My BNB wallet got hacked. The moment I send it some BNB it sends it to a hacker’s wallet. Is there something I could do to stop it ? 🥺
Jan 21, 2023, 4:32 PM
you wallet is compromised
change it immediatly
Jan 21, 2023, 4:32 PM
I have some CAKE staked.
Till April 2023
How ?
Jan 21, 2023, 4:33 PM
you probably pasted your private key somewhere
Jan 21, 2023, 4:33 PM
If I send some BNB to transfer tokens. It just sends all BNB immediately to another wallet
Jan 21, 2023, 4:33 PM
share tx
Jan 21, 2023, 4:34 PM
https://bscscan.com/tx/0x75d7a652623950b00c2c057d536350bcb16fd1774ed03c74d5d29b2fe2a05d06
Jan 21, 2023, 4:34 PM
compromised
Jan 21, 2023, 4:40 PM
Probably to GitHub. Happened to me
Jan 21, 2023, 4:41 PM
I can’t do anything ? 🥲
Jan 21, 2023, 4:42 PM
change wallet
Jan 21, 2023, 4:42 PM
I don’t have anything on it except CAKE
Which will get unstaked in April
But if I send BNB on that address
It automatically sends it to hackers address
🥲
Jan 21, 2023, 4:43 PM
exactky
change wallet
don't use that wallet anymore
Jan 21, 2023, 4:44 PM
Was it a lot?
Jan 21, 2023, 4:44 PM
Almost 300$
In today’s price
Jan 21, 2023, 4:44 PM
Yeah just forget about it
It’s gonzo
Jan 21, 2023, 4:44 PM
Shall I increase the stake period to 10 years ?😂
Jan 21, 2023, 4:44 PM
You could try send bnb for fee, unstake cake and transfer cake out all in one block. This guy sweeps wallet with max gas, so its always gonna be on next block
Jan 21, 2023, 4:49 PM
He can still rescue it
Flashbots whitehat team only rescues if the amount is above 1k
If you are polite about it they will help anyways
Jan 21, 2023, 4:51 PM
I wish I knew how to do these things but I still have time till April 😬
Who are they ? 😅
Jan 21, 2023, 4:51 PM
Ser this BSC
Jan 21, 2023, 4:52 PM
300 > 1000
Jan 21, 2023, 4:53 PM
They rescue even in bsc
https://docs.flashbots.net/whitehat/
Jan 21, 2023, 4:55 PM
What is Gonzo?
Jan 21, 2023, 4:56 PM
Since when does flashbot supports bsc :o
Jan 21, 2023, 4:57 PM
if you mean "mev boost" it does not
their product has nothing todo with their whitehat team
and i think you can trust them
Jan 21, 2023, 5:00 PM
Thanks everyone

Will try to get it if I could else will just increase the period. Or wait I won’t be able to. It requires tx fees too 🥲
Jan 21, 2023, 5:00 PM
Ah so they doing this basically
Jan 21, 2023, 5:00 PM
i mean yes
haha im saying this because its common
Jan 21, 2023, 5:03 PM
Super useful tool
Jan 21, 2023, 6:54 PM
Phalcon as well
https://phalcon.blocksec.com/tx/eth/0x4bc92d128f9a814156d19ef561fe6e8e0392f6bcbd093aefdf21132083bac3f5
https://watchers.pro/#/token
and his one
Jan 21, 2023, 6:56 PM
You are a web3 Wikipedia
Jan 21, 2023, 6:59 PM
In PM only, more than 50-100
Jan 21, 2023, 7:01 PM
Hey a question

My address had a few 2-3$ worth of several coins
The hacker guy deposits some BNB
transfers the token
And takes out any remaining BNB

How is he able to do it ?
Jan 21, 2023, 7:39 PM
Why would he be NOT able to do that?
Owning the private key means to control pretty much everything about that address
Jan 21, 2023, 8:16 PM
He’s doing the same thing you said ?

Like doing deposit and taking tokens out in one block and in the next block sweeper bot takes the remaining BNB
Jan 21, 2023, 8:29 PM
Yep he's doing the same
Jan 21, 2023, 8:31 PM
He doesn’t need to do that, he can just swap normally
You’re the one that needs to find a way to beat his bot
Bot wars
Jan 21, 2023, 8:32 PM
No but i checked the tx
All his previous transactions work this way.
Two transactions in one block
The third transaction takes the remaining BNB
I would need to create a bot too ? 🥲
Jan 21, 2023, 8:50 PM
So many unlimited
https://bscscan.com/tokenapprovalchecker?search=0x3fe0d09d5819ff1a17d9d63d99e46088213358ac
Jan 21, 2023, 8:54 PM
this is the minor issue if he has the wallet compromised
Jan 21, 2023, 8:57 PM
The man loves adrenaline
Jan 21, 2023, 9:11 PM
Ping me some days before, i can try to frontrun the sweeper bot you got on your wallet
Jan 21, 2023, 9:48 PM
creation of MultiSig errored: Error encoding arguments: Error: expected array value (argument=null, value="[0xEAe38e8d41aeCC027e1b68c31f7039Ae95651D4D, 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC]", code=INVALID_ARGUMENT, version=abi/5.5.0)


I can't seem to get rid of this error
I am trying to deploy a MiltiSig wallet using remix on it's VM but I am getting this error
The way I pass in the array is
[0xDB9B936373f859Ce8C580Bbc35b0Eab89cA9fd70, 0xDB9B936373f859Ce8C580Bbc35b0Eab89cA9fd70] etc.
What am I doing wrong please
Jan 22, 2023, 1:55 AM
What are you trying to do?
Jan 22, 2023, 1:56 AM
I'm creating a MiltiSig wallet
In the constructor function, I'm passing in an array of addresses
Jan 22, 2023, 2:14 AM
use "0x" on remix
instead of 0x
for addresses
Jan 22, 2023, 2:47 AM
Okay thanks
When I recharge my PC, I'll do so
Jan 22, 2023, 3:58 AM
Sure man
Thanks 🥲
Jan 22, 2023, 4:09 AM

© 2024 Draquery.com All rights reserved.