grizzlyfi / smart-contracts

29 stars 16 forks source link

Unable to compile #2

Open AliAMA opened 2 years ago

AliAMA commented 2 years ago

It seems that some files missing. I'm unable to compile ontracts due to Error HH404: File ./Interfaces/IFreezer.sol, imported from contracts/Referral.sol, not found. error.

HardhatError: HH404: File ./Interfaces/IFreezer.sol, imported from contracts/Referral.sol, not found.
    at Resolver.resolveImport (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:147:15)
    at DependencyGraph._addDependenciesFrom (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:171:26)
    at Function.createFromResolvedFiles (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:13:7)
    at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:187:31)
    at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
    at Environment.run (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
    at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:1323:58)
    at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
    at Environment.run (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
    at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:1438:7)

    Caused by: HardhatError: HH400: File contracts/Interfaces/IFreezer.sol doesn't exist.
        at Resolver._validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:421:15)
        at Resolver._resolveLocalSourceName (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:197:5)
        at Resolver.resolveImport (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:132:16)
        at DependencyGraph._addDependenciesFrom (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:171:26)
        at Function.createFromResolvedFiles (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:13:7)
        at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:187:31)
        at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
        at Environment.run (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
        at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:1323:58)
        at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)

        Caused by: HardhatError: HH1005: Solidity source file contracts/Interfaces/IFreezer.sol not found
            at getPathTrueCase (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/utils/source-names.ts:207:15)
            at validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/utils/source-names.ts:102:30)
            at Resolver._validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:413:7)
            at Resolver._resolveLocalSourceName (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:197:5)
            at Resolver.resolveImport (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:132:16)
            at DependencyGraph._addDependenciesFrom (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:171:26)
            at Function.createFromResolvedFiles (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:13:7)
            at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:187:31)
            at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
            at Environment.run (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)

            Caused by: Error: [true-case-path]: Called with contracts/Interfaces/IFreezer.sol, but no matching file exists
                at matchCaseInsensitive (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/true-case-path/index.js:33:9)
                at /Users/ali/Workspace/smbazi/griz-sm-test/node_modules/true-case-path/index.js:87:7
                at iterateAsync (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/true-case-path/index.js:83:10)
                at getPathTrueCase (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/utils/source-names.ts:199:17)
                at validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/utils/source-names.ts:102:30)
                at Resolver._validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:413:7)
                at Resolver._resolveLocalSourceName (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:197:5)
                at Resolver.resolveImport (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:132:16)
                at DependencyGraph._addDependenciesFrom (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:171:26)
                at Function.createFromResolvedFiles (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:13:7)
Alexmcfly19 commented 1 year ago

It seems that some files missing. I'm unable to compile ontracts due to Error HH404: File ./Interfaces/IFreezer.sol, imported from contracts/Referral.sol, not found. error.

HardhatError: HH404: File ./Interfaces/IFreezer.sol, imported from contracts/Referral.sol, not found.
    at Resolver.resolveImport (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:147:15)
    at DependencyGraph._addDependenciesFrom (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:171:26)
    at Function.createFromResolvedFiles (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:13:7)
    at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:187:31)
    at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
    at Environment.run (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
    at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:1323:58)
    at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
    at Environment.run (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
    at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:1438:7)

    Caused by: HardhatError: HH400: File contracts/Interfaces/IFreezer.sol doesn't exist.
        at Resolver._validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:421:15)
        at Resolver._resolveLocalSourceName (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:197:5)
        at Resolver.resolveImport (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:132:16)
        at DependencyGraph._addDependenciesFrom (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:171:26)
        at Function.createFromResolvedFiles (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:13:7)
        at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:187:31)
        at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
        at Environment.run (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
        at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:1323:58)
        at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)

        Caused by: HardhatError: HH1005: Solidity source file contracts/Interfaces/IFreezer.sol not found
            at getPathTrueCase (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/utils/source-names.ts:207:15)
            at validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/utils/source-names.ts:102:30)
            at Resolver._validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:413:7)
            at Resolver._resolveLocalSourceName (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:197:5)
            at Resolver.resolveImport (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:132:16)
            at DependencyGraph._addDependenciesFrom (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:171:26)
            at Function.createFromResolvedFiles (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:13:7)
            at SimpleTaskDefinition.action (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/builtin-tasks/compile.ts:187:31)
            at Environment._runTaskDefinition (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
            at Environment.run (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)

            Caused by: Error: [true-case-path]: Called with contracts/Interfaces/IFreezer.sol, but no matching file exists
                at matchCaseInsensitive (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/true-case-path/index.js:33:9)
                at /Users/ali/Workspace/smbazi/griz-sm-test/node_modules/true-case-path/index.js:87:7
                at iterateAsync (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/true-case-path/index.js:83:10)
                at getPathTrueCase (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/utils/source-names.ts:199:17)
                at validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/utils/source-names.ts:102:30)
                at Resolver._validateSourceNameExistenceAndCasing (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:413:7)
                at Resolver._resolveLocalSourceName (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:197:5)
                at Resolver.resolveImport (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/resolver.ts:132:16)
                at DependencyGraph._addDependenciesFrom (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:171:26)
                at Function.createFromResolvedFiles (/Users/ali/Workspace/smbazi/griz-sm-test/node_modules/hardhat/src/internal/solidity/dependencyGraph.ts:13:7)

add this file pragma solidity ^0.8.4;

interface IFreezer { struct Participant { uint256 amount; uint256 periodIndex; uint256 freezingStartTime; uint256 honeyRewardMask; uint256 bnbRewardMask; }

struct TimePeriod {
    uint256 period;
    uint256 multiplier;
}

event Freezed(address participantAddress, uint256 round, uint256 amount);
event Unfreezed(address participantAddress, uint256 round, uint256 amount);
event ClaimedRewards(
    address participantAddress,
    uint256 round,
    uint256 bnbAmount,
    uint256 honeyAmount
);

function freezerPoints(address participantAddress)
    external
    view
    returns (uint256);

function getParticipant(address participantAddress, uint256 round)
    external
    view
    returns (Participant memory participant);

function getRounds(address participantAddress)
    external
    view
    returns (uint256);

function getTimeperiod(uint256 index)
    external
    view
    returns (TimePeriod memory timePeriod);

function freeze(uint256 honeyAmount, uint256 periodIndex) external;

function unfreeze(uint256 freezingRound) external;

function claimPendingRewards(uint256 freezingRound) external;

function getPendingRewards(address freezerAddress, uint256 freezingRound)
    external
    returns (
        uint256 honeyRewards,
        uint256 bnbRewards,
        uint256 multipliedRewards
    );

}