Hi guys, I am reading about upgradeable contracts right now - https://medium.com/rocket-pool/upgradable-solidity-contract-design-54789205276d.

And there the author basically says that there's a set of contracts which communicate with each other with the addresses for each of the other contracts specified softly, not hard coded, right?

So, the author says that it's a good practice because otherwise there can be bad consequence.

My question is like this:
1) Doesn't it mean that the dapp is mutable in this way? Because dev can easily make changes to the contracts - either based on good motives or bad ones?

Jan 22, 2021, 3:49 PM
Also, wouldn't anybody out there be able to just swoop in and specify the new contract with the same name as the previous one, so that those other contracts now refer to it? I don't remember how it works.
Jan 22, 2021, 3:51 PM
Yes that is right. When a contract is "upgradeable", it can point to new contracts via interfaces (fixed function input and output, but variable function body on the forwarded contract) or in some cases even redirect the entire call to the new contract via delegatecall. Contracts that do this can in some way lose key values of decentralization.
Not sure how you mean that exactly, but if you mean setting a new pointer to where contract calls are sent to, no that's not the case or should not be. This is similar to the ownable concept that of course only authorized addresses can change the end-contract.
So never rely on time stamps when the difference can be <= 15 minutes (the bigger the better)
Did you set the expiration in the contract itself and if yes, to which number?
Jan 22, 2021, 5:39 PM
not in the contract i setting it from bot
Jan 22, 2021, 5:39 PM
How do you do that, like you send a tx and how do you cancel it?
Jan 22, 2021, 5:40 PM
no need to cancel and i don’t cancel it
i’m setting with this way
Math.round(new Date().getTime())+60*20.

If time is not impact then why my tx get failed within 20 seconds? reason deadline of tx expired
Jan 22, 2021, 5:45 PM
getTime may returns local time/milliseconds, you need UTC (timestamp)
Jan 22, 2021, 5:47 PM
Alright! This can be reason? but still my server time UTC+8 from where tx send to execute.
Jan 22, 2021, 5:49 PM
You need the current block timestamp
And then add 20 mins...
Jan 22, 2021, 5:50 PM
Alright
Alright but im trying to find the actual reason why tx get failed because of expired deadline.
Jan 22, 2021, 5:51 PM
Because you calculate your deadline wrong
Jan 22, 2021, 5:51 PM
How?
Eth mainnet use UTC
i calculate from server which is using UTC+8 by following
Math.round(new Date()/1000)+60*20.

It still be ahead 8 hours and 20 mints
Jan 22, 2021, 5:53 PM
~~(Date.now() / 1000)

it returns timestamp in seconds.
Jan 22, 2021, 5:55 PM
sorry i actual used it.
Math.round(Date.now() / 1000) +60*20
Jan 22, 2021, 5:57 PM
it's not the same
Jan 22, 2021, 5:57 PM
Ok got it, thanks
Jan 22, 2021, 5:58 PM
Using this
Math.round(Date.now() / 1000) +60*20
Which mean my tx must be
8hours and 20 mints ahead as server UTC+8
Jan 22, 2021, 6:00 PM
console log it, and see it here
https://www.unixtimestamp.com/
Jan 22, 2021, 6:01 PM
ok
Jan 22, 2021, 6:01 PM
Eth mainnet doesn't use UTC
They use seconds since epoch
Which is the same in every timezone
Jan 22, 2021, 6:03 PM
Hey guys, I have a question - I want to register at a very small exchange and buy a specific token I like. I am a writer in crypto and I just buy things in small amounts :)

The token is ERC20.

And we know that any transactions on Ethereum cost like $30 rn, right?

But at that exchange the fee is just 0.2% of the transaction amount.

I am not sure why would an exchange partake in this business? Do I understand it correctly that the exchange gets into agreement with the coin issuer (which is not a bad thing) and they port a large amount of coins to the exchange, and they we, as buyers, buy those tokens from the exchange, while those transactions aren't stored on the blockchain, right?

So, if I get it right, then the question is like this - "if I've just bought a coins for $100 and it's stored in that small exchange, and then when I want to transfer it into my MetaMask wallet, I will need to pay the ETH blockchain fee, right?". Coz I don't want to store the coins at the exchange because it's dangerous.
Jan 22, 2021, 7:53 PM
Centralized exchanges simply keep their ledgers in regular databases. They might even sell you tokens they don't have. Only when you want to transfer those out of the exchange you have to pay some real fees, because there is a real transaction
Usually the fee you pay is not directly the Eth transaction fee, but something the exchange considers good enough that they can do the transaction and some internal fees
Jan 22, 2021, 9:20 PM
yeap, I kinda get it.
Jan 22, 2021, 10:18 PM

© 2024 Draquery.com All rights reserved.