摘要: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; //remove array element by shifting elements to left //[1,2,3,4,5,6] -- remove(2) --> [1,2, 阅读全文
posted @ 2022-07-28 23:37 ZaleSwfit 阅读(204) 评论(0) 推荐(0) 编辑
摘要: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; //mapping //how to declare a mapping (simple and nested) //Set, get ,delete //["alice", "b 阅读全文
posted @ 2022-07-28 23:37 ZaleSwfit 阅读(60) 评论(0) 推荐(0) 编辑
摘要: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; contract ArrayShift { uint[] public arr; function example() public { arr = [1,2,3]; delete 阅读全文
posted @ 2022-07-27 12:38 ZaleSwfit 阅读(146) 评论(0) 推荐(0) 编辑
摘要: // SPDX-License-Identifier: GPL-3.0 //array -dynamic or fixed size //Initialization // Insert(push),get, update, delete,pop, length // createing array 阅读全文
posted @ 2022-07-26 22:31 ZaleSwfit 阅读(102) 评论(0) 推荐(0) 编辑
摘要: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; contract FunctionOutputs { function returnMany() public pure returns (uint, bool) { return 阅读全文
posted @ 2022-07-26 15:33 ZaleSwfit 阅读(27) 评论(0) 推荐(0) 编辑
摘要: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; contract Ownable { address public owner; constructor() { owner = msg.sender; } modifier on 阅读全文
posted @ 2022-07-26 11:41 ZaleSwfit 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 一些变量的固定值,这些变量的值不能在部署合约后被任何函数修改;管理员地址和特殊编码通常定义为常量。默认常量可以减少gas费消耗 阅读全文
posted @ 2022-07-25 00:43 ZaleSwfit 阅读(34) 评论(0) 推荐(0) 编辑
摘要: chrome谷歌商店搜索sui钱包安装 阅读全文
posted @ 2022-07-23 23:38 ZaleSwfit 阅读(619) 评论(0) 推荐(0) 编辑
摘要: bytes32 public constant INIT_CODE_PAIR_HASH = keccak256(abi.encodePacked(type(UniswapV2Pair).creationCode)); 阅读全文
posted @ 2022-07-22 23:30 ZaleSwfit 阅读(33) 评论(0) 推荐(0) 编辑
摘要: multical合约作用:在运行一个交易所/去中心化金融dapp的项目前端时,前端要向区块链读很多数据,也许一个页面就充满了数据,tlv ,币价,挖矿合约,锁仓量。这些数据需要一个个去链上读取一个个合约,一个个方法去读,但是这样会造成大量的对链请求。可以将大量的请求安装以太坊的规则进行封装,然后一次 阅读全文
posted @ 2022-07-20 00:11 ZaleSwfit 阅读(767) 评论(0) 推荐(0) 编辑