上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: ontract can call other contracts in 2 ways. The easiest way to is to just call it, like A.foo(x, y, z). Another way to call other contracts is to use 阅读全文
posted @ 2022-08-02 12:11 ZaleSwfit 阅读(39) 评论(0) 推荐(0)
摘要: Events allow logging to the Ethereum blockchain. Some use cases for events are: Listening for events and updating user interface A cheap form of stora 阅读全文
posted @ 2022-08-02 12:10 ZaleSwfit 阅读(26) 评论(0) 推荐(0)
摘要: Libraries are similar to contracts, but you can't declare any state variable and you can't send ether. A library is embedded into the contract if all 阅读全文
posted @ 2022-08-01 00:29 ZaleSwfit 阅读(24) 评论(0) 推荐(0)
摘要: keccak256 computes the Keccak-256 hash of the input. Some use cases are: Creating a deterministic unique ID from a input Commit-Reveal scheme Compact 阅读全文
posted @ 2022-08-01 00:28 ZaleSwfit 阅读(41) 评论(0) 推荐(0)
摘要: abi.encode encodes data into bytes. abi.decode decodes bytes back into data. // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; contract AbiDeco 阅读全文
posted @ 2022-08-01 00:28 ZaleSwfit 阅读(104) 评论(0) 推荐(0)
摘要: Messages can be signed off chain and then verified on chain using a smart contract. Example using ethers.js // SPDX-License-Identifier: MIT pragma sol 阅读全文
posted @ 2022-08-01 00:27 ZaleSwfit 阅读(34) 评论(0) 推荐(0)
摘要: Gas Saving TechniquesSome gas saving techniques. Replacing memory with calldataLoading state variable to memoryReplace for loop i++ with ++iCaching ar 阅读全文
posted @ 2022-08-01 00:27 ZaleSwfit 阅读(19) 评论(0) 推荐(0)
摘要: Ether WalletAn example of a basic wallet. Anyone can send ETH.Only the owner can withdraw. // SPDX-License-Identifier: MITpragma solidity ^0.8.13; con 阅读全文
posted @ 2022-08-01 00:26 ZaleSwfit 阅读(31) 评论(0) 推荐(0)
摘要: Modifiers are code that can be run before and / or after a function call. Modifiers can be used to: Restrict access Validate inputs Guard against reen 阅读全文
posted @ 2022-08-01 00:26 ZaleSwfit 阅读(38) 评论(0) 推荐(0)
摘要: Solidity supports multiple inheritance. Contracts can inherit other contract by using the is keyword. Function that is going to be overridden by a chi 阅读全文
posted @ 2022-07-31 22:53 ZaleSwfit 阅读(30) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 9 下一页