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

Enable calls to external library functions #13

Closed
charles-liu opened this issue Jan 10, 2022 · 0 comments
Closed

Enable calls to external library functions #13

charles-liu opened this issue Jan 10, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@charles-liu
Copy link
Contributor

library D 
{ 
    function double(uint self) public returns (uint) { 
        // do something with side effects
        return 2*self;
    }
}

contract C {
    using D for uint;
    function f(uint a) public returns (uint) {
        return a.double();
    }
}
// ----
// Warning 2018: (12-79): Function state mutability can be restricted to pure

This is a test case from Solidity. We assume that double function will do something with side effects to modify the storage of C, so it’s not declared as internal pure.
It is not possible both in Solidity++ 0.4 or 0.8, because the DELEGATECALL instruction is not implemented on Vite VM and some functionalities of libraries are disabled in the compiler.

@charles-liu charles-liu added the enhancement New feature or request label Jan 10, 2022
@charles-liu charles-liu self-assigned this Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant