Interesting, I have never seen a modifier used really to modify :D Most common use case is just for requirements.
@web3student686
2 жыл бұрын
Hey! Many thanks for your videos. They are helping me a lot. Would it be possible for you to make a video with combined functions? For example: I know how to create a token, I know how to add tax to the token, I know how to add staking mechanism to the token and how to add liquidity on uniswap. But I really struggle to combine all those functions as it gets more complicated. That would be huuuuuuuge.
@mikechabanovskyi1021
2 жыл бұрын
Thank you 💕
@madisopabul
2 жыл бұрын
amazing
@meka4996
Жыл бұрын
Amazing. I need that!
@kumarprasoon8881
2 жыл бұрын
Thankyou soo much ❤️
@emmanueloduor8365
18 күн бұрын
Please could you explain for me why you are using block.timestamp instead of block.number when you are checking the time the reward has finished. Line 53.
@smartcontractprogrammer
16 күн бұрын
because reward rate is calculated with time
@mosipvp
2 жыл бұрын
❤
@TkGz
2 жыл бұрын
i know this is a big ask, but can you make a liquidity swap tutorial, something like uniswap ? or a bridge tutorial ?
@smartcontractprogrammer
2 жыл бұрын
maybe
@MrCoreyTexas
2 ай бұрын
It might help to watch his video "Staking Rewards - Math, Examples and Algorithm | DeFi" before you watch this.
@SamSulekQuotes
Жыл бұрын
Hey Bro, quick question if you got the time, @8:23 rewardRate[token] = _amount / duration; What if the duration is larger than the rewards? For example, if the owner wanted to put up 1000 tokens for 2 days( 172800 seconds ) 1000 / 172800 will return 0 as reward rate? Can you help me understand this or if I'm missing something, Thank you.
@smartcontractprogrammer
Жыл бұрын
tokens usually have 18 decimals so the math will be 1000 * 10**18 / 172800
@SamSulekQuotes
Жыл бұрын
@@smartcontractprogrammer That's what I figured, Thank you for confirming
@jorgeramos3203
Жыл бұрын
Hi guys...can I copy all these contract ...and everything will run smoothly..? Or is a fake contract...with bugs...or whatever..?
@mavericks.9638
2 жыл бұрын
im having a hard time understanding the interface IERC20 and how it differs from a standard ERC20 implementation like OppenZepplin ERC20 contract. i read that in interfaces they do not implement(call) any of their functions (which are required to be external) in the solidity file. would you call an interface .sol file a contract? what does an ERC20 class need to be considered an ERC20 object class?
@smartcontractprogrammer
2 жыл бұрын
ERC20 - contract IERC20 - used to call a contract without importing its code Example DAI - is a ERC20 contract. Code can be found here etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f#code But you don't need to import the entire code of DAI to use it in your contract. Import IERC20 and you can interact with DAI
@gmako6
2 жыл бұрын
Hello, what are the process for 101 class for me to be fully fullstack blockchain developer?
@smartcontractprogrammer
2 жыл бұрын
Learn basic programming with Python Learn Solidity or Vyper Learn user interface with Javascript and ethers.js Learn server side scripting with node.js and ethers.js
@АндрейБарабанов-т3у
Жыл бұрын
Thank you for the video! Could you please explain how to calculate APY in synthetic staking?
@smartcontractprogrammer
Жыл бұрын
1. record reward per share every week 2. Take difference of reward per share this and last week 3. Apply APY calc using difference from 2
@steemycoinz
Жыл бұрын
@@smartcontractprogrammer is this what rewardPerToken returns?
@Eb_Games
2 жыл бұрын
Could have you used a struct for the state variables?
@smartcontractprogrammer
2 жыл бұрын
yes Here state variables were named the same as Synthetix's staking rewards contract
@Eb_Games
2 жыл бұрын
@@smartcontractprogrammer thank you for the reply! Is there any benefit to doing it either or ?
@tskn6547
2 жыл бұрын
@@Eb_Games using struct might save gas
@drdev_blog
Жыл бұрын
Have a question. I can take rewards once per wallet, what i need to change in this contract to have infinity number of rewards?
@smartcontractprogrammer
Жыл бұрын
set duration to 100 years?
@drdev_blog
Жыл бұрын
@@smartcontractprogrammer make sense
@AbhishekYadav-jq9sp
Жыл бұрын
i didn't got what is rewardPerToken()..?? can u elaborate..
@smartcontractprogrammer
Жыл бұрын
Watch video on math and algorithm
@МаниМейк
Жыл бұрын
do we not have to approve token for our contract to be able to spend it?
@smartcontractprogrammer
Жыл бұрын
staking token - yes reward token - no, for the amount locked in the staking contract
@bencilao
Жыл бұрын
does this factor in compound?
@nickeast4853
Жыл бұрын
u need to speak slower and the wordings u picked for the functions arent precise enough to clearly state the purpose of the functions
Amazing video, thanks for your work brother. I wanna ask you, what is the best site/platform to practice writing smart contract ? (in your opinion)
@bal4350
Жыл бұрын
@smartcontractprogrammer how to stake stablecoin(USDT) and earn rewards as an usdt please help. can i put usdt address in _stakingtoken and _rewardstokens?
Пікірлер: 41