Hi everybody. I ve got a newbee question, when following a tuto to create a dapp in solidity, after making the js file to develop contract, i use 'async' in front of a function and await after, but when i compile with truffe, i ve got an error :await dappToken.transfer(tokenFarm.address, β€˜1000000000000000000000000’)

SyntaxError: Invalid or unexpected token

Nov 6, 2021, 5:44 PM
missing ";" ?
Oh no, you are in js... so maybe your await is not in an async function ? you should give more context
Nov 6, 2021, 5:45 PM
No i try too, not working
Nov 6, 2021, 5:46 PM
can you give more of your js code ?
Nov 6, 2021, 5:46 PM
Nov 6, 2021, 5:46 PM
like this, I don't see any error...
Nov 6, 2021, 5:48 PM
Do you see any error in the code ?
Nov 6, 2021, 5:55 PM
no
Nov 6, 2021, 5:55 PM
:( any idea why i ve got this error ?
Nov 6, 2021, 5:56 PM
maybe your masterchef has a pool with a huge reward and then ... minted, maybe it has an exploit, maybe there is a public function wich mint..
Nov 6, 2021, 5:57 PM
Nov 6, 2021, 5:58 PM
in your error, it says that it's line 12, but I don't see anything on the 12th line...
Nov 6, 2021, 5:58 PM
It says in line 22 no ? Not 12
Nov 6, 2021, 5:59 PM
Oh sorry
Nov 6, 2021, 6:00 PM
Nov 6, 2021, 6:00 PM
What information should I give to reach a conclusion?
Nov 6, 2021, 6:00 PM
is it ` or ' or " ?
Nov 6, 2021, 6:01 PM
Please help me maximeπŸ™πŸ™
Nov 6, 2021, 6:01 PM
or some utf8 shit ?
Nov 6, 2021, 6:01 PM
No prob, but let me screen shot the js code with the line number :)
Nov 6, 2021, 6:01 PM
without the code, the 0x of the masterchef, or something like that, I cant
Nov 6, 2021, 6:01 PM
Nov 6, 2021, 6:02 PM
https://bscscan.com/token/0xbc3514407990131a581e52773c7c0b025f8c619a
Nov 6, 2021, 6:02 PM
You mean the ' on the amount of token ?
Nov 6, 2021, 6:02 PM
yes
Nov 6, 2021, 6:03 PM
It s '
Not "
I need to replace ' by " ?
Nov 6, 2021, 6:04 PM
no
can you copy the fews lines from 18 to 23 ? with Ctrl+Shift+M
Nov 6, 2021, 6:05 PM
https://bscscan.com/address/0xdc53b6d7119c64fb75127e7998c86c9bfa15db6a#code
Masterchef
Nov 6, 2021, 6:06 PM
//Transfer all the Dapp to TokenFarm
await dappToken.transfer(tokenFarm.address, β€˜1000000000000000000000000’)
Nov 6, 2021, 6:07 PM
β€˜ is not '
Nov 6, 2021, 6:08 PM
Ctrl + shift + m give me a screen short
Nov 6, 2021, 6:08 PM
replace it to ' or ' or even ` and you won't have syntax error :D
it's RED !
Nov 6, 2021, 6:09 PM
shot
Nov 6, 2021, 6:10 PM
B
Nov 6, 2021, 6:10 PM
it s working ! you re a star thanks thousand time !!!
it was not red on sublime text, how can i make it to be red when mistake ?
Nov 6, 2021, 6:11 PM
Dear maxime
Nov 6, 2021, 6:11 PM
maybe use visual studio ? or something like that ?
Nov 6, 2021, 6:12 PM
i will check, thanks, i know it s nothing for you but you save me a lot of time :)
Nov 6, 2021, 6:12 PM
yw :)
do you have the tx of the "hacker" ?
Nov 6, 2021, 6:13 PM
This is for me?
Nov 6, 2021, 6:13 PM
no
for you, I want the tx of the "hacker" because I don't have time to understand your whole masterchef and 20 transactions...
Nov 6, 2021, 6:14 PM
this is in microsoft visual studio right ?
Nov 6, 2021, 6:14 PM
yes
Nov 6, 2021, 6:14 PM
ok tx
Nov 6, 2021, 6:14 PM
I'm mostly a linux user but microsoft has great tools for code
Nov 6, 2021, 6:15 PM
Im sorry
I dont know
What do u mean about( tx of the hacker)??
Nov 6, 2021, 6:15 PM
th guy who minted and stole your liquidity
I need to watch the tx of this guy to understand why it happend
maybe it was an error on your liquidity creation, or token settings, maybe it was your masterchef and the rewards...
Nov 6, 2021, 6:17 PM
https://bscscan.com/tx/0xe027a6614818bc2312293a03f18c2bc4872224b7ee48868421c896003d17f04d
Nov 6, 2021, 6:20 PM
he just call Function: withdraw(uint256 _pid, uint256 _amount) with the pool 0 and 0 for amount
so maybe you have done some errors in this function ?
:D
Nov 6, 2021, 6:21 PM
No
I dont have error in my function
Nov 6, 2021, 6:22 PM
there is no mint, only transfer. he just get back his deposit ?
this guy has 6.5k transactions and it's 10 days ago, I won't check his deposit, but he only call withdraw for the pool 0 so ... maybe it's his rewards, maybe his deposit, but I don't see anything strange here
Nov 6, 2021, 6:24 PM
2 million token automatically has been minted to masterchef
After that imediatelly transferred to that bad addres


https://bscscan.com/tx/0xe027a6614818bc2312293a03f18c2bc4872224b7ee48868421c896003d17f04d


Why?
Nov 6, 2021, 6:25 PM
I don't know what's your settings for the pool 0, but this guy has a lot of rewards, that's all.
Nov 6, 2021, 6:27 PM
Who is he??
Who is that withra all from masterchef?
Two times
Two Γ— 2m token has been minted to masterchef
Why
Second question is why both times all went to this addres?
Nov 6, 2021, 6:27 PM
nothing weird here, just an error in code that allowed him to do that
I wouldn't blame him but the dev tbh
Nov 6, 2021, 6:28 PM
look his deposit :
Nov 6, 2021, 6:28 PM
any chances he's the dev and put that vulnerability in code knowing he would have used it later? lol
Nov 6, 2021, 6:29 PM
Pool 0 is axiv_busd lp
Whitch error
Where is the bug
How to fix it?
Nov 6, 2021, 6:29 PM
well look at the withdraw function, user said to withdraw 0 tokens and ended up receiving tokens
Nov 6, 2021, 6:30 PM
No
How tofix it?
Nov 6, 2021, 6:31 PM
and if you watch the code, there is a mint for the reward, a mint for the developer and a transfer of the reward
there is NO bug here... just a reward of a pool
Nov 6, 2021, 6:31 PM
This guy has 4 m my token
Every time i add liquidity he will empty all
How to stop him?
Lol
Nov 6, 2021, 6:33 PM
you can't
your token is dead
Nov 6, 2021, 6:33 PM
Ooo
Nov 6, 2021, 6:33 PM
uint256 pending = user.amount.mul(pool.accAxivPerShare).div(1e12).sub(user.rewardDebt);
Nov 6, 2021, 6:34 PM
new token with new masterchef?
Nov 6, 2021, 6:34 PM
is it good ?
Nov 6, 2021, 6:34 PM
U change it?
Nov 6, 2021, 6:34 PM
no
but it seems strange for me tto mix pending and amount
Nov 6, 2021, 6:35 PM
What should be changed in new MasterChef
I have been copied
From a good project
Nov 6, 2021, 6:36 PM
no I was wrong : user.amount.mul(pool.accAxivPerShare).div(1e12) should convert amount deposited to reward (I think ?)
Nov 6, 2021, 6:36 PM
How to fix it in new MasterChef
To avoid this issue
Nov 6, 2021, 6:38 PM
you have the same line in deposit so I don't think it's a bug
I realy don't think there is an issue...
this guy deposited 2052153 of the LP
so he has some rewards ... and he sell and that's all
Nov 6, 2021, 6:39 PM
This address as I checked is a robots
Nov 6, 2021, 6:39 PM
look his deposit, he is a whale !
Nov 6, 2021, 6:39 PM
Yes
What should be changed say in new MasterChef
Nov 6, 2021, 6:40 PM
Oh I inverted reward & amount lol
Nov 6, 2021, 6:41 PM
Do u know why twotimes has been minted to my masterchef ?
As u know when someone stake or add liquidity then
Masterchef will give him reward
When no one liquid there except me and me team
Why all rewards went to him ?
He has not stake
Nov 6, 2021, 6:43 PM
there is a mint for the devAddr and one for the contract
Nov 6, 2021, 6:43 PM
And also lp
Nov 6, 2021, 6:43 PM
line 321 of your masterchef
Nov 6, 2021, 6:44 PM
Yes correct
Nov 6, 2021, 6:44 PM
Oof
Nov 6, 2021, 6:44 PM
What is there ?
Nov 6, 2021, 6:44 PM
Looks like your project is dead brother
Nov 6, 2021, 6:44 PM
dude, it's YOUR contract :D have I to explain you every line of it ?
there is axiv.mint(devaddr, axivReward.div(10));
before the minting for reward, you give 10% to the dev.
Nov 6, 2021, 6:45 PM
πŸ˜‚πŸ˜‚πŸ˜‚
My brain has hanged dear
Nov 6, 2021, 6:46 PM
I'm almost drunk, I've found a nice bottle of St croix du mont (white french wine near bordeaux) and it's painfull (but funy) to read your contract now
Nov 6, 2021, 6:46 PM
I gave it truly
Nov 6, 2021, 6:46 PM
you mint twice.
Nov 6, 2021, 6:47 PM
God bless you dude f
Drink and enjoy hard ;))
Nov 6, 2021, 6:47 PM
:D
t'es français ?
Nov 6, 2021, 6:48 PM
Yes but i dont remember why i did it ...
Long time ago ...
No dear
Nov 6, 2021, 6:49 PM
minting twice is not an issue, but maybe the settings of the pool accAxivPerShare, I don't know
Nov 6, 2021, 6:49 PM
https://github.com/sushiswap/sushiswap/blob/canary/contracts/MasterChef.sol
they too)
Nov 6, 2021, 6:49 PM
There not some complecated setting in my masterchef ...
Nov 6, 2021, 6:50 PM
masterchef is not something I like to read, there is some magic variables for me
in pancake, I usualy see "allocPoint" but I don't know if it's the same kind of mechanism
Nov 6, 2021, 6:50 PM
Which masterchef do u prefer to use for my new token ?
U think thats good to clone ?
Nov 6, 2021, 6:51 PM
no
its old
Nov 6, 2021, 6:51 PM
I never deployed token, I make contracts to make money for myself :D sorry I have no idea about who to copy to make a good defi plateform
Nov 6, 2021, 6:51 PM
Im in bsc
Nice dear πŸ‘Œ
Nov 6, 2021, 6:52 PM
pancakeswap contract same i can say
Nov 6, 2021, 6:52 PM
It has syrup and its a little deprecated ...
Nov 6, 2021, 6:52 PM
I moslty read contracts to see who will be rekt or to understand how to make money out of it
Nov 6, 2021, 6:53 PM
Cool :))
Where were my code goof u think ?
Nov 6, 2021, 6:53 PM
You are a bad boi
Nov 6, 2021, 6:53 PM
no no lol
Nov 6, 2021, 6:54 PM
Can u find it out ?
Nov 6, 2021, 6:54 PM
Wdym by you make contracts to make money for ys?πŸ˜‚
Nov 6, 2021, 6:54 PM
I want to be a white hat
Nov 6, 2021, 6:54 PM
I like self-administrated contracts
Nov 6, 2021, 6:54 PM
arbitrage ? for example or others algorithms it's better when your transaction call just a "let's compute" and you compute with accurate values
Nov 6, 2021, 6:55 PM
Dears what masterchef exept pancake and goose do you prefer ?
Nov 6, 2021, 6:56 PM
Yeah got it, nice ahahah
Nov 6, 2021, 6:56 PM
I don't have balls enough to handle other people money
(but I can take their money from arbitrage)
Nov 6, 2021, 6:57 PM
You don't make the system but you try your best to understand the system to bypass the system
Nov 6, 2021, 6:58 PM
yes
Nov 6, 2021, 6:58 PM
That's so cool
Nov 6, 2021, 6:59 PM
once, I saw a factory and a swap contract bugged, same bug as burger (no K check...) and didn't find an admin to contact to get bounty, and I let them like that. I'm not a bad guy
Nov 6, 2021, 6:59 PM
Bro is it possible for u to find out the bad code here to fix it in my new token ?
Nov 6, 2021, 6:59 PM
I never messed around with arbitrage, to do that your setup is basically a smart contract and a server where you listen to events? Do you have synced a node?
Nov 6, 2021, 6:59 PM
it does not give me a lot of money... sometimes it works but most of the time, the cost is over what I earn... and no I don't have a node
Nov 6, 2021, 7:01 PM
I once tried with the bugbounty of pancake but they basically ignored the thing, which I reported also to dxsale that decided to take actions on their side to handle that bug of pcs and ofc dxsale didn't even say thanks ahahah
Nov 6, 2021, 7:01 PM
I tried to have a node in BSC, I tried for ftm and matic... too painfull, geth is a shame.
Nov 6, 2021, 7:01 PM
Oh yeah Ig the competition in arbitrage is madness
Nov 6, 2021, 7:02 PM
yes and it's a competition with only 1 winner / opportunity...
are you sure that this guy earn more than the others of your plateform ?
Nov 6, 2021, 7:03 PM
Many people cannot dare to write a minting contract from scratch.
Nov 6, 2021, 7:03 PM
solidity is not this hard... but sometimes, there is side path... and there is money so you have to be strict...
it's not hard, but you have to take care
for me, if I write something for others people, it will be an uniswap (v3) fork but with venus deposit and with an USD algorithm
(not today)
Nov 6, 2021, 7:07 PM
πŸ‘ŒπŸ‘Œ
My token is in bep20
Nov 6, 2021, 7:08 PM
maybe you just deploy univ3 to unsupported by them network and would not waste time for your algos?)
Nov 6, 2021, 7:08 PM
Why?
Nov 6, 2021, 7:09 PM
dont know
maybe they are insecure, lack fortitude or courage.
but all they uses oldest masterchef, they think only about forking
Nov 6, 2021, 7:10 PM
the idea is to make reserves deposited on beefy or on venus or ... to make better rewards for lp than just swap fees
most of forks are adding vulnerabilities...
Nov 6, 2021, 7:11 PM
without this idea standard univ3 on polygon as example - good business, without breaking their business license terms
Nov 6, 2021, 7:11 PM
I've read a lot of clones of uniswap V2, but not enough V3 to make this kind of project
Nov 6, 2021, 7:12 PM
do it first)
if you are strong enough in spirit
Nov 6, 2021, 7:14 PM
the day I'll do it, it will not be with this nickname lol, no balls to handle other guys money...
oh and ... I hate when "public contracts" have "owner"
Nov 6, 2021, 7:15 PM
maybe you can just refactor the code of their contracts, rename the functions, compile with new versions of the solidity and that will be enough
Nov 6, 2021, 7:16 PM
it's not my way of life
the day I'll make this kind of shit, it will have a reward address with reward cap like 10kBUSD, and no real owner...
owner in contracts, it's the shame of defi...
Nov 6, 2021, 7:20 PM
not my way too
but i need v3 concentrated liquidity pools in polygon
and i try to talk with people, maybe someone will do it)
Nov 6, 2021, 7:21 PM
Oh and I don't want to have a website.... just contracts but no interface.
Nov 6, 2021, 7:22 PM
attraction of FE developer is not big problem i think
Nov 6, 2021, 7:27 PM
Oh yes but it's not my vision of defi...
I hate this kind of shit... for me defi is not centralized around a website...
Nov 6, 2021, 7:27 PM
That's correct, but if you want to have users on the platform you most likely need one
Average person in defi barely knows how to use metamask, you can't expect them to do stuff on etherscan or via cli
Nov 6, 2021, 7:32 PM
yes and social profiles for CMC listing
Nov 6, 2021, 7:32 PM
I thought we were talking about platforms, I don't think cmc is strictly needed
Nov 6, 2021, 7:33 PM
cmc just token marketcap ranker
many people now see rank for fast understanding what is this
Nov 6, 2021, 7:34 PM
Btw not having a website can also be seen bad by people who would actually know how to use your platform as they might think "damn they didn't even bother trying to make a website, it must be something that lasts a week and rugs"
Yes ik what cmc is
Same deployer same nonce when deploying
Or take a look at create2
Nov 6, 2021, 8:29 PM
Oh is it really the "seed" for contract address ? so you can try deployer address with nonce at 1 for example, to have vanity contract ?
Nov 6, 2021, 8:37 PM
It's a combination of address of the deployer and nonce of the transaction where you create the contract if I remember correctly
Nov 6, 2021, 8:38 PM
I saw a token like 0x1337... and this token was built to have a price of 1337$
i was like : "but how ?"
Nov 6, 2021, 8:39 PM
About stuff like vanity for contracts I think yeah that could be possible by having you create the deployer and compute the address with nonce 1 but idk seems like a lot of trial and error to me
You sure about the order in which things happened? Ahahah
Nov 6, 2021, 8:40 PM
if you try with "estimateGas" it's ok to try :D
yes because 1337 was hardcoded in the contract (if I remember good)
Nov 6, 2021, 8:41 PM
I mean maybe they deployed and got an address starting with 0x1337 and later chose to put that as price
Oh
Nov 6, 2021, 8:41 PM
no no lol
and searching "vanity contract address" on google didn't gave me a lot of good answers
Nov 6, 2021, 8:41 PM
Ig something like vanity for contracts is doable but I don't exclude the thing that like they could have deployed on a fork of mainnet and took note of the address of the token ahahah
Nov 6, 2021, 8:44 PM
maybe just typo in deployed code)
Nov 6, 2021, 8:49 PM
There is but our developer is on holidays and this needs to be resolved ASAP and we will happily pay well to get this resolved tonight.
@Flamingoblc @a17_alien Could you DM so I could talk to you please.
Nov 6, 2021, 8:51 PM
Sorry, I'm busy tonight, doing full test coverage of my contracts, it's a tedious job but trying to do it..
Nov 6, 2021, 8:54 PM
I hope your dev has a good holidays :D
Nov 6, 2021, 9:18 PM
I hope so too but our 20,000 investors are not happy.
I need a Solidity Dev ASAP.
Nov 6, 2021, 9:19 PM
maybe you can try to explain here the issue ?
Oh it's in the navigator :(
painfull to debug but ok, what happend ?
can't help you more without more informations
yes this view function fail with a revert
maybe it divide by 0 ?
Nov 6, 2021, 9:26 PM

Β© 2024 Draquery.com All rights reserved.