solidityguard-openenv / data /samples /task3 /tx_origin_auth.sol
tanaymitra98
Initial commit: MetaXScalar project
b214779
Raw
History Blame Contribute Delete
300 Bytes
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract OriginAuth {
address public owner;
constructor() {
owner = msg.sender;
}
function withdraw(uint256 amount) public {
require(tx.origin == owner);
payable(msg.sender).transfer(amount);
}
}