-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* transpile library deployment * initial library test passing * add missing closeOVM * library test passing * lint * add multi-lib test * lint, test timeout * commit just transpiler hotfix * make test use previously problematic val * clean * lint * PR feedback * fixing lint issues Co-authored-by: Will Meister <[email protected]>
- Loading branch information
1 parent
403ce04
commit a896fce
Showing
19 changed files
with
584 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/rollup-dev-tools/test/contracts/library-transpilation/SafeMathUser.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pragma solidity ^0.5.0; | ||
|
||
import {SimpleSafeMath} from './SimpleSafeMath.sol'; | ||
|
||
contract SafeMathUser { | ||
function use() public returns (uint) { | ||
return SimpleSafeMath.addUint(2, 3); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/rollup-dev-tools/test/contracts/library-transpilation/SimpleSafeMath.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
pragma solidity ^0.5.0; | ||
|
||
library SimpleSafeMath { | ||
|
||
function subUint(uint a, uint b) public returns(uint){ | ||
|
||
require(a >= b); // Make sure it doesn't return a negative value. | ||
return a - b; | ||
|
||
} | ||
function addUint(uint a , uint b) public pure returns(uint){ | ||
|
||
uint c = a + b; | ||
|
||
require(c >= a); // Makre sure the right computation was made | ||
return c; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.