contract WethConverter {
    WETH9Like constant private weth9 = WETH9Like(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); // ETH wrapper contract v9
    WETH10Like constant private weth10 = WETH10Like(0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9F); // ETH wrapper contract v10
    
    receive() external payable {}

    function weth9ToWeth10(address account, uint256 value) external payable {
        weth9.transferFrom(account, address(this), value);
        weth9.withdraw(value);
        weth10.depositTo{value: value + msg.value}(account);
    }

    function weth10ToWeth9(address account, uint256 value) external payable {
        weth10.withdrawFrom(account, address(this), value);
        uint256 combined = value + msg.value;
        weth9.deposit{value: combined}();
        weth9.transfer(account, combined);
    }
}
// ETH wrapper contract v10