-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:waterfall-mkt/curta into sabnock/fl…
…ag-renderer-updates
- Loading branch information
Showing
12 changed files
with
250 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import { DeployBase } from "./DeployBase.s.sol"; | ||
|
||
contract DeployBaseGoerli is DeployBase { | ||
/// @notice The address to transfer the ownership of the Authorship Token | ||
/// to. | ||
address constant AUTHORSHIP_TOKEN_OWNER = 0xDbAacdcadD7c51a325B771ff75B261a1e7baE11c; | ||
|
||
/// @notice The address to transfer the ownership of Curta to. | ||
address constant CURTA_OWNER = 0xDbAacdcadD7c51a325B771ff75B261a1e7baE11c; | ||
|
||
/// @notice The number of seconds until an additional token is made | ||
/// available for minting by the author. | ||
uint256 constant ISSUE_LENGTH = 3 days; | ||
|
||
/// @notice The list of authors in the initial batch. | ||
address[] internal AUTHORS = new address[](0); | ||
|
||
constructor() DeployBase(AUTHORSHIP_TOKEN_OWNER, CURTA_OWNER, ISSUE_LENGTH, AUTHORS) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import { DeployBase } from "./DeployBase.s.sol"; | ||
|
||
contract DeployBaseMainnet is DeployBase { | ||
/// @notice The address to transfer the ownership of the Authorship Token | ||
/// to. | ||
address constant AUTHORSHIP_TOKEN_OWNER = 0xA85572Cd96f1643458f17340b6f0D6549Af482F5; | ||
|
||
/// @notice The address to transfer the ownership of Curta to. | ||
address constant CURTA_OWNER = 0xA85572Cd96f1643458f17340b6f0D6549Af482F5; | ||
|
||
/// @notice The number of seconds until an additional token is made | ||
/// available for minting by the author. | ||
uint256 constant ISSUE_LENGTH = 3 days; | ||
|
||
/// @notice The list of authors in the initial batch. | ||
address[] internal AUTHORS = [ | ||
// fiveoutofnine.eth | ||
0xA85572Cd96f1643458f17340b6f0D6549Af482F5, | ||
// sabnock.eth | ||
0xDbAacdcadD7c51a325B771ff75B261a1e7baE11c | ||
]; | ||
|
||
constructor() DeployBase(AUTHORSHIP_TOKEN_OWNER, CURTA_OWNER, ISSUE_LENGTH, AUTHORS) { } | ||
} |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
script/deploy/DeployConstellation.s.sol → ...ploy/deprecated/DeployConstellation.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import { Test } from "forge-std/Test.sol"; | ||
|
||
import { AuthorshipToken } from "@/contracts/AuthorshipToken.sol"; | ||
import { Curta } from "@/contracts/Curta.sol"; | ||
import { DeployBaseGoerli } from "@/script/deploy/DeployBaseGoerli.s.sol"; | ||
|
||
/// @notice Tests the Base Goerli deploy script. | ||
contract DeployBaseGoerliTest is Test { | ||
// ------------------------------------------------------------------------- | ||
// Contracts | ||
// ------------------------------------------------------------------------- | ||
|
||
/// @notice The Base Goerli deploy script. | ||
DeployBaseGoerli internal deployBaseGoerli; | ||
|
||
// ------------------------------------------------------------------------- | ||
// Setup | ||
// ------------------------------------------------------------------------- | ||
|
||
function setUp() public { | ||
vm.deal(vm.addr(vm.envUint("DEPLOYER_PRIVATE_KEY")), type(uint64).max); | ||
|
||
deployBaseGoerli = new DeployBaseGoerli(); | ||
deployBaseGoerli.run(); | ||
} | ||
|
||
// ------------------------------------------------------------------------- | ||
// Tests | ||
// ------------------------------------------------------------------------- | ||
|
||
/// @notice Test that the addresses were set correctly in each contract's | ||
/// deploy. | ||
function test_AddressInitializationCorrectness() public { | ||
assertEq(address(deployBaseGoerli.curta().flagRenderer()), address(deployBaseGoerli.flagRenderer())); | ||
assertEq( | ||
address(deployBaseGoerli.curta().authorshipToken()), address(deployBaseGoerli.authorshipToken()) | ||
); | ||
assertEq(deployBaseGoerli.authorshipToken().curta(), address(deployBaseGoerli.curta())); | ||
} | ||
|
||
/// @notice Test that the Authorship Token's issue length was set correctly. | ||
function test_authorshipTokenIssueLengthEquality() public { | ||
assertEq(deployBaseGoerli.authorshipToken().issueLength(), deployBaseGoerli.issueLength()); | ||
} | ||
|
||
/// @notice Test that the Authorship Token's authors were set. | ||
function test_authorshipTokenAuthorsEquality() public { | ||
uint256 totalSupply = deployBaseGoerli.authorshipToken().totalSupply(); | ||
assertEq(totalSupply, deployBaseGoerli.authorsLength()); | ||
|
||
unchecked { | ||
for (uint256 i; i < totalSupply; ++i) { | ||
assertEq(deployBaseGoerli.authorshipToken().ownerOf(i + 1), deployBaseGoerli.authors(i)); | ||
} | ||
} | ||
} | ||
|
||
/// @notice Test that an Authorship Token can be minted after deploy. | ||
function test_authorshipTokenMinting() public { | ||
AuthorshipToken authorshipToken = deployBaseGoerli.authorshipToken(); | ||
|
||
// Warp 1 `issueLength` period forward in time to ensure the owner can | ||
// mint 1. | ||
vm.warp(block.timestamp + authorshipToken.issueLength() + 1); | ||
|
||
// Mint as owner. | ||
vm.prank(authorshipToken.owner()); | ||
authorshipToken.ownerMint(address(this)); | ||
} | ||
|
||
/// @notice Test that the Authorship Token's ownership was transferred | ||
/// correctly. | ||
function test_authorshipTokenOwnerEquality() public { | ||
assertEq(deployBaseGoerli.authorshipToken().owner(), deployBaseGoerli.authorshipTokenOwner()); | ||
} | ||
|
||
/// @notice Test that Curta's ownership was transferred correctly. | ||
function test_curtaOwnerEquality() public { | ||
assertEq(deployBaseGoerli.curta().owner(), deployBaseGoerli.curtaOwner()); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import { Test } from "forge-std/Test.sol"; | ||
|
||
import { AuthorshipToken } from "@/contracts/AuthorshipToken.sol"; | ||
import { Curta } from "@/contracts/Curta.sol"; | ||
import { DeployBaseMainnet } from "@/script/deploy/DeployBaseMainnet.s.sol"; | ||
|
||
/// @notice Tests the Base mainnet deploy script. | ||
contract DeployBaseMainnetTest is Test { | ||
// ------------------------------------------------------------------------- | ||
// Contracts | ||
// ------------------------------------------------------------------------- | ||
|
||
/// @notice The Base mainnet deploy script. | ||
DeployBaseMainnet internal deployBaseMainnet; | ||
|
||
// ------------------------------------------------------------------------- | ||
// Setup | ||
// ------------------------------------------------------------------------- | ||
|
||
function setUp() public { | ||
vm.deal(vm.addr(vm.envUint("DEPLOYER_PRIVATE_KEY")), type(uint64).max); | ||
|
||
deployBaseMainnet = new DeployBaseMainnet(); | ||
deployBaseMainnet.run(); | ||
} | ||
|
||
// ------------------------------------------------------------------------- | ||
// Tests | ||
// ------------------------------------------------------------------------- | ||
|
||
/// @notice Test that the addresses were set correctly in each contract's | ||
/// deploy. | ||
function test_AddressInitializationCorrectness() public { | ||
assertEq( | ||
address(deployBaseMainnet.curta().flagRenderer()), address(deployBaseMainnet.flagRenderer()) | ||
); | ||
assertEq( | ||
address(deployBaseMainnet.curta().authorshipToken()), | ||
address(deployBaseMainnet.authorshipToken()) | ||
); | ||
assertEq(deployBaseMainnet.authorshipToken().curta(), address(deployBaseMainnet.curta())); | ||
} | ||
|
||
/// @notice Test that the Authorship Token's issue length was set correctly. | ||
function test_authorshipTokenIssueLengthEquality() public { | ||
assertEq(deployBaseMainnet.authorshipToken().issueLength(), deployBaseMainnet.issueLength()); | ||
} | ||
|
||
/// @notice Test that the Authorship Token's authors were set. | ||
function test_authorshipTokenAuthorsEquality() public { | ||
uint256 totalSupply = deployBaseMainnet.authorshipToken().totalSupply(); | ||
assertEq(totalSupply, deployBaseMainnet.authorsLength()); | ||
|
||
unchecked { | ||
for (uint256 i; i < totalSupply; ++i) { | ||
assertEq(deployBaseMainnet.authorshipToken().ownerOf(i + 1), deployBaseMainnet.authors(i)); | ||
} | ||
} | ||
} | ||
|
||
/// @notice Test that an Authorship Token can be minted after deploy. | ||
function test_authorshipTokenMinting() public { | ||
AuthorshipToken authorshipToken = deployBaseMainnet.authorshipToken(); | ||
|
||
// Warp 1 `issueLength` period forward in time to ensure the owner can | ||
// mint 1. | ||
vm.warp(block.timestamp + authorshipToken.issueLength() + 1); | ||
|
||
// Mint as owner. | ||
vm.prank(authorshipToken.owner()); | ||
authorshipToken.ownerMint(address(this)); | ||
} | ||
|
||
/// @notice Test that the Authorship Token's ownership was transferred | ||
/// correctly. | ||
function test_authorshipTokenOwnerEquality() public { | ||
assertEq(deployBaseMainnet.authorshipToken().owner(), deployBaseMainnet.authorshipTokenOwner()); | ||
} | ||
|
||
/// @notice Test that Curta's ownership was transferred correctly. | ||
function test_curtaOwnerEquality() public { | ||
assertEq(deployBaseMainnet.curta().owner(), deployBaseMainnet.curtaOwner()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters