问题标签 [erc20]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
web3js - 如何使用 web3.js 购买或出售 erc20 代币?
我将在 web3.js 中使用哪个函数从我的网站购买 erc20 令牌?
ethereum - 如何为单笔交易设置不同的签名者和汽油支付者
我正在尝试将DAI代币从用户钱包0xDAIUserWallet 交易到一些随机代币合约,比如0xRandomContractAddress。在这种情况下,我使用 DAI 用户的私钥来签署交易并支付汽油费,因为他是代币的所有者。
我正在寻找的是使用 DAI 用户私钥签署交易,但汽油费应该由其他钱包支付。
我正在使用使用solidity 设计的标准ERC20 以太坊智能合约,并使用ethers.js 与智能合约进行交互。
ethereum - 如何使用 web3j java 签署 erc20 令牌交易
我想将 erc20 代币从一个账户转移到另一个账户。我知道我可以使用智能合约包装类的 transfer 或 transferFrom 函数。但就我而言,erc20 令牌交易需要在客户端进行签名。并且没有办法在智能合约包装函数中传递 signedTransaction。那么,如何签署 erc20 令牌交易并在 java 中使用 web3j 执行交易。
我发现了这个类似的问题。但是,它的代码不是用java编写的。而且我不知道如何在 ABI 中编码传递函数。 使用 web3 发送 ERC20 令牌
提前致谢。
solidity - 执行智能合约时的 Solidity 错误消息:“如果您发送值,则应支付被调用函数......”
我正在尝试在 REMIX IDE 上部署 ERC777 测试合约;但是当我尝试交易合同时,虚拟机给了我以下错误
虚拟机错误:还原。revert 事务已恢复到初始状态。注意:如果您发送值并且您发送的值应该小于您当前的余额,则调用的函数应该是应付的。调试事务以获取更多信息。
以下是用于部署的参数
参数:testing, TST, ["0xdD870fA1b7C4700F2BD7f44238821C26f7392148"], 10000
您能否检查我的代码并告知遗漏的内容。
// 文件:contracts\open-zeppelin-contracts\token\ERC777\ERC777.sol
// 文件:TestToken.sol
ethereum - 如何防止智能合约中的代币转移?
有什么方法可以防止智能合约中的代币从地址 A 转移到地址 B?假设它需要智能合约所有者的某种批准。假设它不是 ERC-20 代币。
move - 如何在 Libra 测试网中创建自定义代币?
我想在 Libra TestNet 中创建我的自定义令牌。我对移动编程语言了解不多,需要很多帮助。是否可以创建我们自己的实现并在 Libra 测试网中执行?
什么是示例实现代码?请提供一些有关创建它的指导。
node.js - 在 Infura Ropsten 测试网上使用 Web3JS 进行 ERC20 代币转移 - EVM 已恢复交易
因此,经过一天的搜索和许多紫色链接后,我除了问一个关于该主题的问题十几次外,别无他法,但不知何故,每个问题都是独一无二的。
信息:
节点 v12.16.1
通过 Infura API 的 Ropsten 测试网
“web3”:“1.2.6”
“ethereumjs-tx”:“2.1.2”
ERC20 代币示例,将代币名称和小数更改为 8 和
pragma solidity ^0.5.2;
重要提示:智能合约是通过 Remix(使用 0.5.3 编译器)编译和部署的,transfer()
方法通过 Metamask 测试成功。
此代码产生此错误: - EVM 已恢复事务
有趣的事实:
当我尝试通过部署智能合约时遇到同样的问题
web3.eth.sendSignedTransaction()
在兔子洞之后,我找到了将 web3 版本降低到1.0.0-beta.34 的潜在解决方案,当我这样做时,我遇到了 gas 问题——转账交易需要很长时间,最终我的 gas 用完了。大多数问题是:或
intrinsic gas too low
Transaction ran out of gas. Please provide more gas
ethereum - 如何保护 ICO 白皮书的所有权?
我有一个想法,我需要写一份白皮书并进行 ICO。我很想知道在我发布白皮书后会发生什么,其他人也可以窃取同样的内容并提出平台。我们如何防止这种情况?
erc20 - 创建 CREDITS 错误:错误:[ethjs-rpc] rpc 错误,有效载荷 {"id":291279815469,"jsonrpc":"2.0","params"
我昨天构建的代码错误
我使用混音 -> METAMASK Ropsten 测试网
实用性 >=0.4.19
错误内容
创建信用待处理...创建信用错误:错误:[ethjs-rpc] rpc 错误,有效负载 {"id":291279815469,"jsonrpc":"2.0","params":["0xf912fd4b80831269be8080b912af606060405260408051908101604052600681527f546f6d61746f0000000000000000000000000000000000000000000000000000602082015260019080516200004d929160200190620001a3565b5060408051908101604052600481527f746f746f000000000000000000000000000000000000000000000000000000006020820152600290805162000097929160200190620001a3565b506103e86003556005805461ffff191661010017905560806040519081016040908152600354612710028252600a6020830152429082015261012c6060820152601981518155602082015181600101556040820151816002015560608201518160030155505034156200010957600080fd5b60008054600160a060020a03191633600160a060020a03811691821783556003549183526008602052604090922055601480546200014b826001830162000228565b815481106200015657fe5b60009182526020909120018054600160a060020a031916600160a060020a03928316179055600580546201000060b060020a03191662010000339093169290920291909117905562000274565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001e657805160ff191683800117855562000216565b8280016001018555821562000216579182015b8281111562000216578251825591602001919060010190620001f9565b506200022492915062000254565b5090565b8154818355818115116200024f576000838152602090206200024f91810190830162000254565b505050565b6200027191905b808211156200022457600081556001016200025b565b90565b61102b80620002846000396000f3006060604052600436106101ab5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101b05780631003e2d21461023a57806318160ddd146102645780631fa423b314610289578063313ce567146102af5780633bb735e7146102d857806342966c681461030a57806343b903ea1461032057806346620e391461033f57806356a16cd3146103525780635c1efb8814610371578063619d51941461038757806370a082311461039f57806373c95a7b146103be57806374f22fb5146103dd578063894306d5146103fc5780638da5cb5b1461040f5780639562e6661461042257806395d89b41146104415780639d552ef7146104545780639f0c84d914610473578063a9059cbb14610492578063adbf343a146104b4578063bba4e4c0146104c7578063be60c906146104da578063cf309012146104f0578063d0c9beb41461052e578063d4d7b19a14610552578063dd62ed3e14610571578063ee85f78814610596578063f47140ac146105ac578063fa739158146105c2578063fbdc562a146105e1578063ff1b636d146105f9575b600080fd5b34156101bb57600080fd5b6101c361060c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ff5780820151838201526020016101e7565b50505050905090810190601f16801561022c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024557600080fd5b6102506004356106aa565b604051901515815260200160405180910390f35b341561026f57600080fd5b6102776107ca565b60405190815260200160405180910390f35b341561029457600080fd5b6102ad600160a060020a036004351660243515156107d0565b005b34156102ba57600080fd5b6102c26108d1565b60405160ff909116815260200160405180910390f35b34156102e357600080fd5b6102ee6004356108d6565b604051600160a060020a03909116815260200160405180910390f35b341561031557600080fd5b6102506004356108fe565b341561032b57600080fd5b610250600160a060020a0360043516610a20565b341561034a57600080fd5b610250610a35565b341561035d57600080fd5b610250600160a060020a0360043516610a3e565b341561037c57600080fd5b6102ee600435610a53565b341561039257600080fd5b6102ad6004351515610a61565b34156103aa57600080fd5b610277600160a060020a0360043516610aa5565b34156103c957600080fd5b610250600160a060020a0360043516610ab7565b34156103e857600080fd5b610250600160a060020a0360043516610acc565b341561040757600080fd5b610250610ae1565b341561041a57600080fd5b6102ee610aef565b341561042d57600080fd5b610250600160a060020a0360043516610afe565b341561044c57600080fd5b6101c3610b13565b341561045f57600080fd5b610250600160a060020a0360043516610b7e565b341561047e57600080fd5b610250600160a060020a0360043516610b93565b341561049d57600080fd5b6102ad600160a060020a0360043516602435610ba8565b34156104bf57600080fd5b610277610dc3565b34156104d257600080fd5b6102ee610dc9565b34156104e557600080fd5b6102ee600435610dd8565b34156104fb57600080fd5b610503610de6565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b341561053957600080fd5b6102ad600160a060020a03600435166024351515610df5565b341561055d57600080fd5b610250600160a060020a0360043516610ef5565b341561057c57600080fd5b610277600160a060020a0360043581169060243516610f0a565b34156105a157600080fd5b6102ee600435610f27565b34156105b757600080fd5b6102ee600435610f35565b34156105cd57600080fd5b610277600160a060020a0360043516610f43565b34156105ec57600080fd5b6102ad6004351515610f55565b341561060457600080fd5b6102ee610fa0565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a25780601f10610677576101008083540402835291602001916106a2565b820191906000526020600020905b81548152906001019060200180831161068557829003601f168201915b505050505081565b60055460009060ff161580156106de5750600160a060020a0333166000908152600a602052604090205460ff161515600114155b80610713575060055460ff1680156107135750600160a060020a0333166000908152600b602052604090205460ff1615156001145b80156107365750600160a060020a0333166000908152600d602052604090205442115b151561074157600080fd5b600160a060020a0333166000908152600860205260409020548290101561076757600080fd5b600160a060020a0333166000818152600860205260409081902080548501905560038054850190557f2728c9d3205d667bbc0eefdfeda366261b4d021949630c047f3e5834b30611ab9084905190815260200160405180910390a2506001919050565b60035481565b60005433600160a060020a0390811691161480610801575060055433600160a060020a039081166201000090920416145b801561081a575060055460ff6101009091041615156001145b151561082557600080fd5b600160a060020a0382166000908152600b60209081526040808320805460ff1916851515179055601090915290205460ff1615156001146108cd57601680548391906108748260018301610fb5565b8154811061087e57fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039485161790559184168152601090915260409020805460ff191660011790555b5050565b600181565b60148054829081106108e457fe5b600091825260209091200154600160a060020a0316905081565b60055460009060ff161580156109325750600160a060020a0333166000908152600a602052604090205460ff161515600114155b80610967575060055460ff1680156109675750600160a060020a0333166000908152600b602052604090205460ff1615156001145b801561098a5750600160a060020a0333166000908152600d602052604090205442115b151561099557600080fd5b600160a060020a033316600090815260086020526040902054829010156109bb57600080fd5b600160a060020a03331660008181526008602052604090819020805485900390556003805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b600b6020526000908152604090205460ff1681565b60055460ff1681565b600c6020526000908152604090205460ff1681565b60168054829081106108e457fe5b60005433600160a060020a03908116911614610a7c57600080fd5b600554610100900460ff161515610a9257600080fd5b6005805460ff1916911515919091179055565b60086020526000908152604090205481565b60106020526000908152604090205460ff1681565b600f6020526000908152604090205460ff1681565b600554610100900460ff1681565b600054600160a060020a031681565b60126020526000908152604090205460ff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a25780601f10610677576101008083540402835291602001916106a2565b60116020526000908152604090205460ff1681565b600a6020526000908152604090205460ff1681565b60055460ff16158015610bd95750600160a060020a0333166000908152600a602052604090205460ff161515600114155b80610c0e575060055460ff168015610c0e5750600160a060020a0333166000908152600b602052604090205460ff1615156001145b80610c4e5750600160a060020a0333166000908152600c602052604090205460ff1615156001148015610c4e5750600654600160a060020a038381169116145b8015610c715750600160a060020a0333166000908152600d602052604090205442115b1515610c7c57600080fd5b600160a060020a03331660009081526008602052604090205481901015610ca257600080fd5b600160a060020a0382166000908152600860205260409020548181011015610cc957600080fd5b600160a060020a033381166000818152600860205260408082208054869003905592851680825290839020805485019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a3600160a060020a0382166000908152600e602052604090205460ff1615156001146108cd5760148054839190610d678260018301610fb5565b81548110610d7157fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03948516179055939091168152600e9092525060409020805460ff19166001179055565b60045481565b600654600160a060020a031681565b60188054829081106108e457fe5b601954601a54601b54601c5484565b60005433600160a060020a0390811691161480610e26575060055433600160a060020a039081166201000090920416145b8015610e3f575060055460ff6101009091041615156001145b1515610e4a57600080fd5b600160a060020a0382166000908152600a60209081526040808320805460ff1916851515179055600f90915290205460ff1615156001146108cd5760158054839190610e998260018301610fb5565b81548110610ea357fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03948516179055939091168152600f9092525060409020805460ff19166001179055565b600e6020526000908152604090205460ff1681565b600960209081526000928352604080842090915290825290205481565b60178054829081106108e457fe5b60158054829081106108e457fe5b600d6020526000908152604090205481565b60005433600160a060020a03908116911614610f7057600080fd5b600554610100900460ff161515610f8657600080fd5b600580549115156101000261ff0019909216919091179055565b600554620100009004600160a060020a031681565b815481835581811511610fd957600083815260209020610fd9918101908301610fde565b505050565b610ffc91905b80821115610ff85760008155600101610fe4565b5090565b905600a165627a7a72305820e5c6aa2e563434ba70248c7aba8c0fd784e473b6a97b30ecb1e7c8d7e080646e002929a0e48cc93fcff0501549dc80878c9d046be954e40e43edd70a50963fe676477b04a034f2ca9b24b67941c8f613f86e21b19990a5afbd7120ae3932b1fe974eb299f4"],"method":"eth_sendRawTransaction"} [object Object]
你能帮我解决这个问题吗?
ethereum - 为什么这些以太坊合约没有席卷 USDT?
我有一个 Eth 合约,称为控制器,用于:
- 生成新的 eth 存款地址,每个用户一个,这也是一个 eth 合约。
- 当用户向他们存入 eth 或 erc20 代币时,扫描这些存款合约。资金最终进入另一个中央 eth 账户。
许多 erc20 代币似乎运行良好,但 USDT 存款交易被恢复:https ://etherscan.io/address/0x3cd5a0dc36a8f22011193f2a03910aa8260e64db
如果没有这些合约的原始源代码(虽然我有 JSON ABI),很难说:
- 为什么 USDT 失败。
- 如果这些真的可以支持 USDT,或者这样做会涉及什么。
如果有人能指出正确的方向,将不胜感激!
控制器合约:0xEb818C6a48cCd60A8078aaa20997cC3CB2538C9E
另一个与控制器相关的合同,称为 defaultSweeper:0x8e7ABAF1316A0edB985e494F572Fdf148e8a7E93
编辑:似乎 USDT 合约缺少一些 erc20 方法。喜欢transfer
看:https ://erc20-verifier.openzeppelin.com/这是为什么?