Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实在没找出23题哪里做错了 #531

Open
edxzh opened this issue Aug 15, 2023 · 2 comments
Open

实在没找出23题哪里做错了 #531

edxzh opened this issue Aug 15, 2023 · 2 comments

Comments

@edxzh
Copy link

edxzh commented Aug 15, 2023

一直是83分,但是我怎么都感觉这6道题都是对的,希望哪位能指出问题:
我的答案:
1.delegatecall是哪个类型的成员函数: address
2. 当用户A通过合约B来delegatecall合约C时,执行了__的函数,语境是__,msg.sender和msg.value来自__, 并且如果函数改变一些状态变量,产生的效果会作用于__的变量上: C;B;A;B
3. delegatecall在调用合约时: 可以指定交易发送的gas,但不可以指定发送的ETH数额
4. 使用delegatecall对当前合约和目标合约的状态变量有什么要求?: 变量名、变量类型、声明顺序都必须相同
5. 假设存在如下函数:那么下面选项中可以填在横线上的是? (bool success, bytes memory data) = addr.delegatecall(abi.encodeWithSignature("mint(uint256)", num));
6. 在代理合约中,存储所有相关的变量的是
_,存储所有函数的是___,同时____________ : 代理合约; 逻辑合约; 代理合约delegatecall逻辑合约

@TanLingxiao
Copy link

4, 5 错了 建议查一下资料或者用remix跑一下

@XdpCs
Copy link
Contributor

XdpCs commented Nov 15, 2023

4和5 存在问题
4. 使用delegatecall对当前合约和目标合约的状态变量有什么要求?:
变量类型、声明顺序都必须相同,变量名可以不同,因为其实就是一个个slot的对应
image

  1. 假设存在如下函数:那么下面选项中可以填在横线上的是?
    (bool success, bytes memory data) = addr.delegatecall(abi.encodeWithSignature("mint(uint256)", _num));
    注意一下,num并没有声明过,传入的变量名字叫_num

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants