小编Vov*_*ova的帖子

使用 Remix 与 ABI 部署的合约进行交互

如何在没有源代码的情况下使用 Remix 与以太坊上已部署的合约(不是我的合约)进行交互,但我有 ABI。

我想要这样做的原因是因为某些合同有超过 20 个 .sol 文件,我不想手动复制并粘贴到 Remix 中。

abi ethereum smartcontracts remix

11
推荐指数
1
解决办法
2818
查看次数

Context.sol 在 Openzepplin 中的用途是什么

我是 Solidity 新手,并尝试使用 openzepplin 部署 ERC20 令牌。有一件事对我来说没有意义,那就是 context.sol 文件。从评论部分来看,context.sol 的主要功能似乎是实现 GSN 兼容合约,因此您不使用 msg.sender,而是使用 _msgSender()

abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
Run Code Online (Sandbox Code Playgroud)

从我有限的 Solidity 经验来看,它似乎对 msg.sender 做了完全相同的事情。

solidity ether

3
推荐指数
1
解决办法
1800
查看次数

标签 统计

abi ×1

ether ×1

ethereum ×1

remix ×1

smartcontracts ×1

solidity ×1