Do anyone know why this works in 0.5.16 version and not 0.6.12?
constructor() public {
uint chainId;
assembly { chainId := chainid }
It says:
ParserError: Expected '(' but got '}' assembly { chainID := chainid } ^
I can't figure out what has changed. Compiling with 0.5.16 is not an option
Jul 4, 2021, 12:04 AM
try this
assembly { chainId := chainid() }
assembly { chainId := chainid() }
just in case anyone is looking for chain id, there is now a global variable called block.chainid
https://docs.soliditylang.org/en/v0.8.6/units-and-global-variables.html#block-and-transaction-properties
https://docs.soliditylang.org/en/v0.8.6/units-and-global-variables.html#block-and-transaction-properties
Jul 4, 2021, 12:31 AM
I did, but then all variables and some functions fail. Now variables errors are sopmething like: overriding function is missing 'override' specifier. etc.
i dont think i should change all that stuff for the chainid(). maybe i do have to, dunno
i dont think i should change all that stuff for the chainid(). maybe i do have to, dunno
Same error if i do this. guess both are correct and I actually need to fix the rest and not the chain id line?
I tried to add the chainid() function too but same results
if i convert:
uint public totalSupply;
to:
uint public override totalSupply;
it works. is that ok? or it will be messed up later
uint public totalSupply;
to:
uint public override totalSupply;
it works. is that ok? or it will be messed up later
Because it's asking me to write override EVERYWHERE in MANY functions and vars
Was trying but when overriding all of them thne i have other problems. It's more simple than this, I just need the right way to get the chainid in 0.6.12, as I don't know how to do it, 0.5.16 works but then other contracts fail to compile
Jul 4, 2021, 12:51 AM
Hello cryptodeluxsamy
Jul 4, 2021, 1:06 AM
Hi
Jul 4, 2021, 1:11 AM
Can we talk privately
Jul 4, 2021, 1:11 AM
sure
Wilson is asking how to do a flash loan, I guess he wants to try to attack a farm or somehting
fyi
Jul 4, 2021, 1:27 AM