𧑠Payable
μ΄λ리μμ μ§λΆμ κ΄μ¬ν μ μλ ν¨μ μ μ΄μμ΄λ€.
contract OnlineStore {
function buySomething() external payable {
require(msg.value == 0.001 ether);
transferThing(msg.sender);
}
}
𧑠Random Numbers
keccak256μ μ΄μ©ν΄ λμλ₯Ό μμ±ν μ μλ€.
uint randNonce = 0;
uint random = uint(keccak256(now, msg.sender, randNonce)) % 100;
randNonce++;
uint random2 = uint(keccak256(now, msg.sender, randNonce)) % 100;
https://share.cryptozombies.io/ko/lesson/4/share/bjloed?id=WyJjenwxMjAyMjMiLDEsMTRd
'Solidity' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[CryptoZombie] 1-5 ERC721 & Crypto-Collectibles (1) | 2021.08.02 |
---|---|
[CryptoZombie] 1-3 Advanced Solidity Concepts (0) | 2021.07.22 |
[CryptoZombie] 1-2 Zombies Attack Their Victims (0) | 2021.07.22 |
[CryptoZombie] 1-1 Making the Zombie Factory (0) | 2021.07.22 |
[Chap4] μ€λ§νΈ 컨νΈλνΈμ κ°λ (0) | 2021.07.16 |