Time Lock | Solidity 0.8

  Рет қаралды 15,898

Smart Contract Programmer

Smart Contract Programmer

Күн бұрын

Пікірлер: 45
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
1:31 - queue 9:37 - execute 17:53 - cancel 19:19 - demo
@orleee
@orleee 2 жыл бұрын
Thank you for continuing to deliver great tutorials
@veerabadhraswamygopu7994
@veerabadhraswamygopu7994 2 жыл бұрын
Best solidity videos in KZbin .......thanks man...
@berkingurcan6097
@berkingurcan6097 2 жыл бұрын
best channel on youtube
@fakemonkgin
@fakemonkgin Жыл бұрын
high quality content
@meka4996
@meka4996 Жыл бұрын
This is amazing! Thanks!
@thomascherret5154
@thomascherret5154 2 жыл бұрын
Awesome video, thank you!
@danielany1590
@danielany1590 2 жыл бұрын
Thanks for your great tutorials! I have a question. Why use `revert` and `if` at error case, instead of require? Does have any gas efficient? or other benefits?
@illegalskillsexception9826
@illegalskillsexception9826 2 жыл бұрын
As far as I know, require is more gas efficient than writing if + revert. However writing custom Errors is more gas efficient than the require statement. The most efficient solution would be to have a require statement with custom error, but this is not yet supported in solidity (hopefully in future). In this case it shouldnt matter much i guess because using custom errors are pretty convenient.
@danielany1590
@danielany1590 2 жыл бұрын
@@illegalskillsexception9826 great! thanks
@shubhamsingh7405
@shubhamsingh7405 2 жыл бұрын
Thnx for this very helpful tutorial. Why do we need to check whether _func parameter is empty string or not, anyways its going to call receive if we just send the _data with call?
@MrCoreyTexas
@MrCoreyTexas 4 ай бұрын
On line 103, why do you have to cast a string into bytes to check the length? From all of my previous experience I'd think a string datatype would support a length operator. If not, solidity has pretty weird exceptions.
@relikpL
@relikpL Жыл бұрын
Amazing content, and I always refer to your work. Is it possible for others to view that a timelocked transaction was queued up? I know that DAOs and other web3 projects use Timelocks for certain admin controls, and this is something that others can view and withdraw from the protocol if it's malicious, for example? Is that a different Timelock implementation (OpenZeppelin, I think)?
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
yes from the event logs
@РомаПетров-ж1н
@РомаПетров-ж1н 2 жыл бұрын
Do we get something for offchaining txs storing only its hash aside storage gas fees economy? And does it make significant difference? Am I right that we can get "cashback" when deleting executed txs from contract storage?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
yes you can save gas by simply storing the hash inside the contract yes htere is a refund for deleting data
@lucascyrne6301
@lucascyrne6301 Жыл бұрын
Could you continue this implementation focusing in atomic swaps? I wonder how can we use it to be able to transfer ERC20 tokens between EVM-based blockchains. Thank you very much about such rich content!
@KirillDvoretskov
@KirillDvoretskov 2 жыл бұрын
thanks!!!!!!
@Ts2pc
@Ts2pc 2 жыл бұрын
I am confused this for 24 hours. For example, if I decide to donate 1 ETH to you today(6/19), and I set the _timestamp= 1 day, so what does that mean? then, you set min=3 days and max=10days, so what does that mean? then you set the grace_period = 30 days, so what does that mean? we already have current+min and cruuent+max, why still need grace_period? in the other word, if we have grace_period, then we don't need current+min and current+max? also, is the _timestamp really necessary?
@mustaphaidris1584
@mustaphaidris1584 2 жыл бұрын
Grace period is just a period that is given to you before the transaction expires
@Ts2pc
@Ts2pc 2 жыл бұрын
@@mustaphaidris1584 Thanks for your reply! I still don't get the answer. It would very much appreciated if you can use my donate case to explain those the relationship of block.timestamp, min delay, max delay and grace period!
@eatmungbeans
@eatmungbeans 2 жыл бұрын
MIN and MAX dictate the range of time you can *set* for the transaction to be executable. Grace period is the amount of time you have after the time that was set to execute the transaction
@Ts2pc
@Ts2pc 2 жыл бұрын
@@eatmungbeans Thanks a lot! It’s really helpful!
@bskrksyp
@bskrksyp 2 жыл бұрын
And there is no way to keep repeating on certain interval right ? for that we may have to use Chainlink Keepers ?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
Yes. Chainlink keeper or write a bot or something
@muzingnimzing438
@muzingnimzing438 2 жыл бұрын
Isn't this what is used for vesting of tokens???
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
No. I can make a video about vesting
@muzingnimzing438
@muzingnimzing438 2 жыл бұрын
@@smartcontractprogrammer Was there ever a time that you weren't good at this...so good it seems you were born with it...thanks for being available ... Honestly wouldn't mind the vesting video...
@kumarprasoon8881
@kumarprasoon8881 2 жыл бұрын
please help , this code is not running in remix ide
@McMcMarik
@McMcMarik 2 жыл бұрын
Hey, why passing all the params twice in queue and execute, instead of string the tx with a running tx_id, and just using it in execute(tx_id)?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
expensive to store transaction data
@hippocratech
@hippocratech 2 жыл бұрын
Is there any reason you use "revert" with custom defined errors, rather then "require"?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
Just to mix things up. Also can't use require with custom errors.
@MrCoreyTexas
@MrCoreyTexas 4 ай бұрын
I guess with custom errors you can pass in arguments appropriate to the situation, whereas when you use require, generally it outputs a fixed string. I've tried to do string manipulation in Solidiy, and let me tell you, it is really hairy & ugly. I haven't tested, but I'm guessing it would use less gas to use custom errors vs. trying some kind of string manipulation with require().
@heresmypersonalopinion
@heresmypersonalopinion Жыл бұрын
DOES THIS DELAY ALL BUYS AND SELLS?
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
no
@crypto_peng
@crypto_peng 2 жыл бұрын
9:33 how you quickly re-align the code in Remix?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
highlight + tab or highlight + shift + tab
@crypto_peng
@crypto_peng 2 жыл бұрын
@@smartcontractprogrammer awesome
@rajvishah1877
@rajvishah1877 Жыл бұрын
Where can I find the full code?
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
solidity-by-example.org/app/time-lock/
@22-Zar
@22-Zar 2 жыл бұрын
Is it possible to time lock a flash loan?
@daniel.contreras
@daniel.contreras 2 жыл бұрын
No, flashloans need to be repaid in the same transaction, so no delays are allowed. When doing time locks, you are operating with two or more different transactions.
@gosuto-inzasheru
@gosuto-inzasheru 2 жыл бұрын
@@daniel.contreras you could still queue a flashloan into a timelock, and have it execute (and pay back) in the same future block. Not sure if that is what the question is about though.
WETH | Solidity 0.8
5:12
Smart Contract Programmer
Рет қаралды 10 М.
Crowd Fund | Solidity 0.8
20:58
Smart Contract Programmer
Рет қаралды 13 М.
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 16 МЛН
Haunted House 😰😨 LeoNata family #shorts
00:37
LeoNata Family
Рет қаралды 14 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2 МЛН
Keccak256 Hash Function | Solidity 0.8
8:41
Smart Contract Programmer
Рет қаралды 16 М.
Protect Your Users With Smart Contract Timelocks
30:54
OpenZeppelin
Рет қаралды 8 М.
How to delay transactions with Time Lock - Solidity Tutorial
21:23
Unmasking deadrosesxyz $1M in 2024 after only 1,5 year in web3sec
47:47
Multi Sig Wallet | Solidity 0.8
19:22
Smart Contract Programmer
Рет қаралды 27 М.
Access Control | Solidity 0.8
11:40
Smart Contract Programmer
Рет қаралды 14 М.
Deploy Any Contract | Solidity 0.8
10:49
Smart Contract Programmer
Рет қаралды 20 М.
Vault | Solidity 0.8
11:06
Smart Contract Programmer
Рет қаралды 10 М.
Verify Signature | Solidity 0.8
14:50
Smart Contract Programmer
Рет қаралды 31 М.
Delegatecall | Solidity 0.8
9:26
Smart Contract Programmer
Рет қаралды 25 М.
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 16 МЛН