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

Sending and Reiving Tokens #19

Closed
dignifiedquire opened this issue Dec 20, 2017 · 5 comments
Closed

Sending and Reiving Tokens #19

dignifiedquire opened this issue Dec 20, 2017 · 5 comments

Comments

@dignifiedquire
Copy link
Contributor

Sparked by a conversation with @nicola it becomes clear there are more considerations on how the token actor works and sending and receiving tokens should work.

Some notes from ethereum on this

@nicola
Copy link
Contributor

nicola commented Dec 20, 2017

Nicola's problem:

  • The current version does not allow for sending money to a contract that will trigger a special function.
  • In Ethereum you can send a transaction that executes a function call that passes the money to the contract account.

Nicola's possible solution:

  • Make TokenActor a special contract
  • Add "Amount" in "Message"
  • Add condition for the miner: if a message has an amount move amount to the Receiver

@dignifiedquire
Copy link
Contributor Author

The current version does not allow for sending money to a contract that will trigger a special function.

Not entirely, it is simply not defined right now, as we have not yet defined the permissions of the transfer method.

In Ethereum you can send a transaction that executes a function call that passes the money to the contract account.

Yes, but the system is pretty complicated, and looking at the docs quite easy to get wrong. That said they achieve this through specific methods that are called when transfering money that check if the contract has the correct permissions.

Make TokenActor a special contract

What kind of special? How would this get around the issue?

Add "Amount" in "Message"
Add condition for the miner: if a message has an amount move amount to the Receiver

This would make me very sad, and not necessarily solve the issue as we would run into the 4th issue mentioned in the security considerations from ethereum, as far as I understand.

@dignifiedquire
Copy link
Contributor Author

Need to do some reading on how, polkadot and tezos do this.

@whyrusleeping
Copy link
Member

It would be helpful to have a few sample usecases of "send money to a function call on another actor". This in general isnt really that difficult, its going to be the same sort of logic that multisig wallet contracts in ethereum use to invoke other contracts.

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

4 participants