diff --git a/contracts/INationCred.sol b/contracts/INationCred.sol index 3dcaf8c..25c8e72 100644 --- a/contracts/INationCred.sol +++ b/contracts/INationCred.sol @@ -8,4 +8,11 @@ interface INationCred { * @param passportID The NFT passport ID */ function isActive(uint16 passportID) external view returns (bool); + + /** + * Returns `true` if a citizen's vote-escrowed `$NATION` balance has dropped below the passport expiry threshold; `false` otherwise. + * + * @param citizen The address of the passport owner + */ + function isPassportExpired(address citizen) external view returns (bool); } diff --git a/contracts/NationCred.sol b/contracts/NationCred.sol index b0aca4d..530f5b5 100644 --- a/contracts/NationCred.sol +++ b/contracts/NationCred.sol @@ -33,4 +33,9 @@ contract NationCred is INationCred { } return false; } + + function isPassportExpired(address citizen) public view returns (bool) { + // TO DO + return true; + } } diff --git a/test/NationCred.ts b/test/NationCred.ts index eddfa63..e6387cf 100644 --- a/test/NationCred.ts +++ b/test/NationCred.ts @@ -68,4 +68,14 @@ describe("NationCred", function () { expect(await nationCred.isActive(419)).to.equal(true); expect(await nationCred.isActive(420)).to.equal(false); }); + + it("isPassportExpired - no passport", async function () { + const [owner] = await ethers.getSigners(); + + const NationCred = await ethers.getContractFactory("NationCred"); + const nationCred = await NationCred.deploy(); + await nationCred.deployed(); + + expect(await nationCred.isPassportExpired(owner.address)).to.equal(true); + }); });