Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require(_componentIdByName[component.getName()] == 0) #116

Open
rapidddenis opened this issue Jul 7, 2023 · 0 comments
Open

require(_componentIdByName[component.getName()] == 0) #116

rapidddenis opened this issue Jul 7, 2023 · 0 comments

Comments

@rapidddenis
Copy link

rapidddenis commented Jul 7, 2023

function propose(IComponent component)
external
onlyComponentOwnerService
{
// input validation
require(_componentIdByAddress[address(component)] == 0, "ERROR:CCR-003:COMPONENT_ALREADY_EXISTS");
require(_componentIdByName[component.getName()] == 0, "ERROR:CCR-004:COMPONENT_NAME_ALREADY_EXISTS");

Component is considered as external arbitrary contract. Better not to rely on it during require.
Ideally controller MUST read and store component data (type, name, policy flow, risk pool ID) only once and in one call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant