Skip to main content

EchidnaTestApproval

EchidnaTestApproval​

testTransferFromShouldNotRevert​

function testTransferFromShouldNotRevert(uint8 authorizedAcc, uint8 fromAcc, uint8 toAcc, uint256 amount) public

Performing transferFrom with an amount inside the allowance should not revert

Parameters​

NameTypeDescription
authorizedAccuint8The account that is authorized to transfer
fromAccuint8The account that is transferring
toAccuint8The account that is receiving
amountuint256The amount to transfer

testTransferFromShouldRevert​

function testTransferFromShouldRevert(uint8 authorizedAcc, uint8 fromAcc, uint8 toAcc, uint256 amount) public

Performing transferFrom with an amount outside the allowance should revert

Parameters​

NameTypeDescription
authorizedAccuint8The account that is authorized to transfer
fromAccuint8The account that is transferring
toAccuint8The account that is receiving
amountuint256The amount to transfer

testApprove​

function testApprove(uint8 ownerAcc, uint8 spenderAcc, uint256 amount) public

Approving an amount should update the allowance and overwrite any previous allowance

Parameters​

NameTypeDescription
ownerAccuint8The account that is approving
spenderAccuint8The account that is being approved
amountuint256The amount to approve

testIncreaseAllowance​

function testIncreaseAllowance(uint8 ownerAcc, uint8 spenderAcc, uint256 amount) public

Increasing the allowance should raise it by the amount provided

Parameters​

NameTypeDescription
ownerAccuint8The account that is approving
spenderAccuint8The account that is being approved
amountuint256The amount to approve

testDecreaseAllowance​

function testDecreaseAllowance(uint8 ownerAcc, uint8 spenderAcc, uint256 amount) public

Decreasing the allowance should lower it by the amount provided

Parameters​

NameTypeDescription
ownerAccuint8The account that is approving
spenderAccuint8The account that is being approved
amountuint256The amount to approve