Spaces:
Sleeping
Sleeping
Download data/samples/task3/tx_origin_auth.sol from tanaymitra01/solidityguard-openenv: direct link, hf CLI and curl.
- Browser
- Download file 300 Bytes
-
https://huggingface.co/spaces/tanaymitra01/solidityguard-openenv/resolve/main/data/samples/task3/tx_origin_auth.sol
- Command line
-
hf download hf://spaces/tanaymitra01/solidityguard-openenv/data/samples/task3/tx_origin_auth.sol
-
curl -L -o tx_origin_auth.sol https://huggingface.co/spaces/tanaymitra01/solidityguard-openenv/resolve/main/data/samples/task3/tx_origin_auth.sol
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); | |
| } | |
| } | |