Skip to content

Commit

Permalink
add external function
Browse files Browse the repository at this point in the history
  • Loading branch information
tnkshuuhei committed Sep 20, 2024
1 parent 795e1e8 commit f0371e8
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions src/CEP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,28 @@ contract CEP is Initializable, OwnableUpgradeable, AccessControlUpgradeable, Ree
voteToken = _token;
}

function _createEvaluationPool(
function createEvaluationPool(
bytes32 _profileId,
address _token,
uint256 _amount,
Metadata memory _metadata,
address[] memory _contributors
)
external
{
(uint256 poolId, Evaluation evaluation) =
_createEvaluationPool(_profileId, _token, _amount, _metadata, _contributors);
emit EvaluationCreated(poolId, address(evaluation));
}

function _createEvaluationPool(
bytes32 _profileId,
address _token,
uint256 _amount,
Metadata memory _metadata,
address[] memory _contributors
)
internal
returns (uint256 poolId, Evaluation evaluation)
{
poolId = ++evaluationCount;
Expand Down Expand Up @@ -117,11 +131,19 @@ contract CEP is Initializable, OwnableUpgradeable, AccessControlUpgradeable, Ree
_grantRole(POOL_CONTRIBUTOR_ROLE, contributor);
}

emit EvaluationCreated(poolId, address(evaluation));

return (poolId, evaluation);
}

function createEvaluation(
bytes32 _profileId,
address[] memory _contributors
)
external
returns (Evaluation evaluationAddress)
{
return _createEvaluation(_profileId, _contributors);
}

function _createEvaluation(
bytes32 _profileId,
address[] memory _contributors
Expand Down

0 comments on commit f0371e8

Please sign in to comment.