verida / blockchain-contracts

Smart contracts, part of the protocol powering the Verida Network
https://www.verida.network
Apache License 2.0
7 stars 2 forks source link

[VDA-ERC20] enableTransfer() fix #134

Closed tahpot closed 10 months ago

tahpot commented 11 months ago

Feedback from Hashlock audit.

[QA-01] Function should be named enableMint()

VeridaToken.enableTransfer() should be called enableMint.

The isTransferEnabled variable is only used to check if the transfer is a mint not if the token is being transfered so the name should be changed to match the functionality:

if (!isTransferEnabled) { 
            assembly { 
                if eq(iszero(sender), 0) { 
                    if eq(iszero(recipient), 0) { 
                        let ptr := mload(0x40) 
                        mstore(ptr, 0x69126dbd00000000000000000000000000000000000000000000000000000000) 
                        revert(ptr, 0x4) //revert TransferLimited() 
                    } 
                } 
            } 
        } 

@ITStar10 I'd prefer the functionality be changed to check if the token is being transferred, it shouldn't care about mint.

tahpot commented 10 months ago

Upon further investigation, fix not required. Needed up update the logic so it matched enableTransfer(0