From c2962d15c144dd8ed606e41e579c3a63acfde19a Mon Sep 17 00:00:00 2001 From: Aahna Ashina <95955389+aahna-ashina@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:39:24 +0800 Subject: [PATCH 1/2] feat: get owner address (#84) close #84 --- README.md | 2 +- contracts/utils/IPassportUtils.sol | 28 +++++++++++++++++++++++++++- contracts/utils/PassportUtils.sol | 28 +++++++++++++++++++++++++++- 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index da3ec66..09cdfdc 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ https://github.com/nation3/foundations/blob/main/deployments/sepolia.json - `utils/` - - `PassportUtils.sol`: [`0x4C72e8f37a2652BA6eEE956Ab30Ff21C3514cb5a`](https://sepolia.etherscan.io/address/0x4C72e8f37a2652BA6eEE956Ab30Ff21C3514cb5a) + - `PassportUtils.sol`: [`0x7Ef8C512D39547873A681242EA87881CD2b8B7B7`](https://sepolia.etherscan.io/address/0x7Ef8C512D39547873A681242EA87881CD2b8B7B7) - `NationCred.sol`: [`0x0EF98EaE3021B91Cc84E0dd59BAA35cB59981E42`](https://sepolia.etherscan.io/address/0x0EF98EaE3021B91Cc84E0dd59BAA35cB59981E42) diff --git a/contracts/utils/IPassportUtils.sol b/contracts/utils/IPassportUtils.sol index e44d61b..a06e5ed 100644 --- a/contracts/utils/IPassportUtils.sol +++ b/contracts/utils/IPassportUtils.sol @@ -1,12 +1,38 @@ -//SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.19; +/** + * ---------:::: + * ---------:---:::::: + * -----------::---::::::: + * ------------:.:--:::::::: + * -------------: .:--:::::::: + * -------------: .::::::::: + * -------------:.......:::::: + * -----:.. .:-------:::::: + * --------:.. .:-------:::::: + * ----------:..:--------::::: + * -----------.:--------:::: + * ----------::--------::: + * ------------------- + * ------------- + * + * Nation3 DAO + * https://nation3.org + */ interface IPassportUtils { /** * Returns `true` if an account is the owner of a passport. */ function isOwner(address account) external view returns (bool); + /** + * Returns the owner of a passport. + * + * @param passportID The identifier of an NFT passport + */ + function getOwnerAddress(uint16 passportID) external view returns (address); + /** * Returns `true` if a citizen's passport has become revocable. * diff --git a/contracts/utils/PassportUtils.sol b/contracts/utils/PassportUtils.sol index f5ae417..c40b686 100644 --- a/contracts/utils/PassportUtils.sol +++ b/contracts/utils/PassportUtils.sol @@ -1,10 +1,29 @@ -//SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.19; import "./IPassportUtils.sol"; import "../passport/IPassportIssuer.sol"; import "../governance/IVotingEscrow.sol"; +/** + * ---------:::: + * ---------:---:::::: + * -----------::---::::::: + * ------------:.:--:::::::: + * -------------: .:--:::::::: + * -------------: .::::::::: + * -------------:.......:::::: + * -----:.. .:-------:::::: + * --------:.. .:-------:::::: + * ----------:..:--------::::: + * -----------.:--------:::: + * ----------::--------::: + * ------------------- + * ------------- + * + * Nation3 DAO + * https://nation3.org + */ contract PassportUtils is IPassportUtils { string public constant VERSION = "0.6.7"; IPassportIssuer public passportIssuer; @@ -23,6 +42,13 @@ contract PassportUtils is IPassportUtils { return passportStatus == 1; } + /** + * @inheritdoc IPassportUtils + */ + function getOwnerAddress(uint16 passportID) public view returns (address) { + // TO DO + } + /** * @inheritdoc IPassportUtils */ From 440ba35ee3a95dc4a0c8fd57d1bf083267b920d2 Mon Sep 17 00:00:00 2001 From: Aahna Ashina <95955389+aahna-ashina@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:41:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=92=84=20prettier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/utils/IPassportUtils.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/utils/IPassportUtils.sol b/contracts/utils/IPassportUtils.sol index a06e5ed..47a5dbb 100644 --- a/contracts/utils/IPassportUtils.sol +++ b/contracts/utils/IPassportUtils.sol @@ -28,7 +28,7 @@ interface IPassportUtils { /** * Returns the owner of a passport. - * + * * @param passportID The identifier of an NFT passport */ function getOwnerAddress(uint16 passportID) external view returns (address);