Coder Social home page Coder Social logo

Get current contract address about pyteal HOT 4 CLOSED

algorand avatar algorand commented on June 29, 2024
Get current contract address

from pyteal.

Comments (4)

jasonpaulos avatar jasonpaulos commented on June 29, 2024 2

When a transaction sends funds or assets to a LogicSig account, the LogicSig program does not execute at all. The program only executes when a transaction originates from its address. I hope that helps!

from pyteal.

Lumene98 avatar Lumene98 commented on June 29, 2024 1

Oh sorry! I'm still fairly new at this concepts, this really helps!

from pyteal.

jasonpaulos avatar jasonpaulos commented on June 29, 2024

For a LogicSig contract, Txn.sender() will be the address of the contract, with one exception.

The one situation in which Txn.sender() will not be the contract's address is if another account, let's say account B, rekeys to the contract address. Then a transaction could originate from account B, but the LogicSig is responsible for verifying it, so Txn.sender() will be the address of B.

In most cases you can probably ignore this though, since if your program approves the transaction, it affects the account B, not your program's account.

from pyteal.

Lumene98 avatar Lumene98 commented on June 29, 2024

That's fair! Thanks for the clarification... but in case I want to send some fund or asa to the fund the lsig, isn't it a transaction to the lsig from my address?

from pyteal.

Related Issues (20)

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.