Skip to content
Verified contractExactMIT

Strategy

Address0x700d46efc2e372192255b475d11e6d0543239cbe
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.34

 

Same code

1 more contract

 

Details

Compiler
solc 0.8.34+commit.80d5c536
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,393,669
Creation transaction
0x53c5eae689…3618b8b322

contracts/Strategy.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Strategy {
    address public owner;

    constructor() {
        owner = msg.sender;
    }

    // 타겟 주소로의 정밀 전송 및 실행 함수
    function executeStrike(address _target, uint256 _amount) external payable {
        require(msg.sender == owner, "Only owner can execute");
        require(msg.value >= _amount, "Insufficient ETH");
        
        // 최신 표준인 .call 방식을 사용하여 전송 (가장 안전함)
        (bool success, ) = payable(_target).call{value: _amount}("");
        require(success, "Transfer failed");
    }

    // 지갑에 남은 ETH를 다시 가져오는 함수
    function withdraw() external {
        require(msg.sender == owner, "Only owner can withdraw");
        
        // 최신 표준인 .call 방식을 사용하여 전송
        (bool success, ) = payable(owner).call{value: address(this).balance}("");
        require(success, "Withdraw failed");
    }

    function getBalance() public view returns (uint256) {
        return address(this).balance;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.