Giter Site home page Giter Site logo

Comments (1)

China-Chris avatar China-Chris commented on June 1, 2024 1

这部分仅代表我自己的理解。

在以太坊只能合约中,msg.sender 和 tx.origin 是两个特殊的全局变量,用与获取调用合约的地址和交易的发送者地址。

msg.sender的全拼是 ,esahe sender(消息发送者) 代表当前合约执行上下文的调用者地址。他对这个地址不做任何限制,意味着它可以是外部账户的地址也可以是一个合约地址

而 tx.origin 的全拼是transaction origin(交易发起者)。也就是说 tx.origin 代表当前交易的原始发送者地址,既最初触发整个调用链的账户地址。 无论中间有多少合约调用。tx.orgin 都指向整个最初的交易账户地址,他不会随着合约的改变而改变。

from professional-solidity.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.