Chargement du reste de cette comparaison.

WETH / wMNT

Créé Le diff n'expire jamais
63 suppressions
519 lignes
55 ajouts
509 lignes
/**
// SPDX-License-Identifier: MIT
*Submitted for verification at Etherscan.io on 2017-12-12
*/

// Copyright (C) 2015, 2016, 2017 Dapphub


// This program is free software: you can redistribute it and/or modify
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// (at your option) any later version.


// This program is distributed in the hope that it will be useful,
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU General Public License for more details.


// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// along with this program. If not, see <http://www.gnu.org/licenses/>.


pragma solidity ^0.4.18;
pragma solidity ^0.8.9;


contract WETH9 {
import { ERC20 } from "openzeppelin-contracts/token/ERC20/ERC20.sol";
string public name = "Wrapped Ether";
string public symbol = "WETH";
uint8 public decimals = 18;


event Approval(address indexed src, address indexed guy, uint wad);
contract WMANTLE is ERC20 {
event Transfer(address indexed src, address indexed dst, uint wad);
constructor() ERC20("Wrapped Mantle", "WMNT") {}
event Deposit(address indexed dst, uint wad);
event Deposit(address indexed dst, uint256 wad);
event Withdrawal(address indexed src, uint wad);
event Withdrawal(address indexed src, uint256 wad);


fallback() external payable {
mapping (address => uint) public balanceOf;
deposit();
mapping (address => mapping (address => uint)) public allowance;
}


function() public payable {
receive() external payable {
deposit();
deposit();
}
}

/// @dev mint tokens for sender based on amount of mantle sent.
function deposit() public payable {
function deposit() public payable {
balanceOf[msg.sender] += msg.value;
_mint(msg.sender, msg.value);
Deposit(msg.sender, msg.value);
emit Deposit(msg.sender, msg.value);
}
function withdraw(uint wad) public {
require(balanceOf[msg.sender] >= wad);
balanceOf[msg.sender] -= wad;
msg.sender.transfer(wad);
Withdrawal(msg.sender, wad);
}
}


/// @dev withdraw mantle based on requested amount and user balance.
function totalSupply() public view returns (uint) {
function withdraw(uint256 _amount) external {
return this.balance;
require(balanceOf(msg.sender) >= _amount, "insufficient balance.");
_burn(msg.sender, _amount);
payable(msg.sender).transfer(_amount);
emit Withdrawal(msg.sender, _amount);
}
}

function approve(address guy, uint wad) public returns (bool) {
allowance[msg.sender][guy] = wad;
Approval(msg.sender, guy, wad);
return true;
}
}


contract WMANTLEDeployer {
function transfer(address dst, uint wad) public returns (bool) {
function deploy() public returns(address addr) {
bytes32 salt = keccak256(abi.encodePacked("WMANTLE"));

WMANTLE w = new WMANTLE{salt: salt}();
return transferFrom(msg.sender, dst, wad);
return address(w);
}
}


function transferFrom(address src, address dst, uint wad)
function calculateAddr() public view returns(address predictedAddress){
public
returns (bool)
{
require(balanceOf[src] >= wad);
bytes32 salt = keccak256(abi.encodePacked("WMANTLE"));

if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {
predictedAddress = address(uint160(uint(keccak256(abi.encodePacked(
require(allowance[src][msg.sender] >= wad);
bytes1(0xff),
allowance[src][msg.sender] -= wad;
address(this),
}

balanceOf[src] -= wad;
salt,
balanceOf[dst] += wad;

Transfer(src, dst, wad);
keccak256(type(WMANTLE).creationCode)

return true;
)))));
}
}
}
}




/*
/*
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Version 3, 29 June 2007


Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
Everyone is permitted to copy and distribute verbatim copies