Skip to content
Unverified Commit d69a80e6 authored by Cyrill Leutwiler's avatar Cyrill Leutwiler Committed by GitHub
Browse files

[pallet-revive] rework balance transfers (#6187)



This PR removes the `transfer` syscall and changes balance transfers to
make the existential deposit (ED) fully transparent for contracts.

The `transfer` API is removed since there is no corresponding EVM opcode
and transferring via a call introduces barely any overhead.

We make the ED transparent to contracts by transferring the ED from the
call origin to nonexistent accounts. Without this change, transfers to
nonexistant accounts will transfer the supplied value minus the ED from
the contracts viewpoint, and consequentially fail if the supplied value
lies below the ED. Changing this behavior removes the need for contract
code to handle this rather annoying corner case and aligns better with
the EVM. The EVM charges a similar deposit from the gas meter, so
transferring the ED from the call origin is practically the same as the
call origin pays for gas.

---------

Signed-off-by: default avatarxermicus <[email protected]>
Signed-off-by: default avatarCyrill Leutwiler <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: default avatarGitHub Action <[email protected]>
Co-authored-by: default avatarPG Herveou <[email protected]>
parent 38cd03c5
Pipeline #504032 waiting for manual action with stages
in 37 minutes and 27 seconds