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

Gas Opt - issueSynths / burnSynths directly via issuer contract instead of Synthetix contract. #428

Open
jacko125 opened this issue Feb 24, 2020 · 1 comment
Assignees

Comments

@jacko125
Copy link
Contributor

jacko125 commented Feb 24, 2020

Currently Synthetix contract is permissioned to invoke issueSynths and burnSynths on issuer.sol. However these functions can be invoked directly via the issuer contract instead of jumping through Synthetix first.

Synthetix.sol

function issueSynths(uint amount) external optionalProxy {
    return issuer().issueSynths(messageSender, amount);
}

function issueMaxSynths() external optionalProxy {
    return issuer().issueMaxSynths(messageSender);
}

function burnSynths(uint amount) external optionalProxy {
    return issuer().burnSynths(messageSender, amount);
}

issuer.sol

function issueSynths(address from, uint amount)
    external
    onlySynthetix
// No need to check if price is stale, as it is checked in issuableSynths.
{

Remove or override functions for access direct via issuer.sol

modifier onlySynthetix() {
    require(msg.sender == address(synthetix()), "Issuer: Only the synthetix contract can perform this action");
    _;
}
@jjgonecrypto
Copy link
Contributor

The only problem with this is breaking any existing integrations - do we want to go this direction?

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