massa icon indicating copy to clipboard operation
massa copied to clipboard

Forbid coin transfers towards SC addresses

Open damip opened this issue 2 years ago • 2 comments

Make sure that normal transfer operations and ABI calls cannot credit SC addresses, and that the only way to send them coins is through function calls. This will allow filtering incoming funds and not allowing uncontrolled credits.

damip avatar Nov 24 '22 20:11 damip

I don't really the need for that, can you maybe explain why incoming funds from transaction is a problem ?

AurelienFT avatar Nov 24 '22 22:11 AurelienFT

I don't really the need for that, can you maybe explain why incoming funds from transaction is a problem ?

The SC cannot refuse them. See the discussion on discord/Dusa channel

damip avatar Nov 25 '22 06:11 damip

I'll take this one, as it's a good synergy with #3475

Ben-PH avatar Jan 31 '23 12:01 Ben-PH

I don't really the need for that, can you maybe explain why incoming funds from transaction is a problem ?

The SC cannot refuse them. See the discussion on discord/Dusa channel

@damip is this the discussion you're referring to? https://discord.com/channels/761151090673844244/973847775060054026/1029769416549871708

Are there any other convos/informations that I can refer to for better context?

Ben-PH avatar Jan 31 '23 12:01 Ben-PH

I jump in to say it's also related to the PR you make to have differentiation between user address and sc address so I think it's like a followup so your PR.

AurelienFT avatar Jan 31 '23 12:01 AurelienFT

agreed.

Ben-PH avatar Jan 31 '23 12:01 Ben-PH

It's the right discord convo.

  • for the Operation::Transaction operation type: the operation fails if the sender or destination is an SC address
  • for ABI coin transfers, the transfer fails if the destination is an SC address, unless the sender has write access to it

It's a followup after the "address type" PR

damip avatar Feb 06 '23 16:02 damip

Waiting on versioning to get started.

Ben-PH avatar Feb 07 '23 15:02 Ben-PH

Done in https://github.com/massalabs/massa/pull/4027

AurelienFT avatar Jun 19 '23 12:06 AurelienFT