找到约 14 条结果

文章 分别使用默克尔树和数字签名两种方式给NFT合约添加白名单

...le with OpenZeppelin Contracts ^5.0.0 pragma solidity ^0.8.22; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; library MerkleProof { /** * @dev 当通过`proof`和`leaf`重建出的`root`与给定的`root`相等时,返回`true`,数据有效。 * 在...

文章 Nervos x Gitcoin bounty 任务8: 修改移植的 dApp,使之支持透过 Force Bridge 来的以太坊资产

...地址在此作为他们的以太坊地址。这是必需的,因为 SUDT-ERC20 代理合约需要一个 Polyjuice 地址。 以下代码用于从以太坊地址计算出一个 Polyjuice地址: ```jsx const { AddressTranslator } = require('nervos-godwoken-integration'); const addressTrans...

文章 每周以太坊进展 2023/1/28

...ldpat.substack.com/p/rollups-need-an-eco-system-license) ## EIP * [ERC6366](https://github.com/ethereum/EIPs/pull/6366/files):权限代币 * [ERC6372](https://eips.ethereum.org/EIPS/eip-6372):合约时钟 * [ERC6381](https://github.com/ethereum/EIPs/pull/6381/files): NFT 的扩...

文章 【100个Solidity使用技巧】2、交易回滚攻击

...license pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; interface INFT { function buyNFT() external payable; } contract NFT is ERC721 { uint256 tokenId; constructor() ERC721("NFT","NFT") {} function buyNFT() external payable { ...

文章 每周以太坊 2024/12/14

...pull/9129/files):向执行层 EL 配置文件添加 blob 时间表 * ERCs(应用层): * [ERC7837](https://github.com/ethereum/ERCs/pull/759/files):扩散性(Diffusive )代币, 在转账时铸币。 * [ERC7838](https://github.com/ethereum/ERCs/pull/762/files):特...

文章 Solidity 继承

从头实现一个 ERC20 合约无疑会让人感到疲惫。Solidity 的行为类似于面向对象的语言,并且允许继承。这里是一个最小的示例。 ```solidity contract Parent { function theMeaningOfLife() public pure returns (uint256) { ...

文章 使用铭文思路对智能合约改进

...式,使得本来智能合约能力有限的比特币可以实现类似 ERC20 的基本功能。由于使用此类技术实现的功能有限,比如 ERC20 和 NFT 中常用的白名单技术,较难实现,所以市场以“公平发射”的名义给铭文技术注入了活力。 从不理...

文章 如何开始使用Web3.unity - Quicknode

...sing ChainSafe.Gaming.UnityPackage; using Scripts.EVM.Token; public class Erc721Mint : MonoBehaviour { // 变量 private string contractAddress = "0x4f75BB7bdd6f7A0fD32f1b3A94dfF409F5a3F1CC"; // web3.unity 默认的 ERC-721 合约 private string uri = "QmfUHuFj3YL2JMZkyXNtGRV8e9aLJgQ6gc...

文章 在Substrate链上跑Solidity ERC20智能合约

**在Substrate链上跑Solidity ERC20智能合约** *jasonruan 2020.07.18* ## 1 前言 本实践案例中,我们首先会搭建和启动一条`substrate`链,再通过`MetaMask`这款著名的以太坊钱包浏览器插件,通过自定义`RPC`的方式,接入我们搭建好的`substr...

文章 使用 Viem.sh 读取NFT合约信息

...Client, http } from 'viem' import { mainnet } from 'viem/chains'; import erc721Abi from './erc721Abi.json' assert { type: 'json' }; const client = createPublicClient({ chain: mainnet, transport: http(), }) const nftContractAddress = '0x0483b0dfc6c78062b9e999a82ffb795925381415' const...

文章 每周以太坊进展 2023/3/11

...m/ethereum/EIPs/pull/6601/files):EVM 模块化算术扩展 (EVMMAX) * ERC: * [ERC6617](https://eips.ethereum.org/EIPS/eip-6617):基于位的权限 * [ERC6662](https://github.com/ethereum/EIPs/pull/6662/files) : 用于身份验证的账户抽象帐户元数据(ERC4337 扩展...

文章 合约测试 - 如何定义不变性

...张。 本文将探讨不变性到底是什么。它将概述如何在ERC4626储蓄库上定义不变性。 首先,我们将专注于定义不变性的四种属性类型。然后,我们将查看ERC4626储蓄库的每种类型的示例。 这里是进行不变性测试的魔力开始的...

文章 代理的 EIP 1967 存储槽

...或 UUPS 规范中处理。**EIP 1967 与函数选择器冲突无关。** ERC 1967 解决的问题是,`implementation` 和 `admin` 变量 **_非常可能_** 与实现合约中定义的存储变量发生冲突。具体来说,它们使用存储槽 0 和 1,这些是实现合约可能使用的槽...

文章 以太坊指南 & 教程

...ps://learnblockchain.cn/tags/ethereum) [指南\\ \\ 创建 & 部署一个 ERC-20 代币\\ \\ 本指南将让你快速了解 ERC-20 代币,并向你展示如何创建它们](https://www.quicknode.com/guides/ethereum-development/smart-contracts/how-to-create-and-deploy-an-erc20-token?utm_source=gui...