Skip to content

Commit

Permalink
Organize Migrated Contracts (#10817)
Browse files Browse the repository at this point in the history
* Moved to identity folder & changed shadowed variable in federated attestations

* removed console log import

* removed unused imports

* removed blank ocntract

* Added parent Contract name to test contracts

* Added aliases for Celo contracts path

---------

Co-authored-by: Martín Volpe <volpe@clabs.co>
Co-authored-by: Martín Volpe <martin.volpe@gmail.com>
  • Loading branch information
3 people authored Dec 11, 2023
1 parent a69accc commit b4aa051
Show file tree
Hide file tree
Showing 20 changed files with 110 additions and 133 deletions.
4 changes: 3 additions & 1 deletion packages/protocol/remappings.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
@celo-contracts=contracts/
@celo-contracts=contracts/
@test-sol=test-sol
@lib=lib
38 changes: 17 additions & 21 deletions packages/protocol/test-sol/Accounts.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import "celo-foundry/Test.sol";
import "../contracts/identity/Escrow.sol";
import "../contracts/identity/FederatedAttestations.sol";
import "../contracts/identity/test/MockAttestations.sol";
import "../contracts/identity/test/MockERC20Token.sol";
import "../contracts/common/FixidityLib.sol";
import "../contracts/common/Registry.sol";
import "../contracts/common/Accounts.sol";
import "../contracts/governance/test/MockValidators.sol";
import "@celo-contracts/common/FixidityLib.sol";
import "@celo-contracts/common/Registry.sol";
import "@celo-contracts/common/Accounts.sol";
import "@celo-contracts/governance/test/MockValidators.sol";

contract AccountsTest is Test {
using FixidityLib for FixidityLib.Fraction;
Expand Down Expand Up @@ -205,7 +201,7 @@ contract AccountsTest is Test {
}
}

contract CreateAccount is AccountsTest {
contract AccountsCreateAccount is AccountsTest {
function setUp() public {
super.setUp();
}
Expand All @@ -223,7 +219,7 @@ contract CreateAccount is AccountsTest {
}
}

contract SetAccountDataEncryptionKey is AccountsTest {
contract AccountsSetAccountDataEncryptionKey is AccountsTest {
function setUp() public {
super.setUp();
}
Expand Down Expand Up @@ -257,7 +253,7 @@ contract SetAccountDataEncryptionKey is AccountsTest {
}
}

contract SetAccount is AccountsTest {
contract AccountsSetAccount is AccountsTest {
function setUp() public {
super.setUp();
}
Expand Down Expand Up @@ -345,7 +341,7 @@ contract SetAccount is AccountsTest {
}
}

contract SetWalletAddress is AccountsTest {
contract AccountsSetWalletAddress is AccountsTest {
function setUp() public {
super.setUp();
}
Expand Down Expand Up @@ -395,7 +391,7 @@ contract SetWalletAddress is AccountsTest {
}
}

contract SetMetadataURL is AccountsTest {
contract AccountsSetMetadataURL is AccountsTest {
function setUp() public {
super.setUp();
}
Expand All @@ -419,7 +415,7 @@ contract SetMetadataURL is AccountsTest {
}
}

contract BatchGetMetadataURL is AccountsTest {
contract AccountsBatchGetMetadataURL is AccountsTest {
function setUp() public {
super.setUp();
}
Expand Down Expand Up @@ -470,7 +466,7 @@ contract BatchGetMetadataURL is AccountsTest {
}
}

contract AddStorageRoot is AccountsTest {
contract AccountsAddStorageRoot is AccountsTest {
function setUp() public {
super.setUp();
}
Expand Down Expand Up @@ -516,7 +512,7 @@ contract AddStorageRoot is AccountsTest {
}
}

contract RemoveStorageRoot is AccountsTest {
contract AccountsRemoveStorageRoot is AccountsTest {
function setUp() public {
super.setUp();
}
Expand Down Expand Up @@ -592,7 +588,7 @@ contract RemoveStorageRoot is AccountsTest {
}
}

contract SetPaymentDelegation is AccountsTest {
contract AccountsSetPaymentDelegation is AccountsTest {
address beneficiary = actor("beneficiary");
uint256 fraction = FixidityLib.newFixedFraction(2, 10).unwrap();
uint256 badFraction = FixidityLib.newFixedFraction(12, 10).unwrap();
Expand Down Expand Up @@ -634,7 +630,7 @@ contract SetPaymentDelegation is AccountsTest {
}
}

contract DeletePaymentDelegation is AccountsTest {
contract AccountsDeletePaymentDelegation is AccountsTest {
address beneficiary = actor("beneficiary");
uint256 fraction = FixidityLib.newFixedFraction(2, 10).unwrap();

Expand Down Expand Up @@ -664,7 +660,7 @@ contract DeletePaymentDelegation is AccountsTest {
}
}

contract SetName is AccountsTest {
contract AccountsSetName is AccountsTest {
function setUp() public {
super.setUp();
}
Expand All @@ -688,7 +684,7 @@ contract SetName is AccountsTest {
}
}

contract GenericAuthorization is AccountsTest {
contract AccountsGenericAuthorization is AccountsTest {
address account2 = actor("account2");
address signer;
uint256 signerPK;
Expand Down Expand Up @@ -872,7 +868,7 @@ contract GenericAuthorization is AccountsTest {
}
}

contract BackwardCompatibility is AccountsTest {
contract AccountsBackwardCompatibility is AccountsTest {
address account = address(this);
address otherAccount = actor("otherAccount");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "forge-std/console.sol";

// Contract to test
import "../../contracts/common/test/AddressSortedLinkedListWithMedianTest.sol";
import "@celo-contracts/common/test/AddressSortedLinkedListWithMedianTest.sol";

contract AddressSortedLinkedListWithMedianInsertTest is Test {
AddressSortedLinkedListWithMedianTest sortedList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "forge-std/console.sol";

// Contract to test
import "../../contracts/common/ExtractFunctionSignature.sol";
import "@celo-contracts/common/ExtractFunctionSignature.sol";

contract ExtractFunctionSignatureWrapper {
function extractFunctionSignature(bytes memory input) public pure returns (bytes4) {
Expand Down Expand Up @@ -35,7 +34,7 @@ contract ExtractFunctionSignatureTest is Test {
testTransactions = new TestTransactions();
}

function testExtractFunctionSignature() public {
function test_ExtractFunctionSignature() public {
// Arrange
bytes memory data = abi.encodeWithSignature("setValue(uint256,uint256,bool)", 1, 1, true);
bytes4 expectedSignature = bytes4(keccak256("setValue(uint256,uint256,bool)"));
Expand Down
3 changes: 1 addition & 2 deletions packages/protocol/test-sol/common/Fixidity.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "forge-std/console.sol";

// Contract to test
import "../../contracts/common/test/FixidityWrapper.sol";
import "@celo-contracts/common/test/FixidityWrapper.sol";

contract FixidityTest is Test {
uint256 private constant FIXED1_UINT = 1000000000000000000000000;
Expand Down
5 changes: 2 additions & 3 deletions packages/protocol/test-sol/common/GoldToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "forge-std/console.sol";
import "../../contracts/common/GoldToken.sol";
import "../../contracts/common/test/MockGoldToken.sol";
import "@celo-contracts/common/GoldToken.sol";
import "@celo-contracts/common/test/MockGoldToken.sol";

contract GoldTokenTest is Test {
GoldToken goldToken;
Expand Down
7 changes: 3 additions & 4 deletions packages/protocol/test-sol/common/LinkedList.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "forge-std/console.sol";

// Contract to test
import "../../contracts/common/test/LinkedListWrapper.sol";
import "@celo-contracts/common/test/LinkedListWrapper.sol";

contract Insert is Test {
contract LinkedListInsert is Test {
LinkedListWrapper linkedList;
bytes32 private constant NULL_KEY = bytes32(uint256(0x00));
bytes32 private constant FIRST_KEY = bytes32(uint256(0x01));
Expand Down Expand Up @@ -88,7 +87,7 @@ contract Insert is Test {
}
}

contract Remove is Test {
contract LinkedListRemove is Test {
LinkedListWrapper linkedList;

bytes32 private constant NULL_KEY = bytes32(uint256(0x00));
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test-sol/common/Multisig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "../../contracts/common/MultiSig.sol";
import "@celo-contracts/common/MultiSig.sol";

contract MultiSigTest is Test {
function() external payable {}
Expand Down
3 changes: 1 addition & 2 deletions packages/protocol/test-sol/common/Registry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "forge-std/console.sol";

// Contract to test
import "../../contracts/common/Registry.sol";
import "@celo-contracts/common/Registry.sol";

contract RegistryTest is Test {
event RegistryUpdated(string identifier, bytes32 indexed identifierHash, address indexed addr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import "@celo-contracts/common/Freezer.sol";

import { MockElection } from "@celo-contracts/governance/test/MockElection.sol";
import { EpochRewardsTest } from "@celo-contracts/governance/test/EpochRewardsTest.sol";
import { Reserve } from "../../../lib/mento-core/contracts/Reserve.sol";
import { Reserve } from "@lib/mento-core/contracts/Reserve.sol";

import { MockSortedOracles } from "@celo-contracts/stability/test/MockSortedOracles.sol";
import { MockStableToken } from "@celo-contracts/stability/test/MockStableToken.sol";
import { MockGoldToken } from "@celo-contracts/common/test/MockGoldToken.sol";

import { Constants } from "../../constants.sol";
import { Utils } from "../../utils.sol";
import { Constants } from "@test-sol/constants.sol";
import { Utils } from "@test-sol/utils.sol";

contract EpochRewardsFoundryTest is Test, Constants, Utils {
event TargetVotingGoldFractionSet(uint256 fraction);
Expand Down
7 changes: 3 additions & 4 deletions packages/protocol/test-sol/governance/network/Proposal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "forge-std/console.sol";

// Contract to test
import "../../../contracts/governance/Proposals.sol";
import "../../../contracts/common/FixidityLib.sol";
import "@celo-contracts/governance/Proposals.sol";
import "@celo-contracts/common/FixidityLib.sol";

contract GetSupportWithQuorumPadding is Test {
contract ProposalGetSupportWithQuorumPadding is Test {
using Proposals for Proposals.Proposal;
using FixidityLib for FixidityLib.Fraction;

Expand Down
22 changes: 11 additions & 11 deletions packages/protocol/test-sol/governance/voting/LockedGold.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ pragma experimental ABIEncoderV2;
import "celo-foundry/Test.sol";
import "forge-std/console.sol";

import "../../../contracts/common/FixidityLib.sol";
import "../../../contracts/common/Registry.sol";
import "../../../contracts/common/Accounts.sol";
import "../../../contracts/common/test/MockGoldToken.sol";
import "../../../contracts/governance/LockedGold.sol";
import "../../../contracts/governance/ReleaseGold.sol";
import "../../../contracts/governance/Election.sol";
import "../../../contracts/stability/test/MockStableToken.sol";
import "../../../contracts/governance/test/MockElection.sol";
import "../../../contracts/governance/test/MockGovernance.sol";
import "../../../contracts/governance/test/MockValidators.sol";
import "@celo-contracts/common/FixidityLib.sol";
import "@celo-contracts/common/Registry.sol";
import "@celo-contracts/common/Accounts.sol";
import "@celo-contracts/common/test/MockGoldToken.sol";
import "@celo-contracts/governance/LockedGold.sol";
import "@celo-contracts/governance/ReleaseGold.sol";
import "@celo-contracts/governance/Election.sol";
import "@celo-contracts/stability/test/MockStableToken.sol";
import "@celo-contracts/governance/test/MockElection.sol";
import "@celo-contracts/governance/test/MockGovernance.sol";
import "@celo-contracts/governance/test/MockValidators.sol";

contract LockedGoldTest is Test {
using FixidityLib for FixidityLib.Fraction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import "../contracts/identity/test/AttestationsTest.sol";
import "../contracts/identity/test/MockERC20Token.sol";
import "../contracts/identity/test/MockRandom.sol";
import "../contracts/governance/test/MockElection.sol";
import "../contracts/governance/test/MockLockedGold.sol";
import "../contracts/governance/test/MockValidators.sol";
import "../contracts/common/Registry.sol";
import "../contracts/common/Accounts.sol";
import "@celo-contracts/identity/test/AttestationsTest.sol";
import "@celo-contracts/identity/test/MockERC20Token.sol";
import "@celo-contracts/identity/test/MockRandom.sol";
import "@celo-contracts/governance/test/MockElection.sol";
import "@celo-contracts/governance/test/MockLockedGold.sol";
import "@celo-contracts/governance/test/MockValidators.sol";
import "@celo-contracts/common/Registry.sol";
import "@celo-contracts/common/Accounts.sol";

contract AttestationsFoundryTest is Test {
enum KeyOffsets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import "celo-foundry/Test.sol";
import "forge-std/console.sol";
import "../contracts/identity/Escrow.sol";
import "../contracts/identity/FederatedAttestations.sol";
import "../contracts/identity/test/MockAttestations.sol";
import "../contracts/identity/test/MockERC20Token.sol";
import "../contracts/common/FixidityLib.sol";
import "../contracts/common/Registry.sol";
import "../contracts/common/Signatures.sol";
import "@celo-contracts/identity/Escrow.sol";
import "@celo-contracts/identity/FederatedAttestations.sol";
import "@celo-contracts/identity/test/MockAttestations.sol";
import "@celo-contracts/identity/test/MockERC20Token.sol";
import "@celo-contracts/common/FixidityLib.sol";
import "@celo-contracts/common/Registry.sol";
import "@celo-contracts/common/Signatures.sol";

contract EscrowTest is Test {
using FixidityLib for FixidityLib.Fraction;
Expand Down Expand Up @@ -239,7 +238,7 @@ contract EscrowAddDefaultTrustedIssuer is EscrowTest {
}
}

contract WhenMaxTrustedIssuersHaveBeenAdded is EscrowTest {
contract EscrowWhenMaxTrustedIssuersHaveBeenAdded is EscrowTest {
address[] expectedTrustedIssuers;
function setUp() public {
super.setUp();
Expand Down
Loading

0 comments on commit b4aa051

Please sign in to comment.