ERC20 Custom storage layout

This commit is contained in:
Remco Bloemen
2018-06-25 21:55:26 +02:00
committed by Amir Bandeali
parent 394fbebfa8
commit 97a70d14a3
2 changed files with 5 additions and 3 deletions

View File

@@ -55,8 +55,6 @@ contract ERC20Proxy is
)
external
{
bool auth = authorized[msg.sender];
// `transferFrom`.
// The function is marked `external`, so no abi decodeding is done for
// us. Instead, we expect the `calldata` memory to contain the
@@ -104,7 +102,7 @@ contract ERC20Proxy is
// | | 68 | | 3. amount |
assembly {
if iszero(auth) {
if iszero(sload(caller)) {
// Revert with `Error("SENDER_NOT_AUTHORIZED")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)

View File

@@ -49,6 +49,10 @@ contract MixinAuthorizable is
!authorized[target],
"TARGET_ALREADY_AUTHORIZED"
);
assembly {
sstore(target, 1)
}
authorized[target] = true;
authorities.push(target);