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

Add function to Issuer.sol to Add Synths in batches #660

Open
jacko125 opened this issue Aug 10, 2020 · 0 comments
Open

Add function to Issuer.sol to Add Synths in batches #660

jacko125 opened this issue Aug 10, 2020 · 0 comments
Assignees

Comments

@jacko125
Copy link
Contributor

Currently when Issuer.sol is upgraded and released, the Synths have to be re-added via 40+ individual transactions using addSynth per synth.

function addSynth(ISynth synth) external onlyOwner {
        bytes32 currencyKey = synth.currencyKey();

        require(synths[currencyKey] == ISynth(0), "Synth already exists");
        require(synthsByAddress[address(synth)] == bytes32(0), "Synth address already exists");

        availableSynths.push(synth);
        synths[currencyKey] = synth;
        synthsByAddress[address(synth)] = currencyKey;

        emit SynthAdded(currencyKey, address(synth));
    }

We can add a addSynths(Isynth[] synths) function to add the synths in batches on deployment cutting down the cost of deploying a new Issuer contract.

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

2 participants