POL Price: $0.316822 (-1.66%)
Gas: 30 GWei
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Recover Contract...677585572025-02-10 12:01:283 days ago1739188888IN
0xb52a36D2...0d1707d47
0 POL0.0022834157.6795432
Deploy Contract677583502025-02-10 11:53:343 days ago1739188414IN
0xb52a36D2...0d1707d47
0 POL0.0097021944.60964055
Deploy Contract677582582025-02-10 11:49:503 days ago1739188190IN
0xb52a36D2...0d1707d47
0 POL0.091709233.36315227
Deploy Contract667699262025-01-16 13:23:2028 days ago1737033800IN
0xb52a36D2...0d1707d47
0 POL0.08335928193.98512904
Deploy Contract667698042025-01-16 13:19:0028 days ago1737033540IN
0xb52a36D2...0d1707d47
0 POL0.32818597190.83098553
Deploy Contract655534892024-12-16 13:15:1059 days ago1734354910IN
0xb52a36D2...0d1707d47
0 POL0.0747185173.86747991
Deploy Contract655534872024-12-16 13:15:0459 days ago1734354904IN
0xb52a36D2...0d1707d47
0 POL0.25930665173.86747991
Deploy Contract651541032024-12-06 13:00:1469 days ago1733490014IN
0xb52a36D2...0d1707d47
0 POL0.0258451360.1457997
Deploy Contract651540992024-12-06 13:00:0669 days ago1733490006IN
0xb52a36D2...0d1707d47
0 POL0.1379535960.1457997
Recover Contract...639076492024-11-05 8:42:14100 days ago1730796134IN
0xb52a36D2...0d1707d47
0 POL0.00528793133.03997754
Deploy Contract639076452024-11-05 8:42:04100 days ago1730796124IN
0xb52a36D2...0d1707d47
0 POL0.19832269133.03997754
Recover Contract...639076382024-11-05 8:41:50100 days ago1730796110IN
0xb52a36D2...0d1707d47
0 POL0.00528714133.03997754
Deploy Contract639076332024-11-05 8:41:40100 days ago1730796100IN
0xb52a36D2...0d1707d47
0 POL0.27978892133.03997754
Deploy Contract633946172024-10-23 14:22:00113 days ago1729693320IN
0xb52a36D2...0d1707d47
0 POL0.12306442287.87066566
Deploy Contract633946132024-10-23 14:21:52113 days ago1729693312IN
0xb52a36D2...0d1707d47
0 POL0.49508947287.87066566
Deploy Contract622155542024-09-24 11:15:57142 days ago1727176557IN
0xb52a36D2...0d1707d47
0 POL0.0410547596.1857034
Deploy Contract622155392024-09-24 11:15:25142 days ago1727176525IN
0xb52a36D2...0d1707d47
0 POL0.1433851896.1857034
Deploy Contract622155352024-09-24 11:15:15142 days ago1727176515IN
0xb52a36D2...0d1707d47
0 POL0.041045996.1857034
Deploy Contract622155322024-09-24 11:15:09142 days ago1727176509IN
0xb52a36D2...0d1707d47
0 POL0.154810496.1857034
Deploy Contract622155272024-09-24 11:14:59142 days ago1727176499IN
0xb52a36D2...0d1707d47
0 POL0.0411165996.1857034
Deploy Contract622155222024-09-24 11:14:49142 days ago1727176489IN
0xb52a36D2...0d1707d47
0 POL0.1782110496.1857034
Deploy Contract622155052024-09-24 11:14:13142 days ago1727176453IN
0xb52a36D2...0d1707d47
0 POL0.0410489896.1857034
Deploy Contract622155022024-09-24 11:14:05142 days ago1727176445IN
0xb52a36D2...0d1707d47
0 POL0.1255593796.1857034
Deploy Contract622154972024-09-24 11:13:55142 days ago1727176435IN
0xb52a36D2...0d1707d47
0 POL0.0411429596.1857034
Deploy Contract622154932024-09-24 11:13:47142 days ago1727176427IN
0xb52a36D2...0d1707d47
0 POL0.3422778896.1857034
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
677583502025-02-10 11:53:343 days ago1739188414
0xb52a36D2...0d1707d47
 Contract Creation0 POL
677582582025-02-10 11:49:503 days ago1739188190
0xb52a36D2...0d1707d47
 Contract Creation0 POL
667699262025-01-16 13:23:2028 days ago1737033800
0xb52a36D2...0d1707d47
 Contract Creation0 POL
667698042025-01-16 13:19:0028 days ago1737033540
0xb52a36D2...0d1707d47
 Contract Creation0 POL
655534892024-12-16 13:15:1059 days ago1734354910
0xb52a36D2...0d1707d47
 Contract Creation0 POL
655534872024-12-16 13:15:0459 days ago1734354904
0xb52a36D2...0d1707d47
 Contract Creation0 POL
651541032024-12-06 13:00:1469 days ago1733490014
0xb52a36D2...0d1707d47
 Contract Creation0 POL
651540992024-12-06 13:00:0669 days ago1733490006
0xb52a36D2...0d1707d47
 Contract Creation0 POL
639076452024-11-05 8:42:04100 days ago1730796124
0xb52a36D2...0d1707d47
 Contract Creation0 POL
639076332024-11-05 8:41:40100 days ago1730796100
0xb52a36D2...0d1707d47
 Contract Creation0 POL
633946172024-10-23 14:22:00113 days ago1729693320
0xb52a36D2...0d1707d47
 Contract Creation0 POL
633946132024-10-23 14:21:52113 days ago1729693312
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622155542024-09-24 11:15:57142 days ago1727176557
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622155392024-09-24 11:15:25142 days ago1727176525
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622155352024-09-24 11:15:15142 days ago1727176515
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622155322024-09-24 11:15:09142 days ago1727176509
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622155272024-09-24 11:14:59142 days ago1727176499
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622155222024-09-24 11:14:49142 days ago1727176489
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622155052024-09-24 11:14:13142 days ago1727176453
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622155022024-09-24 11:14:05142 days ago1727176445
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622154972024-09-24 11:13:55142 days ago1727176435
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622154932024-09-24 11:13:47142 days ago1727176427
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622154892024-09-24 11:13:39142 days ago1727176419
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622154852024-09-24 11:13:29142 days ago1727176409
0xb52a36D2...0d1707d47
 Contract Creation0 POL
622154792024-09-24 11:13:17142 days ago1727176397
0xb52a36D2...0d1707d47
 Contract Creation0 POL
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xF784ED3f...337795bc1
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
ContractsDeployer

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license
/**
 *Submitted for verification at polygonscan.com on 2023-12-08
*/

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;

// Sources flattened with hardhat v2.14.0 https://hardhat.org

// File @openzeppelin/contracts/utils/[email protected]

// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// File @openzeppelin/contracts/access/[email protected]

// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// File contracts/roles/Roles.sol

//
//                                             :+#####%%%%%%%%%%%%%%+
//                                         .-*@@@%+.:+%@@@@@%%#***%@@%=
//                                     :=*%@@@#=.      :#@@%       *@@@%=
//                       .-+*%@%*-.:+%@@@@@@+.     -*+:  .=#.       :%@@@%-
//                   :=*@@@@%%@@@@@@@@@%@@@-   .=#@@@%@%=             =@@@@#.
//             -=+#%@@%#*=:.  :%@@@@%.   -*@@#*@@@@@@@#=:-              *@@@@+
//            =@@%=:.     :=:   *@@@@@%#-   =%*%@@@@#+-.        =+       :%@@@%-
//           -@@%.     .+@@@     =+=-.         @@#-           +@@@%-       =@@@@%:
//          :@@@.    .+@@#%:                   :    .=*=-::.-%@@@+*@@=       +@@@@#.
//          %@@:    +@%%*                         =%@@@@@@@@@@@#.  .*@%-       +@@@@*.
//         #@@=                                .+@@@@%:=*@@@@@-      :%@%:      .*@@@@+
//        *@@*                                +@@@#-@@%-:%@@*          +@@#.      :%@@@@-
//       -@@%           .:-=++*##%%%@@@@@@@@@@@@*. :@+.@@@%:            .#@@+       =@@@@#:
//      .@@@*-+*#%%%@@@@@@@@@@@@@@@@%%#**@@%@@@.   *@=*@@#                :#@%=      .#@@@@#-
//      -%@@@@@@@@@@@@@@@*+==-:-@@@=    *@# .#@*-=*@@@@%=                 -%@@@*       =@@@@@%-
//         -+%@@@#.   %@%%=   -@@:+@: -@@*    *@@*-::                   -%@@%=.         .*@@@@@#
//            *@@@*  +@* *@@##@@-  #@*@@+    -@@=          .         :+@@@#:           .-+@@@%+-
//             +@@@%*@@:..=@@@@*   .@@@*   .#@#.       .=+-       .=%@@@*.         :+#@@@@*=:
//              =@@@@%@@@@@@@@@@@@@@@@@@@@@@%-      :+#*.       :*@@@%=.       .=#@@@@%+:
//               .%@@=                 .....    .=#@@+.       .#@@@*:       -*%@@@@%+.
//                 +@@#+===---:::...         .=%@@*-         +@@@+.      -*@@@@@%+.
//                  -@@@@@@@@@@@@@@@@@@@@@@%@@@@=          -@@@+      -#@@@@@#=.
//                    ..:::---===+++***###%%%@@@#-       .#@@+     -*@@@@@#=.
//                                           @@@@@@+.   +@@*.   .+@@@@@%=.
//                                          -@@@@@=   =@@%:   -#@@@@%+.
//                                          +@@@@@. =@@@=  .+@@@@@*:
//                                          #@@@@#:%@@#. :*@@@@#-
//                                          @@@@@%@@@= :#@@@@+.
//                                         :@@@@@@@#.:#@@@%-
//                                         +@@@@@@-.*@@@*:
//                                         #@@@@#.=@@@+.
//                                         @@@@+-%@%=
//                                        :@@@#%@%=
//                                        +@@@@%-
//                                        :#%%=
//

/**
 *     NOTICE
 *
 *     The T-REX software is licensed under a proprietary license or the GPL v.3.
 *     If you choose to receive it under the GPL v.3 license, the following applies:
 *     T-REX is a suite of smart contracts implementing the ERC-3643 standard and
 *     developed by Tokeny to manage and transfer financial assets on EVM blockchains
 *
 *     Copyright (C) 2023, Tokeny sàrl.
 *
 *     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
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

/**
 * @title Roles
 * @dev Library for managing addresses assigned to a Role.
 */
library Roles {
    struct Role {
        mapping(address => bool) bearer;
    }

    /**
     * @dev Give an account access to this role.
     */
    function add(Role storage role, address account) internal {
        require(!has(role, account), "Roles: account already has role");
        role.bearer[account] = true;
    }

    /**
     * @dev Remove an account's access to this role.
     */
    function remove(Role storage role, address account) internal {
        require(has(role, account), "Roles: account does not have role");
        role.bearer[account] = false;
    }

    /**
     * @dev Check if an account has this role.
     * @return bool
     */
    function has(Role storage role, address account) internal view returns (bool) {
        require(account != address(0), "Roles: account is the zero address");
        return role.bearer[account];
    }
}

// File contracts/roles/AgentRole.sol

//
//                                             :+#####%%%%%%%%%%%%%%+
//                                         .-*@@@%+.:+%@@@@@%%#***%@@%=
//                                     :=*%@@@#=.      :#@@%       *@@@%=
//                       .-+*%@%*-.:+%@@@@@@+.     -*+:  .=#.       :%@@@%-
//                   :=*@@@@%%@@@@@@@@@%@@@-   .=#@@@%@%=             =@@@@#.
//             -=+#%@@%#*=:.  :%@@@@%.   -*@@#*@@@@@@@#=:-              *@@@@+
//            =@@%=:.     :=:   *@@@@@%#-   =%*%@@@@#+-.        =+       :%@@@%-
//           -@@%.     .+@@@     =+=-.         @@#-           +@@@%-       =@@@@%:
//          :@@@.    .+@@#%:                   :    .=*=-::.-%@@@+*@@=       +@@@@#.
//          %@@:    +@%%*                         =%@@@@@@@@@@@#.  .*@%-       +@@@@*.
//         #@@=                                .+@@@@%:=*@@@@@-      :%@%:      .*@@@@+
//        *@@*                                +@@@#-@@%-:%@@*          +@@#.      :%@@@@-
//       -@@%           .:-=++*##%%%@@@@@@@@@@@@*. :@+.@@@%:            .#@@+       =@@@@#:
//      .@@@*-+*#%%%@@@@@@@@@@@@@@@@%%#**@@%@@@.   *@=*@@#                :#@%=      .#@@@@#-
//      -%@@@@@@@@@@@@@@@*+==-:-@@@=    *@# .#@*-=*@@@@%=                 -%@@@*       =@@@@@%-
//         -+%@@@#.   %@%%=   -@@:+@: -@@*    *@@*-::                   -%@@%=.         .*@@@@@#
//            *@@@*  +@* *@@##@@-  #@*@@+    -@@=          .         :+@@@#:           .-+@@@%+-
//             +@@@%*@@:..=@@@@*   .@@@*   .#@#.       .=+-       .=%@@@*.         :+#@@@@*=:
//              =@@@@%@@@@@@@@@@@@@@@@@@@@@@%-      :+#*.       :*@@@%=.       .=#@@@@%+:
//               .%@@=                 .....    .=#@@+.       .#@@@*:       -*%@@@@%+.
//                 +@@#+===---:::...         .=%@@*-         +@@@+.      -*@@@@@%+.
//                  -@@@@@@@@@@@@@@@@@@@@@@%@@@@=          -@@@+      -#@@@@@#=.
//                    ..:::---===+++***###%%%@@@#-       .#@@+     -*@@@@@#=.
//                                           @@@@@@+.   +@@*.   .+@@@@@%=.
//                                          -@@@@@=   =@@%:   -#@@@@%+.
//                                          +@@@@@. =@@@=  .+@@@@@*:
//                                          #@@@@#:%@@#. :*@@@@#-
//                                          @@@@@%@@@= :#@@@@+.
//                                         :@@@@@@@#.:#@@@%-
//                                         +@@@@@@-.*@@@*:
//                                         #@@@@#.=@@@+.
//                                         @@@@+-%@%=
//                                        :@@@#%@%=
//                                        +@@@@%-
//                                        :#%%=
//

/**
 *     NOTICE
 *
 *     The T-REX software is licensed under a proprietary license or the GPL v.3.
 *     If you choose to receive it under the GPL v.3 license, the following applies:
 *     T-REX is a suite of smart contracts implementing the ERC-3643 standard and
 *     developed by Tokeny to manage and transfer financial assets on EVM blockchains
 *
 *     Copyright (C) 2023, Tokeny sàrl.
 *
 *     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
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

contract AgentRole is Ownable {
    using Roles for Roles.Role;

    Roles.Role private _agents;

    event AgentAdded(address indexed _agent);
    event AgentRemoved(address indexed _agent);

    modifier onlyAgent() {
        require(isAgent(msg.sender), "AgentRole: caller does not have the Agent role");
        _;
    }

    function addAgent(address _agent) public onlyOwner {
        require(_agent != address(0), "invalid argument - zero address");
        _agents.add(_agent);
        emit AgentAdded(_agent);
    }

    function removeAgent(address _agent) public onlyOwner {
        require(_agent != address(0), "invalid argument - zero address");
        _agents.remove(_agent);
        emit AgentRemoved(_agent);
    }

    function isAgent(address _agent) public view returns (bool) {
        return _agents.has(_agent);
    }
}

// File contracts/factory/ContractsDeployer.sol

//
//                                             :+#####%%%%%%%%%%%%%%+
//                                         .-*@@@%+.:+%@@@@@%%#***%@@%=
//                                     :=*%@@@#=.      :#@@%       *@@@%=
//                       .-+*%@%*-.:+%@@@@@@+.     -*+:  .=#.       :%@@@%-
//                   :=*@@@@%%@@@@@@@@@%@@@-   .=#@@@%@%=             =@@@@#.
//             -=+#%@@%#*=:.  :%@@@@%.   -*@@#*@@@@@@@#=:-              *@@@@+
//            =@@%=:.     :=:   *@@@@@%#-   =%*%@@@@#+-.        =+       :%@@@%-
//           -@@%.     .+@@@     =+=-.         @@#-           +@@@%-       =@@@@%:
//          :@@@.    .+@@#%:                   :    .=*=-::.-%@@@+*@@=       +@@@@#.
//          %@@:    +@%%*                         =%@@@@@@@@@@@#.  .*@%-       +@@@@*.
//         #@@=                                .+@@@@%:=*@@@@@-      :%@%:      .*@@@@+
//        *@@*                                +@@@#-@@%-:%@@*          +@@#.      :%@@@@-
//       -@@%           .:-=++*##%%%@@@@@@@@@@@@*. :@+.@@@%:            .#@@+       =@@@@#:
//      .@@@*-+*#%%%@@@@@@@@@@@@@@@@%%#**@@%@@@.   *@=*@@#                :#@%=      .#@@@@#-
//      -%@@@@@@@@@@@@@@@*+==-:-@@@=    *@# .#@*-=*@@@@%=                 -%@@@*       =@@@@@%-
//         -+%@@@#.   %@%%=   -@@:+@: -@@*    *@@*-::                   -%@@%=.         .*@@@@@#
//            *@@@*  +@* *@@##@@-  #@*@@+    -@@=          .         :+@@@#:           .-+@@@%+-
//             +@@@%*@@:..=@@@@*   .@@@*   .#@#.       .=+-       .=%@@@*.         :+#@@@@*=:
//              =@@@@%@@@@@@@@@@@@@@@@@@@@@@%-      :+#*.       :*@@@%=.       .=#@@@@%+:
//               .%@@=                 .....    .=#@@+.       .#@@@*:       -*%@@@@%+.
//                 +@@#+===---:::...         .=%@@*-         +@@@+.      -*@@@@@%+.
//                  -@@@@@@@@@@@@@@@@@@@@@@%@@@@=          -@@@+      -#@@@@@#=.
//                    ..:::---===+++***###%%%@@@#-       .#@@+     -*@@@@@#=.
//                                           @@@@@@+.   +@@*.   .+@@@@@%=.
//                                          -@@@@@=   =@@%:   -#@@@@%+.
//                                          +@@@@@. =@@@=  .+@@@@@*:
//                                          #@@@@#:%@@#. :*@@@@#-
//                                          @@@@@%@@@= :#@@@@+.
//                                         :@@@@@@@#.:#@@@%-
//                                         +@@@@@@-.*@@@*:
//                                         #@@@@#.=@@@+.
//                                         @@@@+-%@%=
//                                        :@@@#%@%=
//                                        +@@@@%-
//                                        :#%%=
//
/**
 *     NOTICE
 *
 *     The T-REX software is licensed under a proprietary license or the GPL v.3.
 *     If you choose to receive it under the GPL v.3 license, the following applies:
 *     T-REX is a suite of smart contracts implementing the ERC-3643 standard and
 *     developed by Tokeny to manage and transfer financial assets on EVM blockchains
 *
 *     Copyright (C) 2023, Tokeny sàrl.
 *
 *     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
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

/// @notice Error thrown when a contract with the same name has already been deployed.
/// @param addr The address of the previously deployed contract.
error ContractDeployedAlready(address addr);

contract ContractsDeployer is AgentRole {

    /// @notice Maps a human-readable name to the address of a deployed contract.
    /// @dev Used to retrieve contract addresses deployed by this deployer.
    mapping(string => address) private _deployedContracts;

    /// @notice Emitted when a contract is deployed.
    /// @param name The human-readable name of the deployed contract.
    /// @param contractAddress The address of the deployed contract.
    event ContractDeployed(string name, address contractAddress);

    /**
     * @dev Deploys a contract using the create2 opcode, ensuring deterministic address generation.
     * @param name A human-readable name for the contract, used for referencing in the deployedContracts mapping.
     * @param bytecode The bytecode of the contract to be deployed.
     * @return addr The address of the deployed contract.
     * @notice The function will revert with `ContractDeployedAlready` if a contract with the same name has been deployed.
     */
    function deployContract(string memory name, bytes memory bytecode) external onlyAgent returns (address) {
        bytes32 salt = keccak256(bytecode);
        if (_deployedContracts[name] != address(0)) {
            revert ContractDeployedAlready(_deployedContracts[name]);
        }

        address addr;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let encoded_data := add(0x20, bytecode) // Load initialization code.
            let encoded_size := mload(bytecode)     // Load init code's length.
            addr := create2(0, encoded_data, encoded_size, salt)
            if iszero(extcodesize(addr)) {
                revert(0, 0)
            }
        }
        _deployedContracts[name] = addr;
        emit ContractDeployed(name, addr);
        return addr;
    }

    /**
     * @dev Transfers the ownership of a contract to a new owner.
     * @param _contract The address of the contract whose ownership is to be transferred.
     * @param _owner The address of the new owner.
     * @notice This function can only be called by an agent.
     */
    function recoverContractOwnership(address _contract, address _owner) external onlyAgent {
        Ownable(_contract).transferOwnership(_owner);
    }

    /**
     * @dev Retrieves the address of a deployed contract by its name.
     * @param name The name of the contract.
     * @return The address of the deployed contract.
     */
    function getContract(string calldata name) external view returns (address) {
        return _deployedContracts[name];
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"ContractDeployedAlready","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_agent","type":"address"}],"name":"AgentAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_agent","type":"address"}],"name":"AgentRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"}],"name":"ContractDeployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"_agent","type":"address"}],"name":"addAgent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"bytes","name":"bytecode","type":"bytes"}],"name":"deployContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"getContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_agent","type":"address"}],"name":"isAgent","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"recoverContractOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_agent","type":"address"}],"name":"removeAgent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063715018a611610066578063715018a61461011357806384e798421461011b5780638da5cb5b1461012e57806397a6278e1461013f578063f2fde38b1461015257600080fd5b80631ffbb0641461009857806335817773146100c057806350b01838146100eb57806357ae71d414610100575b600080fd5b6100ab6100a636600461078b565b610165565b60405190151581526020015b60405180910390f35b6100d36100ce3660046107ad565b610178565b6040516001600160a01b0390911681526020016100b7565b6100fe6100f936600461081f565b6101ad565b005b6100d361010e3660046108de565b61023a565b6100fe610377565b6100fe61012936600461078b565b61038b565b6000546001600160a01b03166100d3565b6100fe61014d36600461078b565b61042b565b6100fe61016036600461078b565b6104cb565b6000610172600183610544565b92915050565b60006002838360405161018c92919061096d565b908152604051908190036020019020546001600160a01b0316905092915050565b6101b633610165565b6101db5760405162461bcd60e51b81526004016101d29061097d565b60405180910390fd5b60405163f2fde38b60e01b81526001600160a01b03828116600483015283169063f2fde38b90602401600060405180830381600087803b15801561021e57600080fd5b505af1158015610232573d6000803e3d6000fd5b505050505050565b600061024533610165565b6102615760405162461bcd60e51b81526004016101d29061097d565b8151602083012060405160009060029061027c9087906109ef565b908152604051908190036020019020546001600160a01b0316146102da576002846040516102aa91906109ef565b908152604051908190036020018120546373c24d4760e01b82526001600160a01b031660048201526024016101d2565b60008360200184518381836000f592505050803b6102f757600080fd5b8060028660405161030891906109ef565b90815260405190819003602001812080546001600160a01b03939093166001600160a01b0319909316929092179091557f4da8c8e82a6cdcd021dddec73a637b429d2b0a9b303638f1258ff8a35c3e5d86906103679087908490610a0b565b60405180910390a1949350505050565b61037f6105c7565b6103896000610621565b565b6103936105c7565b6001600160a01b0381166103e95760405162461bcd60e51b815260206004820152601f60248201527f696e76616c696420617267756d656e74202d207a65726f20616464726573730060448201526064016101d2565b6103f4600182610671565b6040516001600160a01b038216907ff68e73cec97f2d70aa641fb26e87a4383686e2efacb648f2165aeb02ac562ec590600090a250565b6104336105c7565b6001600160a01b0381166104895760405162461bcd60e51b815260206004820152601f60248201527f696e76616c696420617267756d656e74202d207a65726f20616464726573730060448201526064016101d2565b6104946001826106ed565b6040516001600160a01b038216907fed9c8ad8d5a0a66898ea49d2956929c93ae2e8bd50281b2ed897c5d1a6737e0b90600090a250565b6104d36105c7565b6001600160a01b0381166105385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101d2565b61054181610621565b50565b60006001600160a01b0382166105a75760405162461bcd60e51b815260206004820152602260248201527f526f6c65733a206163636f756e7420697320746865207a65726f206164647265604482015261737360f01b60648201526084016101d2565b506001600160a01b03166000908152602091909152604090205460ff1690565b6000546001600160a01b031633146103895760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61067b8282610544565b156106c85760405162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650060448201526064016101d2565b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6106f78282610544565b61074d5760405162461bcd60e51b815260206004820152602160248201527f526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6044820152606560f81b60648201526084016101d2565b6001600160a01b0316600090815260209190915260409020805460ff19169055565b80356001600160a01b038116811461078657600080fd5b919050565b60006020828403121561079d57600080fd5b6107a68261076f565b9392505050565b600080602083850312156107c057600080fd5b823567ffffffffffffffff808211156107d857600080fd5b818501915085601f8301126107ec57600080fd5b8135818111156107fb57600080fd5b86602082850101111561080d57600080fd5b60209290920196919550909350505050565b6000806040838503121561083257600080fd5b61083b8361076f565b91506108496020840161076f565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561088357610883610852565b604051601f8501601f19908116603f011681019082821181831017156108ab576108ab610852565b816040528093508581528686860111156108c457600080fd5b858560208301376000602087830101525050509392505050565b600080604083850312156108f157600080fd5b823567ffffffffffffffff8082111561090957600080fd5b818501915085601f83011261091d57600080fd5b61092c86833560208501610868565b9350602085013591508082111561094257600080fd5b508301601f8101851361095457600080fd5b61096385823560208401610868565b9150509250929050565b8183823760009101908152919050565b6020808252602e908201527f4167656e74526f6c653a2063616c6c657220646f6573206e6f7420686176652060408201526d746865204167656e7420726f6c6560901b606082015260800190565b60005b838110156109e65781810151838201526020016109ce565b50506000910152565b60008251610a018184602087016109cb565b9190910192915050565b6040815260008351806040840152610a2a8160608501602088016109cb565b6001600160a01b0393909316602083015250601f91909101601f19160160600191905056fea26469706673582212206fd467bd409919fc6e21f9d015af2f3bbdbb72a0008412fac006f0e7701cea1064736f6c63430008110033

Deployed Bytecode Sourcemap

17395:2628:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13188:105;;;;;;:::i;:::-;;:::i;:::-;;;548:14:1;;541:22;523:41;;511:2;496:18;13188:105:0;;;;;;;;19895:125;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1336:32:1;;;1318:51;;1306:2;1291:18;19895:125:0;1172:203:1;19547:151:0;;;;;;:::i;:::-;;:::i;:::-;;18416:833;;;;;;:::i;:::-;;:::i;2850:103::-;;;:::i;12768:198::-;;;;;;:::i;:::-;;:::i;2209:87::-;2255:7;2282:6;-1:-1:-1;;;;;2282:6:0;2209:87;;12974:206;;;;;;:::i;:::-;;:::i;3108:201::-;;;;;;:::i;:::-;;:::i;13188:105::-;13242:4;13266:19;:7;13278:6;13266:11;:19::i;:::-;13259:26;13188:105;-1:-1:-1;;13188:105:0:o;19895:125::-;19961:7;19988:18;20007:4;;19988:24;;;;;;;:::i;:::-;;;;;;;;;;;;;;;-1:-1:-1;;;;;19988:24:0;;-1:-1:-1;19895:125:0;;;;:::o;19547:151::-;12670:19;12678:10;12670:7;:19::i;:::-;12662:78;;;;-1:-1:-1;;;12662:78:0;;;;;;;:::i;:::-;;;;;;;;;19646:44:::1;::::0;-1:-1:-1;;;19646:44:0;;-1:-1:-1;;;;;1336:32:1;;;19646:44:0::1;::::0;::::1;1318:51:1::0;19646:36:0;::::1;::::0;::::1;::::0;1291:18:1;;19646:44:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;19547:151:::0;;:::o;18416:833::-;18511:7;12670:19;12678:10;12670:7;:19::i;:::-;12662:78;;;;-1:-1:-1;;;12662:78:0;;;;;;;:::i;:::-;18546:19;;::::1;::::0;::::1;::::0;18580:24:::1;::::0;18531:12:::1;::::0;18580:18:::1;::::0;:24:::1;::::0;18599:4;;18580:24:::1;:::i;:::-;::::0;;;::::1;::::0;;;;;::::1;::::0;;;;-1:-1:-1;;;;;18580:24:0::1;:38;18576:127;;18666:18;18685:4;18666:24;;;;;;:::i;:::-;::::0;;;::::1;::::0;;;;;::::1;::::0;;;;-1:-1:-1;;;18642:49:0;;-1:-1:-1;;;;;18666:24:0::1;18642:49;::::0;::::1;1318:51:1::0;1291:18;;18642:49:0::1;1172:203:1::0;18576:127:0::1;18715:12;18849:8;18843:4;18839:19;18927:8;18921:15;19029:4;19015:12;19001;18998:1;18990:44;18982:52;;;;19070:4;19058:17;19048:75;;19106:1;19103::::0;19096:12:::1;19048:75;19171:4;19144:18;19163:4;19144:24;;;;;;:::i;:::-;::::0;;;::::1;::::0;;;;;::::1;::::0;;;:31;;-1:-1:-1;;;;;19144:31:0;;;::::1;-1:-1:-1::0;;;;;;19144:31:0;;::::1;::::0;;;::::1;::::0;;;19191:28:::1;::::0;::::1;::::0;19208:4;;19214;;19191:28:::1;:::i;:::-;;;;;;;;19237:4:::0;18416:833;-1:-1:-1;;;;18416:833:0:o;2850:103::-;2095:13;:11;:13::i;:::-;2915:30:::1;2942:1;2915:18;:30::i;:::-;2850:103::o:0;12768:198::-;2095:13;:11;:13::i;:::-;-1:-1:-1;;;;;12838:20:0;::::1;12830:64;;;::::0;-1:-1:-1;;;12830:64:0;;5171:2:1;12830:64:0::1;::::0;::::1;5153:21:1::0;5210:2;5190:18;;;5183:30;5249:33;5229:18;;;5222:61;5300:18;;12830:64:0::1;4969:355:1::0;12830:64:0::1;12905:19;:7;12917:6:::0;12905:11:::1;:19::i;:::-;12940:18;::::0;-1:-1:-1;;;;;12940:18:0;::::1;::::0;::::1;::::0;;;::::1;12768:198:::0;:::o;12974:206::-;2095:13;:11;:13::i;:::-;-1:-1:-1;;;;;13047:20:0;::::1;13039:64;;;::::0;-1:-1:-1;;;13039:64:0;;5171:2:1;13039:64:0::1;::::0;::::1;5153:21:1::0;5210:2;5190:18;;;5183:30;5249:33;5229:18;;;5222:61;5300:18;;13039:64:0::1;4969:355:1::0;13039:64:0::1;13114:22;:7;13129:6:::0;13114:14:::1;:22::i;:::-;13152:20;::::0;-1:-1:-1;;;;;13152:20:0;::::1;::::0;::::1;::::0;;;::::1;12974:206:::0;:::o;3108:201::-;2095:13;:11;:13::i;:::-;-1:-1:-1;;;;;3197:22:0;::::1;3189:73;;;::::0;-1:-1:-1;;;3189:73:0;;5531:2:1;3189:73:0::1;::::0;::::1;5513:21:1::0;5570:2;5550:18;;;5543:30;5609:34;5589:18;;;5582:62;-1:-1:-1;;;5660:18:1;;;5653:36;5706:19;;3189:73:0::1;5329:402:1::0;3189:73:0::1;3273:28;3292:8;3273:18;:28::i;:::-;3108:201:::0;:::o;8330:203::-;8402:4;-1:-1:-1;;;;;8427:21:0;;8419:68;;;;-1:-1:-1;;;8419:68:0;;5938:2:1;8419:68:0;;;5920:21:1;5977:2;5957:18;;;5950:30;6016:34;5996:18;;;5989:62;-1:-1:-1;;;6067:18:1;;;6060:32;6109:19;;8419:68:0;5736:398:1;8419:68:0;-1:-1:-1;;;;;;8505:20:0;:11;:20;;;;;;;;;;;;;;;8330:203::o;2374:132::-;2255:7;2282:6;-1:-1:-1;;;;;2282:6:0;865:10;2438:23;2430:68;;;;-1:-1:-1;;;2430:68:0;;6341:2:1;2430:68:0;;;6323:21:1;;;6360:18;;;6353:30;6419:34;6399:18;;;6392:62;6471:18;;2430:68:0;6139:356:1;3469:191:0;3543:16;3562:6;;-1:-1:-1;;;;;3579:17:0;;;-1:-1:-1;;;;;;3579:17:0;;;;;;3612:40;;3562:6;;;;;;;3612:40;;3543:16;3612:40;3532:128;3469:191;:::o;7794:178::-;7872:18;7876:4;7882:7;7872:3;:18::i;:::-;7871:19;7863:63;;;;-1:-1:-1;;;7863:63:0;;6702:2:1;7863:63:0;;;6684:21:1;6741:2;6721:18;;;6714:30;6780:33;6760:18;;;6753:61;6831:18;;7863:63:0;6500:355:1;7863:63:0;-1:-1:-1;;;;;7937:20:0;:11;:20;;;;;;;;;;;:27;;-1:-1:-1;;7937:27:0;7960:4;7937:27;;;7794:178::o;8052:183::-;8132:18;8136:4;8142:7;8132:3;:18::i;:::-;8124:64;;;;-1:-1:-1;;;8124:64:0;;7062:2:1;8124:64:0;;;7044:21:1;7101:2;7081:18;;;7074:30;7140:34;7120:18;;;7113:62;-1:-1:-1;;;7191:18:1;;;7184:31;7232:19;;8124:64:0;6860:397:1;8124:64:0;-1:-1:-1;;;;;8199:20:0;8222:5;8199:20;;;;;;;;;;;:28;;-1:-1:-1;;8199:28:0;;;8052:183::o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:70;;177:1;174;167:12;111:70;14:173;;;:::o;192:186::-;251:6;304:2;292:9;283:7;279:23;275:32;272:52;;;320:1;317;310:12;272:52;343:29;362:9;343:29;:::i;:::-;333:39;192:186;-1:-1:-1;;;192:186:1:o;575:592::-;646:6;654;707:2;695:9;686:7;682:23;678:32;675:52;;;723:1;720;713:12;675:52;763:9;750:23;792:18;833:2;825:6;822:14;819:34;;;849:1;846;839:12;819:34;887:6;876:9;872:22;862:32;;932:7;925:4;921:2;917:13;913:27;903:55;;954:1;951;944:12;903:55;994:2;981:16;1020:2;1012:6;1009:14;1006:34;;;1036:1;1033;1026:12;1006:34;1081:7;1076:2;1067:6;1063:2;1059:15;1055:24;1052:37;1049:57;;;1102:1;1099;1092:12;1049:57;1133:2;1125:11;;;;;1155:6;;-1:-1:-1;575:592:1;;-1:-1:-1;;;;575:592:1:o;1380:260::-;1448:6;1456;1509:2;1497:9;1488:7;1484:23;1480:32;1477:52;;;1525:1;1522;1515:12;1477:52;1548:29;1567:9;1548:29;:::i;:::-;1538:39;;1596:38;1630:2;1619:9;1615:18;1596:38;:::i;:::-;1586:48;;1380:260;;;;;:::o;1645:127::-;1706:10;1701:3;1697:20;1694:1;1687:31;1737:4;1734:1;1727:15;1761:4;1758:1;1751:15;1777:632;1842:5;1872:18;1913:2;1905:6;1902:14;1899:40;;;1919:18;;:::i;:::-;1994:2;1988:9;1962:2;2048:15;;-1:-1:-1;;2044:24:1;;;2070:2;2040:33;2036:42;2024:55;;;2094:18;;;2114:22;;;2091:46;2088:72;;;2140:18;;:::i;:::-;2180:10;2176:2;2169:22;2209:6;2200:15;;2239:6;2231;2224:22;2279:3;2270:6;2265:3;2261:16;2258:25;2255:45;;;2296:1;2293;2286:12;2255:45;2346:6;2341:3;2334:4;2326:6;2322:17;2309:44;2401:1;2394:4;2385:6;2377;2373:19;2369:30;2362:41;;;;1777:632;;;;;:::o;2414:806::-;2501:6;2509;2562:2;2550:9;2541:7;2537:23;2533:32;2530:52;;;2578:1;2575;2568:12;2530:52;2618:9;2605:23;2647:18;2688:2;2680:6;2677:14;2674:34;;;2704:1;2701;2694:12;2674:34;2742:6;2731:9;2727:22;2717:32;;2787:7;2780:4;2776:2;2772:13;2768:27;2758:55;;2809:1;2806;2799:12;2758:55;2832:76;2900:7;2895:2;2882:16;2875:4;2871:2;2867:13;2832:76;:::i;:::-;2822:86;;2961:4;2950:9;2946:20;2933:34;2917:50;;2992:2;2982:8;2979:16;2976:36;;;3008:1;3005;2998:12;2976:36;-1:-1:-1;3031:24:1;;3086:4;3078:13;;3074:27;-1:-1:-1;3064:55:1;;3115:1;3112;3105:12;3064:55;3138:76;3206:7;3201:2;3188:16;3181:4;3177:2;3173:13;3138:76;:::i;:::-;3128:86;;;2414:806;;;;;:::o;3225:273::-;3410:6;3402;3397:3;3384:33;3366:3;3436:16;;3461:13;;;3436:16;3225:273;-1:-1:-1;3225:273:1:o;3503:410::-;3705:2;3687:21;;;3744:2;3724:18;;;3717:30;3783:34;3778:2;3763:18;;3756:62;-1:-1:-1;;;3849:2:1;3834:18;;3827:44;3903:3;3888:19;;3503:410::o;3918:250::-;4003:1;4013:113;4027:6;4024:1;4021:13;4013:113;;;4103:11;;;4097:18;4084:11;;;4077:39;4049:2;4042:10;4013:113;;;-1:-1:-1;;4160:1:1;4142:16;;4135:27;3918:250::o;4173:289::-;4304:3;4342:6;4336:13;4358:66;4417:6;4412:3;4405:4;4397:6;4393:17;4358:66;:::i;:::-;4440:16;;;;;4173:289;-1:-1:-1;;4173:289:1:o;4467:497::-;4644:2;4633:9;4626:21;4607:4;4676:6;4670:13;4719:6;4714:2;4703:9;4699:18;4692:34;4735:81;4809:6;4804:2;4793:9;4789:18;4782:4;4774:6;4770:17;4735:81;:::i;:::-;-1:-1:-1;;;;;4925:32:1;;;;4918:4;4903:20;;4896:62;-1:-1:-1;4877:2:1;4856:15;;;;-1:-1:-1;;4852:29:1;4837:45;4884:2;4833:54;;4467:497;-1:-1:-1;4467:497:1:o

Swarm Source

ipfs://6fd467bd409919fc6e21f9d015af2f3bbdbb72a0008412fac006f0e7701cea10

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.