找到约 13 条结果

文章 【源码解读】以太坊新标准EIP-4907是怎样实现NFT租赁的?

...。 ### **2.1 、实现原理:** 他作为 [ERC-721](https://learnblockchain.cn/article/2077) 的扩展, EIP-4907 增加了一个变量UserInfo,让应用可以查询此NFT当前被租出去的目标地址“user”和出租时间”expires"。如果发现已经超出出租时间,则租...

文章 UniswapV2 深入解析系列 07:存储优化与Gas节省策略

...ate reserve1; // token1 储备量 (14 bytes) uint32 private blockTimestampLast; // 最后更新时间戳 (4 bytes) // 存储槽 3:price0CumulativeLast (32 bytes) uint256 public price0CumulativeLast; // 存储槽 4:price1CumulativeLast (32 bytes) u...

问题 关于remix部署的一个安全问题,这个是什么问题?

![image.png](https://img.learnblockchain.cn/attachments/2021/11/uYxet3Po619f6f0ee7058.png) ![image.png](https://img.learnblockchain.cn/attachments/2021/11/5l8K0odl619f6f1cd08bc.png) ``` ``` ``` function proposal() public { require(msg.sender == admin, "Only admin can give right to ...

问题 TransferHelper: TRANSFER_FROM_FAILED

... 0, path, address(this), block.timestamp ); } ```

问题 调用swapExactTokensForTokens如何节约gas

...a55603e5c3).swapExactTokensForTokens(amountIn,amountOut,path,address(this),block.timestamp+15); } ``` 这是我写的购买token的函数,调用时要花费13万gas,但我观察到像1inch的交换只花费了11万gas,还有的合约只花费10万gas左右,这里还有更底层节约gas...

问题 请问这段代码怎么理解,索引是一个区块

if(sender == pair && (launchedAt + deadBlocks) > block.number){ feeAmount = amount.div(100).mul(99);

问题 为什么头部科学家的脚本都是写到智能合约里?

...的,例子如下: 1、这是区块信息:https://etherscan.io/txs?block=14864530 2、具体的交易如下:![image.png](https://img.learnblockchain.cn/attachments/2022/05/v6NlkR4V629329a6af104.png) 大家可以看到这笔交易就是通过智能合约内部去调用uniswapv2 和v3的...

问题 大佬来帮忙解答一下关于gas排序得问题

![e6b3242f53dabdd8776abe8db980bb8.png](https://img.learnblockchain.cn/attachments/2022/07/DtfARaqY62ce73d6a0634.png) 这是该区块gas以及排序得数据 [15132746](https://etherscan.io/block/15132746) 区块号15132746 问题就是。我给了1500得gasprice为何还是排在了第9.购...

问题 solidity中能达到当前交易的交易hash吗

在solidity中有很多全局变量,比如block.timestamp,days这样的,有当前交易hash这个变量吗,比如执行转账,在solidity中就获取这笔转账的交易hash

问题 在polygon上使用flashbots发送交易报错?

... try: self.w3.flashbots.simulate(bundle, block) print("Simulation successful.") except Exception as e: print("Simulation error", e) return 报错 Simulation error The field extraData is 97 bytes, bu...

问题 有什么办法能够计算出智能合约运算的时间成本?(毫秒级)

`block.timestamp`的单位是秒,所以当我用两个时间戳相减的时候,得到的返回值就是0了。如果我想要更精确的运算时间有什么办法吗? 另外我也考虑到利用本地精确计算时间的办法,我认为这样的数据可以对比两种算法的快慢...

问题 使用Thegraph托管服务稳定运行两天,出现如下错误。

...talError+%7B%0A++++++handler%0A++++++message%0A++++++deterministic%0A++++++block+%7B%0A++++++++hash%0A++++++++number%0A++++++%7D%0A++++%7D%0A++++chains+%7B%0A++++++chainHeadBlock+%7B%0A++++++++number%0A++++++%7D%0A++++++earliestBlock+%7B%0A++++++++number%0A++++++%7D%0A++++++latestBlock+%7B%0A+++++++...

问题 区块浏览器这个区块奖励是怎么拿到的

![image.png](https://img.learnblockchain.cn/attachments/2022/12/ky5Jy6Ra63919089c2221.png) ![image.png](https://img.learnblockchain.cn/attachments/2022/12/eegrc5zD639190aecd3f6.png) 我用golang代码扫描区块,block里没找对应的方法。