找到约 15 条结果

文章 剖析DeFi交易产品之UniswapV4:合约结构篇

... assembly { balanceDelta := or(shl(128, _amount0), and(0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff, _amount1)) } } ``` 该函数就是将两个代币的金额一起转成 `BalanceDelta` 类型。可看到其实现使用了内联汇编,其实...

文章 使用 PyTorch 实现可复现的深度学习

...随机数生成器(PRNGs)是可复现的。这样做如下: ``` import random import numpy as np from numpy.random import MT19937 from numpy.random import RandomState, SeedSequence import torch SEED = 12345 rs = RandomState(MT19937(SeedSequence(SEED))) random.seed(SEED) torch.manual_seed(SEED) ``` ...

文章 MEV-Day 2022 活动总结

...信息和隐私](https://help.twitter.com/en/twitter-for-websites-ads-info-and-privacy) [40](https://twitter.com/intent/like?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1517423348443226120%7Ctwgr%5Eeeb0e948cbd67c9a6fd2b203c65cce3ef94266d5%7Ctwcon%5Es1_&ref_url=https%3A%2F%2Fblog.shutter.ne...

文章 deny_list在coin中的应用

...ion failed due to issues with transaction inputs, please review the errors and try again: Address 0x48c5fdc3d18989593d68435f4f4310f67391298c1b2e1325fae7a4a9fb8fd6e7 is denied for coin 4f76f0634d1dff123c19150ba96ce0ed7f56eb4dbda28ab66b627fdb1ecff523::rcoin::RCOIN. ``` 5. address1将address2从de...

文章 去中心化 Rollups

...,一种常见的方法是依靠较小的验证器集合。例如,Algorand和Polkadot使用随机抽样的较小委员会来批量处理交易。所有节点使用随机信标和可验证随机函数(VRF),在给定时期内被包含在委员会中的概率与其质押数量成比例。 ...

文章 EIP712实践

...2Practice.getTypedDataHash(permit); // signing with private key and typed data hash. (v, r, s) = vm.sign(aPrivateKey, digest); // call smart contrat with signature eip712Practice.permitDoSomething( permit.signer, permit.message1, ...

文章 DeFi借贷概念 #3:奖励

...辑,请看他们的[文档](https://docs.liquity.org/faq/stability-pool-and-liquidations)。 Liquity 通过发行协议代币(LQTY)的奖励来进一步激励对稳定池的参与。让我们来看看分配逻辑: ```Solidity pragma solidity ^0.8.13; function _getLQTYGainFromSnapsh...

文章 Michael.W基于Foundry精读Openzeppelin第45期——ERC20FlashMint.sol

...ockERC20FlashMint is ERC20FlashMint { bool private _customizedFlashFeeAndReceiver; constructor( string memory name, string memory symbol, address richer, uint totalSupply ) ERC20(name, symbol) { _mint(richer, totalSupply); ...

文章 Rust不寻常的语法

...应谨慎使用。 现在,考虑以下代码: ```rust pub fn encode_and_decode(_ctx: Context) -> Result { // 创建`Person`结构的新实例 let init_person: Person = Person { name: "Alice".to_string(), age: 27, }; // 将`init_person`结构编码为字节向...

文章 Solidity 历史版本更新日志

... * EVM: 对于 EVM 版本 >= paris,在 Solidity 中引入 ``block.prevrandao`` 并且在内联汇编中引入 ``prevrandao()``。 * EVM: 将默认 EVM 版本设置为 "Paris"。 * EVM: 支持 EVM 版本 "Paris"。 * 语言服务器: 添加基本文档悬停支持。 * Natspec: 为 devdoc 添...

文章 Sig Engineering - 第四部分 - Solana 账本和区块存储

...释文章](https://learnblockchain.cn/article/16835/#basics-of-validators-and-validator-clients)。 ## Solana 的账本 在 Solana 中,账本是一个包含每笔交易历史记录的数据库。 为了促进共识,大量交易被组合在一起形成区块。这引入了一个潜在的网络...

文章 The Graph 与 Bitquery 区块链数据方案对比

> * 来源:https://bitquery.io/blog/thegraph-and-bitquery 作者: BitQuery > * 译文出自:[登链翻译计划](https://github.com/lbc-team/Pioneer) > * 译者:[翻译小组](https://learnblockchain.cn/people/412) > * 本文永久链接:[learnblockchain.cn/article…](https://learnbloc...

文章 如何在比特币上验证零知识证明(ZK证明)?

...](https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication#Double-and-add) 算法,这会需要数百条指令。 另一个被禁用且在 Twitter 上成为热点话题的操作码是 OP\_CAT。你可能会看到一些比特币爱好者在他们的 Twitter 资料中包含 OP\_CAT,以展...

文章 关于空投

...[关于Axie Infinity的文章](https://www.decentralised.co/p/to-infinity-and-beyond),当时他们的规模还很小,而且[Nansen的Alex](https://www.decentralised.co/p/alpha-leak-generators)在他们募集到7500万美元之前很久就接受了采访。 今天,我带着一个类似的故...

文章 Zetachain:构建全链理论

...拟机、Cosmos 和其他生态系统上运行它们。Axelar 使用“hub-and-spoke”拓扑,其中各个区块链连接到其中心 hub,从而简化了跨链开发。 总之,全链基础设施旨在无缝地互连任何区块链网络,从而允许数字资产和数据在区块链之间自...