ETH Price: $1,936.04 (+1.64%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Issue164365432023-01-18 22:01:47790 days ago1674079307IN
0x2E2E49eD...1361B52F2
0 ETH0.0353699448.09024915
Issue164365372023-01-18 22:00:23790 days ago1674079223IN
0x2E2E49eD...1361B52F2
0 ETH0.0012016331.34815996
Issue164362382023-01-18 21:00:23790 days ago1674075623IN
0x2E2E49eD...1361B52F2
0 ETH0.0006261424.50187595
Get Latest Bond162864612022-12-28 23:12:59811 days ago1672269179IN
0x2E2E49eD...1361B52F2
0 ETH0.000468615.4500814
Issue162864272022-12-28 23:06:11811 days ago1672268771IN
0x2E2E49eD...1361B52F2
0 ETH0.0004213316.48747089
Transfer Ownersh...162211862022-12-19 20:38:59820 days ago1671482339IN
0x2E2E49eD...1361B52F2
0 ETH0.0004481315.65386174
Issue162211502022-12-19 20:31:47820 days ago1671481907IN
0x2E2E49eD...1361B52F2
0 ETH0.0143759418.67755703
Init162211492022-12-19 20:31:35820 days ago1671481895IN
0x2E2E49eD...1361B52F2
0 ETH0.0039261519.13012046

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BondIssuer

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : BondIssuer.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;

import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { EnumerableSetUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";

import { IBondFactory } from "./_interfaces/buttonwood/IBondFactory.sol";
import { IBondController } from "./_interfaces/buttonwood/IBondController.sol";
import { IBondIssuer } from "./_interfaces/IBondIssuer.sol";

/**
 *  @title BondIssuer
 *
 *  @notice An issuer periodically issues bonds based on a predefined configuration.
 *
 *  @dev Based on the provided frequency, issuer instantiates a new bond with the config when poked.
 *
 */
contract BondIssuer is IBondIssuer, OwnableUpgradeable {
    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;

    /// @dev Using the same granularity as the underlying buttonwood tranche contracts.
    ///      https://github.com/buttonwood-protocol/tranche/blob/main/contracts/BondController.sol
    uint256 private constant TRANCHE_RATIO_GRANULARITY = 1000;

    /// @notice Address of the bond factory.
    IBondFactory public immutable bondFactory;

    /// @notice The underlying rebasing token used for tranching.
    address public immutable collateral;

    /// @notice The maximum maturity duration for the issued bonds.
    /// @dev In practice, bonds issued by this issuer won't have a constant duration as
    ///      block.timestamp when the issue function is invoked can vary.
    ///      Rather these bonds are designed to have a predictable maturity date.
    uint256 public maxMaturityDuration;

    /// @notice The tranche ratios.
    /// @dev Each tranche ratio is expressed as a fixed point number
    ///      such that the sum of all the tranche ratios is exactly 1000.
    ///      https://github.com/buttonwood-protocol/tranche/blob/main/contracts/BondController.sol#L20
    uint256[] public trancheRatios;

    /// @notice Time to elapse since last issue window start, after which a new bond can be issued.
    ///         AKA, issue frequency.
    uint256 public minIssueTimeIntervalSec;

    /// @notice The issue window begins this many seconds into the minIssueTimeIntervalSec period.
    /// @dev For example if minIssueTimeIntervalSec is 604800 (1 week), and issueWindowOffsetSec is 93600
    ///      then the issue window opens at Friday 2AM GMT every week.
    uint256 public issueWindowOffsetSec;

    /// @notice An enumerable list to keep track of bonds issued by this issuer.
    /// @dev Bonds are only added and never removed, thus the last item will always point
    ///      to the latest bond.
    EnumerableSetUpgradeable.AddressSet private _issuedBonds;

    /// @notice The timestamp when the issue window opened during the last issue.
    uint256 public lastIssueWindowTimestamp;

    /// @notice Contract constructor
    /// @param bondFactory_ The bond factory reference.
    /// @param collateral_ The address of the collateral ERC-20.
    constructor(IBondFactory bondFactory_, address collateral_) {
        bondFactory = bondFactory_;
        collateral = collateral_;
    }

    /// @notice Contract initializer.
    /// @param maxMaturityDuration_ The maximum maturity duration.
    /// @param trancheRatios_ The tranche ratios.
    /// @param minIssueTimeIntervalSec_ The minimum time between successive issues.
    /// @param issueWindowOffsetSec_ The issue window offset.
    function init(
        uint256 maxMaturityDuration_,
        uint256[] memory trancheRatios_,
        uint256 minIssueTimeIntervalSec_,
        uint256 issueWindowOffsetSec_
    ) public initializer {
        __Ownable_init();
        updateMaxMaturityDuration(maxMaturityDuration_);
        updateTrancheRatios(trancheRatios_);
        updateIssuanceTimingConfig(minIssueTimeIntervalSec_, issueWindowOffsetSec_);
    }

    /// @notice Updates the bond duration.
    /// @param maxMaturityDuration_ The new maximum maturity duration.
    function updateMaxMaturityDuration(uint256 maxMaturityDuration_) public onlyOwner {
        maxMaturityDuration = maxMaturityDuration_;
    }

    /// @notice Updates the tranche ratios used to issue bonds.
    /// @param trancheRatios_ The new tranche ratios, ordered by decreasing seniority (i.e. A to Z)
    function updateTrancheRatios(uint256[] memory trancheRatios_) public onlyOwner {
        trancheRatios = trancheRatios_;
        uint256 ratioSum;
        for (uint8 i = 0; i < trancheRatios_.length; i++) {
            ratioSum += trancheRatios_[i];
        }
        require(ratioSum == TRANCHE_RATIO_GRANULARITY, "BondIssuer: Invalid tranche ratios");
    }

    /// @notice Updates the bond frequency and offset.
    /// @param minIssueTimeIntervalSec_ The new issuance interval.
    /// @param issueWindowOffsetSec_ The new issue window offset.
    function updateIssuanceTimingConfig(uint256 minIssueTimeIntervalSec_, uint256 issueWindowOffsetSec_)
        public
        onlyOwner
    {
        minIssueTimeIntervalSec = minIssueTimeIntervalSec_;
        issueWindowOffsetSec = issueWindowOffsetSec_;
    }

    /// @inheritdoc IBondIssuer
    function isInstance(IBondController bond) external view override returns (bool) {
        return _issuedBonds.contains(address(bond));
    }

    /// @inheritdoc IBondIssuer
    function issue() public override {
        if (block.timestamp < lastIssueWindowTimestamp + minIssueTimeIntervalSec) {
            return;
        }

        // Set to the timestamp of the most recent issue window start
        lastIssueWindowTimestamp =
            block.timestamp -
            ((block.timestamp - issueWindowOffsetSec) % minIssueTimeIntervalSec);

        IBondController bond = IBondController(
            bondFactory.createBond(collateral, trancheRatios, lastIssueWindowTimestamp + maxMaturityDuration)
        );

        _issuedBonds.add(address(bond));

        emit BondIssued(bond);
    }

    /// @inheritdoc IBondIssuer
    /// @dev Lazily issues a new bond when the time is right.
    function getLatestBond() external override returns (IBondController) {
        issue();
        // NOTE: The latest bond will be at the end of the list.
        return IBondController(_issuedBonds.at(_issuedBonds.length() - 1));
    }

    /// @inheritdoc IBondIssuer
    function issuedCount() external view override returns (uint256) {
        return _issuedBonds.length();
    }

    /// @inheritdoc IBondIssuer
    function issuedBondAt(uint256 index) external view override returns (IBondController) {
        return IBondController(_issuedBonds.at(index));
    }
}

File 2 of 11 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _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 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 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);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 3 of 11 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSetUpgradeable {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 4 of 11 : IBondFactory.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

interface IBondFactory {
    function createBond(
        address _collateralToken,
        uint256[] memory trancheRatios,
        uint256 maturityDate
    ) external returns (address);
}

File 5 of 11 : IBondController.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import { ITranche } from "./ITranche.sol";

interface IBondController {
    function collateralToken() external view returns (address);

    function maturityDate() external view returns (uint256);

    function creationDate() external view returns (uint256);

    function totalDebt() external view returns (uint256);

    function feeBps() external view returns (uint256);

    function isMature() external view returns (bool);

    function tranches(uint256 i) external view returns (ITranche token, uint256 ratio);

    function trancheCount() external view returns (uint256 count);

    function trancheTokenAddresses(ITranche token) external view returns (bool);

    function deposit(uint256 amount) external;

    function redeem(uint256[] memory amounts) external;

    function mature() external;

    function redeemMature(address tranche, uint256 amount) external;
}

File 6 of 11 : IBondIssuer.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import { IBondController } from "./buttonwood/IBondController.sol";

interface IBondIssuer {
    /// @notice Event emitted when a new bond is issued by the issuer.
    /// @param bond The newly issued bond.
    event BondIssued(IBondController bond);

    /// @notice The address of the underlying collateral token to be used for issued bonds.
    /// @return Address of the collateral token.
    function collateral() external view returns (address);

    /// @notice Issues a new bond if sufficient time has elapsed since the last issue.
    function issue() external;

    /// @notice Checks if a given bond has been issued by the issuer.
    /// @param bond Address of the bond to check.
    /// @return if the bond has been issued by the issuer.
    function isInstance(IBondController bond) external view returns (bool);

    /// @notice Fetches the most recently issued bond.
    /// @return Address of the most recent bond.
    function getLatestBond() external returns (IBondController);

    /// @notice Returns the total number of bonds issued by this issuer.
    /// @return Number of bonds.
    function issuedCount() external view returns (uint256);

    /// @notice The bond address from the issued list by index.
    /// @return Address of the bond.
    function issuedBondAt(uint256 index) external view returns (IBondController);
}

File 7 of 11 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 8 of 11 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

File 9 of 11 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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");

        (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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 10 of 11 : ITranche.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

interface ITranche is IERC20Upgradeable {
    function bond() external view returns (address);
}

File 11 of 11 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IBondFactory","name":"bondFactory_","type":"address"},{"internalType":"address","name":"collateral_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IBondController","name":"bond","type":"address"}],"name":"BondIssued","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":[],"name":"bondFactory","outputs":[{"internalType":"contract IBondFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateral","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLatestBond","outputs":[{"internalType":"contract IBondController","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxMaturityDuration_","type":"uint256"},{"internalType":"uint256[]","name":"trancheRatios_","type":"uint256[]"},{"internalType":"uint256","name":"minIssueTimeIntervalSec_","type":"uint256"},{"internalType":"uint256","name":"issueWindowOffsetSec_","type":"uint256"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IBondController","name":"bond","type":"address"}],"name":"isInstance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"issue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"issueWindowOffsetSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"issuedBondAt","outputs":[{"internalType":"contract IBondController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"issuedCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastIssueWindowTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMaturityDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minIssueTimeIntervalSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"trancheRatios","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minIssueTimeIntervalSec_","type":"uint256"},{"internalType":"uint256","name":"issueWindowOffsetSec_","type":"uint256"}],"name":"updateIssuanceTimingConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxMaturityDuration_","type":"uint256"}],"name":"updateMaxMaturityDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"trancheRatios_","type":"uint256[]"}],"name":"updateTrancheRatios","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c060405234801561001057600080fd5b50604051610d62380380610d6283398101604081905261002f9161005e565b6001600160a01b039182166080521660a052610098565b6001600160a01b038116811461005b57600080fd5b50565b6000806040838503121561007157600080fd5b825161007c81610046565b602084015190925061008d81610046565b809150509250929050565b60805160a051610c976100cb6000396000818161022701526104a201526000818161017701526104730152610c976000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80638da5cb5b116100ad578063d97bef3411610071578063d97bef3414610249578063e1b43ba21461025c578063f2fde38b14610265578063fb425cc714610278578063ffdae9f81461028b57600080fd5b80638da5cb5b146101f8578063d383f64614610209578063d3cf9e3014610211578063d5eb27a11461021a578063d8dfeb451461022257600080fd5b8063576e4151116100f4578063576e4151146101725780636b44e6be146101b1578063715018a6146101d4578063748fff83146101dc5780637c46dc2b146101ef57600080fd5b80630b0f774314610126578063107e12d61461014157806319e1d5d61461014a5780633b35897a1461015f575b600080fd5b61012e61029e565b6040519081526020015b60405180910390f35b61012e60655481565b61015d610158366004610950565b6102af565b005b61015d61016d366004610a1a565b6102bc565b6101997f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610138565b6101c46101bf366004610a86565b6103f2565b6040519015158152602001610138565b61015d610405565b61015d6101ea366004610aa3565b610419565b61012e606b5481565b6033546001600160a01b0316610199565b61015d61042c565b61012e60685481565b610199610581565b6101997f000000000000000000000000000000000000000000000000000000000000000081565b610199610257366004610950565b6105ac565b61012e60675481565b61015d610273366004610a86565b6105b9565b61012e610286366004610950565b610632565b61015d610299366004610ac5565b610653565b60006102aa606961071c565b905090565b6102b7610726565b606555565b600054610100900460ff16158080156102dc5750600054600160ff909116105b806102f65750303b1580156102f6575060005460ff166001145b61035e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610381576000805461ff0019166101001790555b610389610780565b610392856102af565b61039b84610653565b6103a58383610419565b80156103eb576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60006103ff6069836107af565b92915050565b61040d610726565b61041760006107d4565b565b610421610726565b606791909155606855565b606754606b5461043c9190610b18565b42101561044557565b6067546068546104559042610b2b565b61045f9190610b3e565b6104699042610b2b565b606b8190555060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c7bfded57f00000000000000000000000000000000000000000000000000000000000000006066606554606b546104d39190610b18565b6040518463ffffffff1660e01b81526004016104f193929190610b60565b6020604051808303816000875af1158015610510573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105349190610bc4565b9050610541606982610826565b506040516001600160a01b03821681527f83425b315fe57ede6e65954ac7ec63b2699040570de3470442b54866a4a4c41d9060200160405180910390a150565b600061058b61042c565b6102aa600161059a606961071c565b6105a49190610b2b565b60699061083b565b60006103ff60698361083b565b6105c1610726565b6001600160a01b0381166106265760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610355565b61062f816107d4565b50565b6066818154811061064257600080fd5b600091825260209091200154905081565b61065b610726565b805161066e9060669060208401906108f0565b506000805b82518160ff1610156106bb57828160ff168151811061069457610694610be1565b6020026020010151826106a79190610b18565b9150806106b381610bf7565b915050610673565b506103e881146107185760405162461bcd60e51b815260206004820152602260248201527f426f6e644973737565723a20496e76616c6964207472616e63686520726174696044820152616f7360f01b6064820152608401610355565b5050565b60006103ff825490565b6033546001600160a01b031633146104175760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610355565b600054610100900460ff166107a75760405162461bcd60e51b815260040161035590610c16565b610417610847565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006107cd836001600160a01b038416610877565b60006107cd83836108c6565b600054610100900460ff1661086e5760405162461bcd60e51b815260040161035590610c16565b610417336107d4565b60008181526001830160205260408120546108be575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103ff565b5060006103ff565b60008260000182815481106108dd576108dd610be1565b9060005260206000200154905092915050565b82805482825590600052602060002090810192821561092b579160200282015b8281111561092b578251825591602001919060010190610910565b5061093792915061093b565b5090565b5b80821115610937576000815560010161093c565b60006020828403121561096257600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261099057600080fd5b8135602067ffffffffffffffff808311156109ad576109ad610969565b8260051b604051601f19603f830116810181811084821117156109d2576109d2610969565b6040529384528581018301938381019250878511156109f057600080fd5b83870191505b84821015610a0f578135835291830191908301906109f6565b979650505050505050565b60008060008060808587031215610a3057600080fd5b84359350602085013567ffffffffffffffff811115610a4e57600080fd5b610a5a8782880161097f565b949794965050505060408301359260600135919050565b6001600160a01b038116811461062f57600080fd5b600060208284031215610a9857600080fd5b81356107cd81610a71565b60008060408385031215610ab657600080fd5b50508035926020909101359150565b600060208284031215610ad757600080fd5b813567ffffffffffffffff811115610aee57600080fd5b610afa8482850161097f565b949350505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103ff576103ff610b02565b818103818111156103ff576103ff610b02565b600082610b5b57634e487b7160e01b600052601260045260246000fd5b500690565b6001600160a01b0384168152606060208083018290528454918301829052600085815281812090929091906080850190845b81811015610bae57845483526001948501949284019201610b92565b5050809350505050826040830152949350505050565b600060208284031215610bd657600080fd5b81516107cd81610a71565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8103610c0d57610c0d610b02565b60010192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea264697066735822122093b8aac6253d5be6361a75bfb55750d4c80b8173f51fc3dc999a58dbfd3b3f3e64736f6c634300081100330000000000000000000000002b135c839d61808e1ec6f84151cd9429b0920374000000000000000000000000d46ba6d942050d489dbd938a2c909a5d5039a161

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c80638da5cb5b116100ad578063d97bef3411610071578063d97bef3414610249578063e1b43ba21461025c578063f2fde38b14610265578063fb425cc714610278578063ffdae9f81461028b57600080fd5b80638da5cb5b146101f8578063d383f64614610209578063d3cf9e3014610211578063d5eb27a11461021a578063d8dfeb451461022257600080fd5b8063576e4151116100f4578063576e4151146101725780636b44e6be146101b1578063715018a6146101d4578063748fff83146101dc5780637c46dc2b146101ef57600080fd5b80630b0f774314610126578063107e12d61461014157806319e1d5d61461014a5780633b35897a1461015f575b600080fd5b61012e61029e565b6040519081526020015b60405180910390f35b61012e60655481565b61015d610158366004610950565b6102af565b005b61015d61016d366004610a1a565b6102bc565b6101997f0000000000000000000000002b135c839d61808e1ec6f84151cd9429b092037481565b6040516001600160a01b039091168152602001610138565b6101c46101bf366004610a86565b6103f2565b6040519015158152602001610138565b61015d610405565b61015d6101ea366004610aa3565b610419565b61012e606b5481565b6033546001600160a01b0316610199565b61015d61042c565b61012e60685481565b610199610581565b6101997f000000000000000000000000d46ba6d942050d489dbd938a2c909a5d5039a16181565b610199610257366004610950565b6105ac565b61012e60675481565b61015d610273366004610a86565b6105b9565b61012e610286366004610950565b610632565b61015d610299366004610ac5565b610653565b60006102aa606961071c565b905090565b6102b7610726565b606555565b600054610100900460ff16158080156102dc5750600054600160ff909116105b806102f65750303b1580156102f6575060005460ff166001145b61035e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610381576000805461ff0019166101001790555b610389610780565b610392856102af565b61039b84610653565b6103a58383610419565b80156103eb576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60006103ff6069836107af565b92915050565b61040d610726565b61041760006107d4565b565b610421610726565b606791909155606855565b606754606b5461043c9190610b18565b42101561044557565b6067546068546104559042610b2b565b61045f9190610b3e565b6104699042610b2b565b606b8190555060007f0000000000000000000000002b135c839d61808e1ec6f84151cd9429b09203746001600160a01b031663c7bfded57f000000000000000000000000d46ba6d942050d489dbd938a2c909a5d5039a1616066606554606b546104d39190610b18565b6040518463ffffffff1660e01b81526004016104f193929190610b60565b6020604051808303816000875af1158015610510573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105349190610bc4565b9050610541606982610826565b506040516001600160a01b03821681527f83425b315fe57ede6e65954ac7ec63b2699040570de3470442b54866a4a4c41d9060200160405180910390a150565b600061058b61042c565b6102aa600161059a606961071c565b6105a49190610b2b565b60699061083b565b60006103ff60698361083b565b6105c1610726565b6001600160a01b0381166106265760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610355565b61062f816107d4565b50565b6066818154811061064257600080fd5b600091825260209091200154905081565b61065b610726565b805161066e9060669060208401906108f0565b506000805b82518160ff1610156106bb57828160ff168151811061069457610694610be1565b6020026020010151826106a79190610b18565b9150806106b381610bf7565b915050610673565b506103e881146107185760405162461bcd60e51b815260206004820152602260248201527f426f6e644973737565723a20496e76616c6964207472616e63686520726174696044820152616f7360f01b6064820152608401610355565b5050565b60006103ff825490565b6033546001600160a01b031633146104175760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610355565b600054610100900460ff166107a75760405162461bcd60e51b815260040161035590610c16565b610417610847565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006107cd836001600160a01b038416610877565b60006107cd83836108c6565b600054610100900460ff1661086e5760405162461bcd60e51b815260040161035590610c16565b610417336107d4565b60008181526001830160205260408120546108be575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103ff565b5060006103ff565b60008260000182815481106108dd576108dd610be1565b9060005260206000200154905092915050565b82805482825590600052602060002090810192821561092b579160200282015b8281111561092b578251825591602001919060010190610910565b5061093792915061093b565b5090565b5b80821115610937576000815560010161093c565b60006020828403121561096257600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261099057600080fd5b8135602067ffffffffffffffff808311156109ad576109ad610969565b8260051b604051601f19603f830116810181811084821117156109d2576109d2610969565b6040529384528581018301938381019250878511156109f057600080fd5b83870191505b84821015610a0f578135835291830191908301906109f6565b979650505050505050565b60008060008060808587031215610a3057600080fd5b84359350602085013567ffffffffffffffff811115610a4e57600080fd5b610a5a8782880161097f565b949794965050505060408301359260600135919050565b6001600160a01b038116811461062f57600080fd5b600060208284031215610a9857600080fd5b81356107cd81610a71565b60008060408385031215610ab657600080fd5b50508035926020909101359150565b600060208284031215610ad757600080fd5b813567ffffffffffffffff811115610aee57600080fd5b610afa8482850161097f565b949350505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103ff576103ff610b02565b818103818111156103ff576103ff610b02565b600082610b5b57634e487b7160e01b600052601260045260246000fd5b500690565b6001600160a01b0384168152606060208083018290528454918301829052600085815281812090929091906080850190845b81811015610bae57845483526001948501949284019201610b92565b5050809350505050826040830152949350505050565b600060208284031215610bd657600080fd5b81516107cd81610a71565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8103610c0d57610c0d610b02565b60010192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea264697066735822122093b8aac6253d5be6361a75bfb55750d4c80b8173f51fc3dc999a58dbfd3b3f3e64736f6c63430008110033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000002b135c839d61808e1ec6f84151cd9429b0920374000000000000000000000000d46ba6d942050d489dbd938a2c909a5d5039a161

-----Decoded View---------------
Arg [0] : bondFactory_ (address): 0x2b135C839d61808E1eC6F84151CD9429B0920374
Arg [1] : collateral_ (address): 0xD46bA6D942050d489DBd938a2C909A5d5039A161

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000002b135c839d61808e1ec6f84151cd9429b0920374
Arg [1] : 000000000000000000000000d46ba6d942050d489dbd938a2c909a5d5039a161


Block Transaction Difficulty 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
Loading...
Loading
[ 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.