Contract Address Details

0xB01CB9B0C00Da11BC48D21Bd3b49847909DA62c7

Contract Name
CaratFeeVault
Creator
0x07f816–8d56da at 0x672cc8–8b75e3
Balance
0 CRO ( )
Tokens
Fetching tokens...
Transactions
43 Transactions
Transfers
222 Transfers
Gas Used
5,221,710
Last Balance Update
13667619
Contract name:
CaratFeeVault




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
EVM Version
default




Verified at
2021-11-29T16:10:43.227290Z

Constructor Arguments

000000000000000000000000f1e7010ac5e81b28f4b16b665d5e5e9429ee7b99000000000000000000000000e9fcd69a8d1f33fc5c1cf50dcce6f94f191bb50e0000000000000000000000003945e10161348a1841532ea36c8a0a88669abd8e

Arg [0] (address) : 0xf1e7010ac5e81b28f4b16b665d5e5e9429ee7b99
Arg [1] (address) : 0xe9fcd69a8d1f33fc5c1cf50dcce6f94f191bb50e
Arg [2] (address) : 0x3945e10161348a1841532ea36c8a0a88669abd8e

              

Contract source code

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;


// 
/*
 * @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 GSN 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.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor() internal {}

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// 
/**
 * @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.
 */
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() internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), 'Ownable: caller is not the owner');
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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 onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), 'Ownable: new owner is the zero address');
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

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

    /**
     * @dev Returns the token decimals.
     */
    function decimals() external view returns (uint8);

    /**
     * @dev Returns the token symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the token name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the bep token owner.
     */
    function getOwner() external view returns (address);

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

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

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

    /**
     * @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 Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, 'SafeMath: addition overflow');

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, 'SafeMath: subtraction overflow');
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, 'SafeMath: multiplication overflow');

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, 'SafeMath: division by zero');
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, 'SafeMath: modulo by zero');
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }

    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = x < y ? x : y;
    }

    // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
    function sqrt(uint256 y) internal pure returns (uint256 z) {
        if (y > 3) {
            z = y;
            uint256 x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
}

// 
/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            codehash := extcodehash(account)
        }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, 'Address: insufficient balance');

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{value: amount}('');
        require(success, 'Address: unable to send value, recipient may have reverted');
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, 'Address: low-level call failed');
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, 'Address: insufficient balance for call');
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(
        address target,
        bytes memory data,
        uint256 weiValue,
        string memory errorMessage
    ) private returns (bytes memory) {
        require(isContract(target), 'Address: call to non-contract');

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{value: weiValue}(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// 
/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-ERC20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */

contract CaratFeeVault is Ownable
{
 
    using SafeMath for uint256;


    // The CRT TOKEN!
    IERC20 public crt;
    
    // Dev address.
    address public devaddr1;
    address public devaddr2;
    
    struct Transaction {
        IERC20 token;
        uint256 amount;
        address receiver;
        bool dev1_sign;
        bool dev2_sign;
        bool iscro;
    }
    
    Transaction[] private transactions;

    modifier onlyDev() {
        require(msg.sender == owner() || msg.sender == devaddr1 || msg.sender == devaddr2 , "Error: Require developer or Owner");
        _;
    }
 

    constructor(
        IERC20 _crt,
        address _devaddr1,
        address _devaddr2

    ) public {
        crt = _crt;
        devaddr1 = _devaddr1;
        devaddr2 = _devaddr2;
    }
    
    receive() external payable {}
    

     
    
    function setCaratTransaction (address _receiver , uint256 _amount) external onlyDev returns(uint256)
    {
        
        
        uint256 index = transactions.length;
        
        if(msg.sender == devaddr1)
        {
        transactions.push(Transaction({
            token: crt,
            amount: _amount,
            receiver: _receiver,
            dev1_sign: true,
            dev2_sign: false,
            iscro: false
        }));
        }
        
        if(msg.sender == devaddr2)
        {
        transactions.push(Transaction({
            token: crt,
            amount: _amount,
            receiver: _receiver,
            dev1_sign: false,
            dev2_sign: true,
            iscro: false
        }));
        }
        else if (msg.sender != devaddr1 && msg.sender != devaddr2)
        {
            transactions.push(Transaction({
            token: crt,
            amount: _amount,
            receiver: _receiver,
            dev1_sign: false,
            dev2_sign: false,
            iscro: false
        }));
        }
     return (index);
    }
    
    function setCROTransaction (address _receiver , uint256 _amount) external onlyDev returns(uint256)
    {
        
        
        uint256 index = transactions.length;
        
        if(msg.sender == devaddr1)
        {
        transactions.push(Transaction({
            token: IERC20(address(0)),
            amount: _amount,
            receiver: _receiver,
            dev1_sign: true,
            dev2_sign: false,
            iscro: true
        }));
        }
        
        if(msg.sender == devaddr2)
        {
        transactions.push(Transaction({
            token: IERC20(address(0)),
            amount: _amount,
            receiver: _receiver,
            dev1_sign: false,
            dev2_sign: true,
            iscro: true
        }));
        }
        else if (msg.sender != devaddr1 && msg.sender != devaddr2)
        {
            transactions.push(Transaction({
            token: IERC20(address(0)),
            amount: _amount,
            receiver: _receiver,
            dev1_sign: false,
            dev2_sign: false,
            iscro: true
        }));
        }
     return (index);
    }
    
    function setOtherTransaction (IERC20 _token , address _receiver , uint256 _amount) external onlyDev returns(uint256)
    {
        
        
        uint256 index = transactions.length;
        
        if(msg.sender == devaddr1)
        {
        transactions.push(Transaction({
            token: _token,
            amount: _amount,
            receiver: _receiver,
            dev1_sign: true,
            dev2_sign: false,
            iscro: false
        }));
        }
        
        if(msg.sender == devaddr2)
        {
        transactions.push(Transaction({
            token: _token,
            amount: _amount,
            receiver: _receiver,
            dev1_sign: false,
            dev2_sign: true,
            iscro: false
        }));
        }
        else if (msg.sender != devaddr1 && msg.sender != devaddr2)
        {
            transactions.push(Transaction({
            token: _token,
            amount: _amount,
            receiver: _receiver,
            dev1_sign: false,
            dev2_sign: false,
            iscro: false
        }));
        }
     return (index);
    }
    
    function deleteTransaction(uint256 tx_index) public onlyDev{
        _deleteTransaction(tx_index);
    }
     
     
    function _deleteTransaction(uint256 tx_index) internal
    {
        require (tx_index < transactions.length , 'invalid index');

        for (uint i = tx_index; i < transactions.length-1; i++){
            transactions[i] = transactions[i+1];
        }
        
        transactions.pop();
        
        return ;

    }
    

    function executeTransaction(uint256 tx_index) public payable onlyDev{
        
        Transaction storage txn = transactions[tx_index] ;
       
        if (!txn.iscro){
           require(txn.amount <= (txn.token).balanceOf(address(this)), 'Token balance not enough for this transaction');
            
            if(msg.sender == devaddr1 )
            {
            require(txn.dev2_sign == true , 'dev2 sign required');
            
            (txn.token).transfer(txn.receiver, txn.amount);
            _deleteTransaction(tx_index);
            }
        
            if(msg.sender == devaddr2)
            {
            require(txn.dev1_sign == true , 'dev1 sign required');
            
            (txn.token).transfer(txn.receiver, txn.amount);
            _deleteTransaction(tx_index);
            }
        
            else if (msg.sender != devaddr1 && msg.sender != devaddr2)
            {
            require(txn.dev1_sign && txn.dev2_sign , 'both devs have to sign!');
            (txn.token).transfer(txn.receiver, txn.amount);
            _deleteTransaction(tx_index);
            }
        }
        else if (txn.iscro){
           require(address(this).balance > 0 , 'balance not enough for this transaction');
            
            if(msg.sender == devaddr1 )
            {
            require(txn.dev2_sign == true , 'dev2 sign required');
            
            payable(txn.receiver).transfer( txn.amount);
            _deleteTransaction(tx_index);
            }
        
            if(msg.sender == devaddr2)
            {
            require(txn.dev1_sign == true , 'dev1 sign required');
            
            payable(txn.receiver).transfer( txn.amount);
            _deleteTransaction(tx_index);
            }
        
            else if (msg.sender != devaddr1 && msg.sender != devaddr2)
            {
            require(txn.dev1_sign && txn.dev2_sign , 'both devs have to sign!');
            payable(txn.receiver).transfer( txn.amount);
            _deleteTransaction(tx_index);
            }
        }
            

        }
        
    function signTransaction(uint256 tx_index) public onlyDev {
        require(msg.sender == devaddr1 || msg.sender == devaddr2 , 'Only Devs can sign');
        
        if(msg.sender == devaddr1)
        {
            transactions[tx_index].dev1_sign = true;
        }
        if(msg.sender == devaddr2)
        {
            transactions[tx_index].dev2_sign = true;
        }
        else if (msg.sender != devaddr1 && msg.sender != devaddr2)
        {
            return;
        }
    }
        
    function getTransactionDetails(uint256 tx_index) external onlyDev view returns(IERC20 , uint256, address, bool , bool, bool)
    {
        Transaction storage txn = transactions[tx_index] ;
        return (txn.token , txn.amount, txn.receiver, txn.dev1_sign, txn.dev2_sign, txn.iscro);
    }
    
    
 

    // Update dev address by the previous dev.
    function dev(address _devaddr) public onlyDev{
        require(msg.sender == devaddr1 || msg.sender == devaddr2 , 'Only Devs assign a new dev');
        
        if (msg.sender == devaddr1){
        require(_devaddr != devaddr2 , 'cannot assign dev2');
        devaddr1 = _devaddr;
        }
        else if (msg.sender == devaddr2){
        require(_devaddr != devaddr1 , 'cannot assign dev1');
        devaddr2 = _devaddr;
        }
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_crt","internalType":"contract IERC20"},{"type":"address","name":"_devaddr1","internalType":"address"},{"type":"address","name":"_devaddr2","internalType":"address"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"crt","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deleteTransaction","inputs":[{"type":"uint256","name":"tx_index","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"dev","inputs":[{"type":"address","name":"_devaddr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"devaddr1","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"devaddr2","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"executeTransaction","inputs":[{"type":"uint256","name":"tx_index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"},{"type":"bool","name":"","internalType":"bool"},{"type":"bool","name":"","internalType":"bool"},{"type":"bool","name":"","internalType":"bool"}],"name":"getTransactionDetails","inputs":[{"type":"uint256","name":"tx_index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"setCROTransaction","inputs":[{"type":"address","name":"_receiver","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"setCaratTransaction","inputs":[{"type":"address","name":"_receiver","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"setOtherTransaction","inputs":[{"type":"address","name":"_token","internalType":"contract IERC20"},{"type":"address","name":"_receiver","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"signTransaction","inputs":[{"type":"uint256","name":"tx_index","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
            

Deployed ByteCode

0x6080604052600436106100e05760003560e01c80638aa8d0971161007f578063a297683b11610059578063a297683b146102e1578063ee22610b1461031a578063f19987fc14610337578063f2fde38b1461034c576100e7565b80638aa8d097146102605780638d88a90e146102995780638da5cb5b146102cc576100e7565b806316c14382116100bb57806316c14382146101b75780635aa4becc146101cc5780635d9ec21014610221578063715018a61461024b576100e7565b8062e9c006146100ec5780630868aad6146101185780630fa683d314610149576100e7565b366100e757005b600080fd5b3480156100f857600080fd5b506101166004803603602081101561010f57600080fd5b503561037f565b005b34801561012457600080fd5b5061012d61040c565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b506101736004803603602081101561016c57600080fd5b503561041b565b604080516001600160a01b0397881681526020810196909652939095168484015290151560608401521515608083015291151560a082015290519081900360c00190f35b3480156101c357600080fd5b5061012d61050e565b3480156101d857600080fd5b5061020f600480360360608110156101ef57600080fd5b506001600160a01b0381358116916020810135909116906040013561051d565b60408051918252519081900360200190f35b34801561022d57600080fd5b506101166004803603602081101561024457600080fd5b50356108e9565b34801561025757600080fd5b50610116610a9d565b34801561026c57600080fd5b5061020f6004803603604081101561028357600080fd5b506001600160a01b038135169060200135610b51565b3480156102a557600080fd5b50610116600480360360208110156102bc57600080fd5b50356001600160a01b0316610f24565b3480156102d857600080fd5b5061012d61112f565b3480156102ed57600080fd5b5061020f6004803603604081101561030457600080fd5b506001600160a01b03813516906020013561113e565b6101166004803603602081101561033057600080fd5b50356114ff565b34801561034357600080fd5b5061012d611c57565b34801561035857600080fd5b506101166004803603602081101561036f57600080fd5b50356001600160a01b0316611c66565b61038761112f565b6001600160a01b0316336001600160a01b031614806103b057506002546001600160a01b031633145b806103c557506003546001600160a01b031633145b6104005760405162461bcd60e51b8152600401808060200182810382526021815260200180611f046021913960400191505060405180910390fd5b61040981611cd9565b50565b6001546001600160a01b031681565b60008060008060008061042c61112f565b6001600160a01b0316336001600160a01b0316148061045557506002546001600160a01b031633145b8061046a57506003546001600160a01b031633145b6104a55760405162461bcd60e51b8152600401808060200182810382526021815260200180611f046021913960400191505060405180910390fd5b6000600488815481106104b457fe5b60009182526020909120600390910201805460018201546002909201546001600160a01b039182169b929a50908116985060ff600160a01b820481169850600160a81b820481169750600160b01b90910416945092505050565b6002546001600160a01b031681565b600061052761112f565b6001600160a01b0316336001600160a01b0316148061055057506002546001600160a01b031633145b8061056557506003546001600160a01b031633145b6105a05760405162461bcd60e51b8152600401808060200182810382526021815260200180611f046021913960400191505060405180910390fd5b6004546002546001600160a01b03163314156106b1576040805160c0810182526001600160a01b0380881682526020820186815287821693830193845260016060840181815260006080860181815260a0870182815260048054958601815590925295516003909302600080516020611fb8833981519152810180549487166001600160a01b03199586161790559351600080516020611f4b8339815191528501559551600080516020611f6b83398151915290930180549151955196511515600160b01b0260ff60b01b19971515600160a81b0260ff60a81b19971515600160a01b0260ff60a01b1996909716939094169290921793909316939093179390931692909217929092169190911790555b6003546001600160a01b03163314156107c0576040805160c0810182526001600160a01b0380881682526020820186815287821693830193845260006060840181815260016080860181815260a0870184815260048054938401815590945295516003909102600080516020611fb8833981519152810180549287166001600160a01b03199384161790559351600080516020611f4b8339815191528501559551600080516020611f6b83398151915290930180549151955192511515600160b01b0260ff60b01b19931515600160a81b0260ff60a81b19971515600160a01b0260ff60a01b1996909716939098169290921793909316939093179390931693909317919091161790556108e1565b6002546001600160a01b031633148015906107e657506003546001600160a01b03163314155b156108e1576040805160c0810182526001600160a01b038088168252602082018681528782169383019384526000606084018181526080850182815260a0860183815260048054600181018255945295516003909302600080516020611fb8833981519152810180549487166001600160a01b03199586161790559351600080516020611f4b8339815191528501559551600080516020611f6b83398151915290930180549151965195511515600160b01b0260ff60b01b19961515600160a81b0260ff60a81b19981515600160a01b0260ff60a01b1996909716939094169290921793909316939093179490941693909317919091161790555b949350505050565b6108f161112f565b6001600160a01b0316336001600160a01b0316148061091a57506002546001600160a01b031633145b8061092f57506003546001600160a01b031633145b61096a5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f046021913960400191505060405180910390fd5b6002546001600160a01b031633148061098d57506003546001600160a01b031633145b6109d3576040805162461bcd60e51b815260206004820152601260248201527127b7363c902232bb399031b0b71039b4b3b760711b604482015290519081900360640190fd5b6002546001600160a01b0316331415610a1e576001600482815481106109f557fe5b906000526020600020906003020160020160146101000a81548160ff0219169083151502179055505b6003546001600160a01b0316331415610a6d57600160048281548110610a4057fe5b906000526020600020906003020160020160156101000a81548160ff021916908315150217905550610409565b6002546001600160a01b03163314801590610a9357506003546001600160a01b03163314155b1561040957610409565b610aa5611e5f565b6000546001600160a01b03908116911614610b07576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610b5b61112f565b6001600160a01b0316336001600160a01b03161480610b8457506002546001600160a01b031633145b80610b9957506003546001600160a01b031633145b610bd45760405162461bcd60e51b8152600401808060200182810382526021815260200180611f046021913960400191505060405180910390fd5b6004546002546001600160a01b0316331415610ce7576040805160c081018252600180546001600160a01b039081168352602083018781528882169484019485526060840183815260006080860181815260a0870182815260048054978801815590925295516003909502600080516020611fb8833981519152810180549686166001600160a01b03199788161790559251600080516020611f4b8339815191528401559551600080516020611f6b83398151915290920180549151955196511515600160b01b0260ff60b01b19971515600160a81b0260ff60a81b19971515600160a01b0260ff60a01b1995909616939096169290921792909216929092179390931691909117929092169190911790555b6003546001600160a01b0316331415610df8576040805160c081018252600180546001600160a01b039081168352602083018781528882169484019485526000606085018181526080860185815260a0870183815260048054978801815590935295516003909502600080516020611fb8833981519152810180549686166001600160a01b03199788161790559251600080516020611f4b8339815191528401559551600080516020611f6b83398151915290920180549651955191511515600160b01b0260ff60b01b19921515600160a81b0260ff60a81b19971515600160a01b0260ff60a01b199590961698909616979097179290921692909217939093169190911716919091179055610f1d565b6002546001600160a01b03163314801590610e1e57506003546001600160a01b03163314155b15610f1d576040805160c081018252600180546001600160a01b039081168352602083018781528882169484019485526000606085018181526080860182815260a0870183815260048054978801815590935295516003909502600080516020611fb8833981519152810180549686166001600160a01b03199788161790559251600080516020611f4b8339815191528401559551600080516020611f6b83398151915290920180549651955191511515600160b01b0260ff60b01b19921515600160a81b0260ff60a81b19971515600160a01b0260ff60a01b1995909616989096169790971792909216929092179390931691909117169190911790555b9392505050565b610f2c61112f565b6001600160a01b0316336001600160a01b03161480610f5557506002546001600160a01b031633145b80610f6a57506003546001600160a01b031633145b610fa55760405162461bcd60e51b8152600401808060200182810382526021815260200180611f046021913960400191505060405180910390fd5b6002546001600160a01b0316331480610fc857506003546001600160a01b031633145b611019576040805162461bcd60e51b815260206004820152601a60248201527f4f6e6c7920446576732061737369676e2061206e657720646576000000000000604482015290519081900360640190fd5b6002546001600160a01b03163314156110a4576003546001600160a01b0382811691161415611084576040805162461bcd60e51b815260206004820152601260248201527131b0b73737ba1030b9b9b4b3b7103232bb1960711b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b038316179055610409565b6003546001600160a01b0316331415610409576002546001600160a01b038281169116141561110f576040805162461bcd60e51b815260206004820152601260248201527163616e6e6f742061737369676e206465763160701b604482015290519081900360640190fd5b600380546001600160a01b0383166001600160a01b031990911617905550565b6000546001600160a01b031690565b600061114861112f565b6001600160a01b0316336001600160a01b0316148061117157506002546001600160a01b031633145b8061118657506003546001600160a01b031633145b6111c15760405162461bcd60e51b8152600401808060200182810382526021815260200180611f046021913960400191505060405180910390fd5b6004546002546001600160a01b03163314156112cd576040805160c0810182526000808252602082018681526001600160a01b038881169484019485526001606085018181526080860185815260a0870183815260048054948501815590965295516003909202600080516020611fb8833981519152810180549385166001600160a01b03199485161790559351600080516020611f4b8339815191528501559551600080516020611f6b83398151915290930180549651955194511515600160b01b0260ff60b01b19951515600160a81b0260ff60a81b19971515600160a01b0260ff60a01b1996909516989093169790971793909316919091179390931692909217169190911790555b6003546001600160a01b03163314156113d7576040805160c0810182526000808252602082018681526001600160a01b038881169484019485526060840183815260016080860181815260a0870182815260048054938401815590965295516003909102600080516020611fb8833981519152810180549285166001600160a01b03199384161790559351600080516020611f4b8339815191528501559551600080516020611f6b83398151915290930180549151955194511515600160b01b0260ff60b01b19951515600160a81b0260ff60a81b19971515600160a01b0260ff60a01b199690951693909816929092179390931691909117939093169390931716179055610f1d565b6002546001600160a01b031633148015906113fd57506003546001600160a01b03163314155b15610f1d576040805160c0810182526000808252602082018681526001600160a01b038881169484019485526060840183815260808501848152600160a0870181815260048054928301815590965295516003909602600080516020611fb8833981519152810180549785166001600160a01b03199889161790559351600080516020611f4b8339815191528501559551600080516020611f6b83398151915290930180549151965194511515600160b01b0260ff60b01b19951515600160a81b0260ff60a81b19981515600160a01b0260ff60a01b199690951693909716929092179390931691909117949094169290921716919091179055905092915050565b61150761112f565b6001600160a01b0316336001600160a01b0316148061153057506002546001600160a01b031633145b8061154557506003546001600160a01b031633145b6115805760405162461bcd60e51b8152600401808060200182810382526021815260200180611f046021913960400191505060405180910390fd5b60006004828154811061158f57fe5b906000526020600020906003020190508060020160169054906101000a900460ff166119ac578054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156115ff57600080fd5b505afa158015611613573d6000803e3d6000fd5b505050506040513d602081101561162957600080fd5b50516001820154111561166d5760405162461bcd60e51b815260040180806020018281038252602d815260200180611f8b602d913960400191505060405180910390fd5b6002546001600160a01b031633141561176f576002810154600160a81b900460ff1615156001146116da576040805162461bcd60e51b815260206004820152601260248201527119195d8c881cda59db881c995c5d5a5c995960721b604482015290519081900360640190fd5b8054600282015460018301546040805163a9059cbb60e01b81526001600160a01b039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b15801561173957600080fd5b505af115801561174d573d6000803e3d6000fd5b505050506040513d602081101561176357600080fd5b5061176f905082611cd9565b6003546001600160a01b0316331415611876576002810154600160a01b900460ff1615156001146117dc576040805162461bcd60e51b815260206004820152601260248201527119195d8c481cda59db881c995c5d5a5c995960721b604482015290519081900360640190fd5b8054600282015460018301546040805163a9059cbb60e01b81526001600160a01b039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b15801561183b57600080fd5b505af115801561184f573d6000803e3d6000fd5b505050506040513d602081101561186557600080fd5b50611871905082611cd9565b6119a7565b6002546001600160a01b0316331480159061189c57506003546001600160a01b03163314155b156119a7576002810154600160a01b900460ff1680156118c757506002810154600160a81b900460ff165b611912576040805162461bcd60e51b8152602060048201526017602482015276626f74682064657673206861766520746f207369676e2160481b604482015290519081900360640190fd5b8054600282015460018301546040805163a9059cbb60e01b81526001600160a01b039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b15801561197157600080fd5b505af1158015611985573d6000803e3d6000fd5b505050506040513d602081101561199b57600080fd5b506119a7905082611cd9565b611c53565b6002810154600160b01b900460ff1615611c5357600047116119ff5760405162461bcd60e51b8152600401808060200182810382526027815260200180611fd86027913960400191505060405180910390fd5b6002546001600160a01b0316331415611ab6576002810154600160a81b900460ff161515600114611a6c576040805162461bcd60e51b815260206004820152601260248201527119195d8c881cda59db881c995c5d5a5c995960721b604482015290519081900360640190fd5b600281015460018201546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611aac573d6000803e3d6000fd5b50611ab682611cd9565b6003546001600160a01b0316331415611b6d576002810154600160a01b900460ff161515600114611b23576040805162461bcd60e51b815260206004820152601260248201527119195d8c481cda59db881c995c5d5a5c995960721b604482015290519081900360640190fd5b600281015460018201546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611b63573d6000803e3d6000fd5b506119a782611cd9565b6002546001600160a01b03163314801590611b9357506003546001600160a01b03163314155b15611c53576002810154600160a01b900460ff168015611bbe57506002810154600160a81b900460ff165b611c09576040805162461bcd60e51b8152602060048201526017602482015276626f74682064657673206861766520746f207369676e2160481b604482015290519081900360640190fd5b600281015460018201546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611c49573d6000803e3d6000fd5b50611c5382611cd9565b5050565b6003546001600160a01b031681565b611c6e611e5f565b6000546001600160a01b03908116911614611cd0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61040981611e63565b6004548110611d1f576040805162461bcd60e51b815260206004820152600d60248201526c0d2dcecc2d8d2c840d2dcc8caf609b1b604482015290519081900360640190fd5b805b60045460001901811015611e125760048160010181548110611d3f57fe5b906000526020600020906003020160048281548110611d5a57fe5b60009182526020909120825460039092020180546001600160a01b03199081166001600160a01b0393841617825560018085015481840155600294850180549590930180549092169490931693909317808455815460ff600160a01b918290048116151590910260ff60a01b19909216919091178085558254600160a81b90819004831615150260ff60a81b19909116178085559154600160b01b9081900490911615150260ff60b01b199091161790915501611d21565b506004805480611e1e57fe5b60008281526020812060036000199093019283020180546001600160a01b0319168155600181019190915560020180546001600160b81b0319169055905550565b3390565b6001600160a01b038116611ea85760405162461bcd60e51b8152600401808060200182810382526026815260200180611f256026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fe4572726f723a205265717569726520646576656c6f706572206f72204f776e65724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573738a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d546f6b656e2062616c616e6365206e6f7420656e6f75676820666f722074686973207472616e73616374696f6e8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b62616c616e6365206e6f7420656e6f75676820666f722074686973207472616e73616374696f6ea2646970667358221220e80ae11544042fc6b9b23c507fc16c124e18710b60ddcf28e005d6d75e48a39c64736f6c634300060c0033