Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 575 Bytes

26-doubleentrypoint.md

File metadata and controls

19 lines (15 loc) · 575 Bytes

LegacyToken delegates transfers to DET. If we sweep the vault using the LGT address it will end up draining the DET token. We can detect this by checking the origSender value

contract VaultBot is IDetectionBot {
    address vault;

    constructor(address _vault) {
        vault = _vault;
    }

    function handleTransaction(address user, bytes calldata msgData) external {
      (,, address origSender) = abi.decode(msgData[4:], (address,uint256,address));

        if (origSender == vault) {
            IForta(msg.sender).raiseAlert(user);
        }
    }
}