Address Contract Verified
Address
0x6C97C9754880e569c8f098b3CC654089F7ac5fBb
Balance
0 ETH
Nonce
1
Code Size
4631 bytes
Creator
0xd69FefE5...ae78 at tx 0x1b43ca2f...879bf7
Indexed Transactions
0
Contract Bytecode
4631 bytes
0x608060405234801561000f575f80fd5b506004361061012f575f3560e01c806379ba5097116100ad578063b1cd221a1161007d578063e30c397811610063578063e30c3978146102d3578063f2fde38b146102f1578063feec756c14610304575f80fd5b8063b1cd221a146102a0578063d77be17a146102b3575f80fd5b806379ba5097146102535780638456cb591461025b5780638da5cb5b146102635780639fd0506d14610280575f80fd5b8063554bab3c1161010257806366d003ac116100e857806366d003ac14610215578063715018a614610235578063743753591461023d575f80fd5b8063554bab3c146101df5780635c975abb146101f2575f80fd5b80631431288a146101335780633dfb6e10146101765780633f4ba83a1461018b5780635467e0a714610193575b5f80fd5b6101616101413660046110c9565b805160208183018101805160058252928201919093012091525460ff1681565b60405190151581526020015b60405180910390f35b61018961018436600461112b565b610317565b005b6101896103ac565b6101ba7f0000000000000000000000004580d3c5fff079bde60af9e98b62d4fb031ee0a081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016d565b6101896101ed36600461112b565b61043c565b60015474010000000000000000000000000000000000000000900460ff16610161565b6004546101ba9073ffffffffffffffffffffffffffffffffffffffff1681565b610189610574565b610245610585565b60405190815260200161016d565b61018961063c565b6101896106f1565b5f5473ffffffffffffffffffffffffffffffffffffffff166101ba565b6002546101ba9073ffffffffffffffffffffffffffffffffffffffff1681565b6101896102ae36600461114b565b61077a565b6003546101ba9073ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff166101ba565b6101896102ff36600461112b565b610b97565b61018961031236600461112b565b610c46565b61031f610cdb565b60035460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f02034d4dc7bd1a8fa8643521fe3f142cf2d6dc486f4f6266ab3f92eb1080d668905f90a3600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60025473ffffffffffffffffffffffffffffffffffffffff163314610432576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f43616c6c6572206e6f742070617573657200000000000000000000000000000060448201526064015b60405180910390fd5b61043a610d5b565b565b610444610cdb565b73ffffffffffffffffffffffffffffffffffffffff81166104e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f5061757361626c653a206e65772070617573657220697320746865207a65726f60448201527f20616464726573730000000000000000000000000000000000000000000000006064820152608401610429565b60025460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f1ff153f4b082245afbf3211a8d2d207da4c5df490e965f9a9ad141b0cd001dda905f90a3600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61057c610cdb565b61043a5f610dd8565b6003545f9073ffffffffffffffffffffffffffffffffffffffff166105a957505f90565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663743753596040518163ffffffff1660e01b8152600401602060405180830381865afa158015610613573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610637919061119e565b905090565b600154339073ffffffffffffffffffffffffffffffffffffffff1681146106e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610429565b6106ee81610dd8565b50565b60025473ffffffffffffffffffffffffffffffffffffffff163314610772576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f43616c6c6572206e6f74207061757365720000000000000000000000000000006044820152606401610429565b61043a610e09565b610782610e78565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004580d3c5fff079bde60af9e98b62d4fb031ee0a01614610847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f536574746c656d656e743a2063616c6c6572206e6f7420726564656d7074696f60448201527f6e000000000000000000000000000000000000000000000000000000000000006064820152608401610429565b60035473ffffffffffffffffffffffffffffffffffffffff166108ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f536574746c656d656e743a206e6f206c697175696469747920736f757263652060448201527f73657400000000000000000000000000000000000000000000000000000000006064820152608401610429565b600354604080517f743753590000000000000000000000000000000000000000000000000000000081529051849273ffffffffffffffffffffffffffffffffffffffff169163743753599160048083019260209291908290030181865afa158015610959573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061097d919061119e565b1015610a0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f536574746c656d656e743a206578636565647320616c6c6f77656420616d6f7560448201527f6e740000000000000000000000000000000000000000000000000000000000006064820152608401610429565b600581604051610a1b91906111b5565b9081526040519081900360200190205460ff1615610abb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f536574746c656d656e743a2072656465656d6572206a7572697364696374696f60448201527f6e206973207265737472696374656400000000000000000000000000000000006064820152608401610429565b6003546040517fd7ecc12900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590529091169063d7ecc129906044015f604051808303815f87803b158015610b2c575f80fd5b505af1158015610b3e573d5f803e3d5ffd5b505050508273ffffffffffffffffffffffffffffffffffffffff167f1762c954954f2abac7c28caee2ab4e282c064cbca83bb0e3e51d43af6cccef8583604051610b8a91815260200190565b60405180910390a2505050565b610b9f610cdb565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155610c015f5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b610c4e610cdb565b60045460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f62e69886a5df0ba8ffcacbfc1388754e7abd9bde24b036354c561f1acd4e4593905f90a3600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5f5473ffffffffffffffffffffffffffffffffffffffff16331461043a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610429565b610d63610efd565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556106ee81610f81565b610e11610e78565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610dae3390565b60015474010000000000000000000000000000000000000000900460ff161561043a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610429565b60015474010000000000000000000000000000000000000000900460ff1661043a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610429565b5f805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f830112611031575f80fd5b813567ffffffffffffffff8082111561104c5761104c610ff5565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561109257611092610ff5565b816040528381528660208588010111156110aa575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f602082840312156110d9575f80fd5b813567ffffffffffffffff8111156110ef575f80fd5b6110fb84828501611022565b949350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611126575f80fd5b919050565b5f6020828403121561113b575f80fd5b61114482611103565b9392505050565b5f805f6060848603121561115d575f80fd5b61116684611103565b925060208401359150604084013567ffffffffffffffff811115611188575f80fd5b61119486828701611022565b9150509250925092565b5f602082840312156111ae575f80fd5b5051919050565b5f82515f5b818110156111d457602081860181015185830152016111ba565b505f92019182525091905056fea264697066735822122018398e9d04e0a3341b521cade149119cc9edfb84db934d4e085ad2d73205952a64736f6c63430008140033
Verified Source Code Full Match
Compiler: v0.8.20+commit.a1b79de6
EVM: shanghai
Optimization: Yes (10000000 runs)
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Ownable2Step.sol 57 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
import "./Ownable.sol";
/**
* @dev Contract module which provides 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} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
}
Pausable.sol 105 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
ILiquiditySource.sol 43 lines
/**
* Copyright 2024 Circle Internet Financial, LTD. All rights reserved.
* Modifications copyright 2025 Securitize Inc.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pragma solidity ^0.8.16;
/**
* @title ILiquiditySource
*/
interface ILiquiditySource {
/**
* @notice Emitted when liquidity is supplied to a recipient.
*/
event LiquiditySupplied(address indexed recipient, uint256 amount);
/**
* @notice Supplies liquidity to a recipient
* @param recipient Receiver of liquidity
* @param amount Amount of liquidity to transfer
*/
function supplyTo(address recipient, uint256 amount) external;
/**
* @notice The available liquidity that can be supplied
* @return The available liquidity amount
*/
function availableLiquidity() external view returns (uint256);
}
IRedemption.sol 43 lines
/**
* Copyright 2024 Circle Internet Financial, LTD. All rights reserved.
* Modifications copyright 2025 Securitize Inc.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pragma solidity ^0.8.16;
/**
* @title IRedemption
*/
interface IRedemption {
/**
* @notice The asset being redeemed.
* @return The address of the asset token.
*/
function asset() external view returns (address);
/**
* @notice The liquidity token that the asset is being redeemed for.
* @return The address of the liquidity token.
*/
function liquidity() external view returns (address);
/**
* @notice Redeems an amount of asset for liquidity
* @param amount The amount of the asset token to redeem
*/
function redeem(uint256 amount) external;
}
ISettlement.sol 42 lines
/**
* Copyright 2024 Circle Internet Financial, LTD. All rights reserved.
* Modifications copyright 2025 Securitize Inc.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pragma solidity ^0.8.16;
/**
* @title ISettlement
*/
interface ISettlement {
/**
* @notice The recipient of the redemption swap: where the asset gets transferred to.
* @return The address of the recipient.
*/
function recipient() external view returns (address);
/**
* @notice The liquidity available for settlement.
* @return The amount of liquidity available
*/
function availableLiquidity() external view returns (uint256);
/**
* @notice Settles the redemption request, by transferring liquidity to the redeemer.
*/
function redeem(address redeemer, uint256 amount, string memory redeemerCountry) external;
}
OwnablePausable.sol 84 lines
/**
* Copyright 2024 Circle Internet Financial, LTD. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pragma solidity ^0.8.16;
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
/**
* @title OwnablePausable
* @notice Combines the Ownable2Step and Pausable types.
* @dev Owner can rotate the Pauser role.
*/
contract OwnablePausable is Ownable2Step, Pausable {
/**
* @notice Emitted when the pauser address changes
* @param oldPauser Prior pauser address
* @param newPauser Updated pauser address
*/
event PauserUpdated(address indexed oldPauser, address indexed newPauser);
/**
* @notice Address currently set as pauser
*/
address public pauser;
/**
* @notice Checks that the sender is the pauser
*/
modifier onlyPauser() {
require(msg.sender == pauser, "Caller not pauser");
_;
}
/**
* @dev Owner and pauser addresses are explicitly passed.
*/
constructor(address _owner, address _pauser) {
_transferOwnership(_owner);
pauser = _pauser;
}
/**
* @notice Sets a new Pauser.
* @dev Only callable by the Owner.
*/
function updatePauser(address newPauser) external onlyOwner {
require(
newPauser != address(0),
"Pausable: new pauser is the zero address"
);
emit PauserUpdated(pauser, newPauser);
pauser = newPauser;
}
/**
* @dev Only callable by the Pauser.
*/
function pause() external onlyPauser {
_pause();
}
/**
* @dev Only callable by the Pauser.
*/
function unpause() external onlyPauser {
_unpause();
}
}
Settlement.sol 167 lines
/**
* Copyright 2024 Circle Internet Financial, LTD. All rights reserved.
* Modifications copyright 2025 Securitize Inc.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pragma solidity ^0.8.16;
import {ISettlement} from "./interfaces/ISettlement.sol";
import {IRedemption} from "./interfaces/IRedemption.sol";
import {ILiquiditySource} from "./interfaces/ILiquiditySource.sol";
import {OwnablePausable} from "./roles/OwnablePausable.sol";
/**
* @title Settlement
* @dev Pausable by the Pauser
*/
contract Settlement is ISettlement, OwnablePausable {
/**
* @notice Emitted when the current recipient address changes
* @param oldRecipient Prior recipient address
* @param newRecipient Updated recipient address
*/
event RecipientUpdated(
address indexed oldRecipient,
address indexed newRecipient
);
/**
* @notice Emitted when the current liquidity source changes
* @param oldSource Prior source address
* @param newSource Updated source address
*/
event LiquiditySourceUpdated(
address indexed oldSource,
address indexed newSource
);
/**
* @notice Emitted when settlement is completed.
* @param redeemer Initiator of redemption transaction
* @param amount the amount being redeemed, 1:1 with liquidity
*/
event SettlementCompleted(address indexed redeemer, uint256 amount);
/**
* @notice Immutable redemption contract
*/
IRedemption public immutable redemption;
/**
* @notice Current liquidity source
*/
ILiquiditySource public liquiditySource;
/**
* @inheritdoc ISettlement
*/
address public recipient;
/**
* @notice Restricted countries
*/
mapping(string => bool) public restrictedCountries;
/**
* @param _redemption Address of the redemption contract
* @param _recipient Address that receives the asset
* @param _owner Owner address, capable of changing the pauser
* and adjusting parameters.
* @param _pauser Address of pauser
* @param _restrictedCountries Array of the restricted countries
*/
constructor(
address _redemption,
address _recipient,
address _owner,
address _pauser,
string[] memory _restrictedCountries
) OwnablePausable(_owner, _pauser) {
redemption = IRedemption(_redemption);
recipient = _recipient;
for (uint i = 0; i < _restrictedCountries.length; i++) {
restrictedCountries[_restrictedCountries[i]] = true;
}
}
/**
* @inheritdoc ISettlement
* @dev Only callable when not paused.
* @dev Only callable by the redemption contract
*/
function redeem(
address redeemer,
uint256 amount,
string memory redeemerCountry
) external override whenNotPaused {
require(
msg.sender == address(redemption),
"Settlement: caller not redemption"
);
require(
address(liquiditySource) != address(0),
"Settlement: no liquidity source set"
);
require(
liquiditySource.availableLiquidity() >= amount,
"Settlement: exceeds allowed amount"
);
require(
!restrictedCountries[redeemerCountry],
"Settlement: redeemer jurisdiction is restricted"
);
liquiditySource.supplyTo(redeemer, amount);
emit SettlementCompleted(redeemer, amount);
}
/**
* @inheritdoc ISettlement
* @dev Delegates to the currently set liquidity source.
*/
function availableLiquidity() external view override returns (uint256) {
if (address(liquiditySource) == address(0)) {
return 0;
}
return liquiditySource.availableLiquidity();
}
/**
* @notice Updates the recipient.
* @dev Only callable by the owner.
* @dev Allows setting to the 0 address.
*/
function updateRecipient(address _recipient) external onlyOwner {
emit RecipientUpdated(recipient, _recipient);
recipient = _recipient;
}
/**
* @notice Updates the current liquidity source.
* @dev Only callable by the owner.
* @dev Allows setting to the 0 address.
*/
function updateLiquiditySource(
address _liquiditySource
) external onlyOwner {
emit LiquiditySourceUpdated(address(liquiditySource), _liquiditySource);
liquiditySource = ILiquiditySource(_liquiditySource);
}
}
Read Contract
availableLiquidity 0x74375359 → uint256
liquiditySource 0xd77be17a → address
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
pauser 0x9fd0506d → address
pendingOwner 0xe30c3978 → address
recipient 0x66d003ac → address
redemption 0x5467e0a7 → address
restrictedCountries 0x1431288a → bool
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
pause 0x8456cb59
No parameters
redeem 0xb1cd221a
address redeemer
uint256 amount
string redeemerCountry
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
updateLiquiditySource 0x3dfb6e10
address _liquiditySource
updatePauser 0x554bab3c
address newPauser
updateRecipient 0xfeec756c
address _recipient
Recent Transactions
No transactions found for this address