Skip to content
Verified contractPartialMIT

QWLAWrapper

Address0xfa5c890b6ff227ef87b514135f2cf7036c9b58ac
Balance

0 ETH

 

Transactions

4

 

Compiler

solc 0.8.26

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.26+commit.8a97fa7a
Language
solidity
Optimization
No
EVM version
cancun
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
21,713,970
Creation transaction
0x58638c9990…10466ca024

QWLAWrapper.sol

// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

// File: qwlaWrapper.sol


pragma solidity ^0.8.0;



// ________  __      __.____       _____   
// \_____  \/  \    /  \    |     /  _  \  
//  /  / \  \   \/\/   /    |    /  /_\  \ 
// /   \_/.  \        /|    |___/    |    \
// \_____\ \_/\__/\  / |_______ \____|__  /
//        \__>     \/          \/       \/ 


contract QWLAWrapper {
    // Reference to the original QWLA token contract on Ethereum
    IERC20 public immutable originalToken;

    /**
     * @dev Constructor to set the address of the original QWLA token.
     * @param _originalToken The address of the QWLA Layer 1 token contract.
     */
    constructor(address _originalToken) {
        require(_originalToken != address(0), "Invalid original token address");
        originalToken = IERC20(_originalToken);
    }

    /**
     * @dev Returns the total supply of the token from the original contract.
     */
    function totalSupply() external view returns (uint256) {
        return originalToken.totalSupply();
    }

    /**
     * @dev Returns the balance of a given account from the original contract.
     * @param account The address of the account to query.
     */
    function balanceOf(address account) external view returns (uint256) {
        return originalToken.balanceOf(account);
    }

    /**
     * @dev Forwards the `transfer` call to the original contract.
     * @param recipient The address to transfer tokens to.
     * @param amount The amount of tokens to transfer.
     * @return success Whether the transfer succeeded.
     */
    function transfer(address recipient, uint256 amount) external returns (bool) {
        require(originalToken.transfer(recipient, amount), "Transfer failed");
        return true; // Ensures compatibility with bridges
    }

    /**
     * @dev Forwards the `approve` call to the original contract.
     * @param spender The address allowed to spend the caller's tokens.
     * @param amount The amount of tokens approved for spending.
     * @return success Whether the approval succeeded.
     */
    function approve(address spender, uint256 amount) external returns (bool) {
        require(originalToken.approve(spender, amount), "Approval failed");
        return true; // Ensures compatibility with bridges
    }

    /**
     * @dev Forwards the `transferFrom` call to the original contract.
     * @param sender The address from which tokens will be sent.
     * @param recipient The address receiving the tokens.
     * @param amount The amount of tokens to transfer.
     * @return success Whether the transfer succeeded.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
        require(originalToken.transferFrom(sender, recipient, amount), "TransferFrom failed");
        return true; // Ensures compatibility with bridges
    }

    /**
     * @dev Returns the remaining allowance of a spender for a given owner from the original contract.
     * @param owner The address of the account owning the tokens.
     * @param spender The address allowed to spend the owner's tokens.
     */
    function allowance(address owner, address spender) external view returns (uint256) {
        return originalToken.allowance(owner, spender);
    }
}
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "cancun",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.