-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle libraries with call protection (#1000)
* #996 handle libraries with call protection * #996 add tests for call protection * legacy compilation placeholder test case * via-IR test case
- Loading branch information
1 parent
3f435a5
commit b84e466
Showing
8 changed files
with
138 additions
and
0 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
4 changes: 4 additions & 0 deletions
4
packages/lib-sourcify/test/sources/CallProtectionForLibraries/artifact.json
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,4 @@ | ||
{ | ||
"abi": [], | ||
"bytecode": "0x60bd610039600b82828239805160001a60731461002c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060335760003560e01c8063fe073d11146038575b600080fd5b818015604357600080fd5b50604a604c565b005b60006057600182605b565b5050565b60ff8181168382160190811115608157634e487b7160e01b600052601160045260246000fd5b9291505056fea264697066735822122026efb28b74c882aa2f1f86cbe51d40fba727849fa6113630f5c12c98c1a9eb9b64736f6c63430008130033" | ||
} |
27 changes: 27 additions & 0 deletions
27
packages/lib-sourcify/test/sources/CallProtectionForLibraries/metadata.json
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,27 @@ | ||
{ | ||
"compiler": { "version": "0.8.19+commit.7dd6d404" }, | ||
"language": "Solidity", | ||
"output": { | ||
"abi": [], | ||
"devdoc": { "kind": "dev", "methods": {}, "version": 1 }, | ||
"userdoc": { "kind": "user", "methods": {}, "version": 1 } | ||
}, | ||
"settings": { | ||
"compilationTarget": { "Ballot.sol": "Ballot" }, | ||
"evmVersion": "paris", | ||
"libraries": {}, | ||
"metadata": { "bytecodeHash": "ipfs" }, | ||
"optimizer": { "enabled": true, "runs": 200 }, | ||
"remappings": [] | ||
}, | ||
"sources": { | ||
"Ballot.sol": { | ||
"keccak256": "0x21d251aa06c7fcbb362bca4b1645ef4fbc3d0844f6774f4598588f9045fdfe97", | ||
"urls": [ | ||
"bzz-raw://7464b55b34107bd79040fa11eed489e2d20bde5e15b801e2ba144d7bd10bbeca", | ||
"dweb:/ipfs/Qmbrd7Up3r6Q5JA9NMvZZawsJ5EuuoFfRuMBEjAYk7oDod" | ||
] | ||
} | ||
}, | ||
"version": 1 | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/lib-sourcify/test/sources/CallProtectionForLibraries/sources/Ballot.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,7 @@ | ||
pragma solidity 0.8.19; | ||
library Ballot { | ||
function giveRightToVote() public { | ||
uint8 tempnumber = 0; | ||
tempnumber += 1; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/lib-sourcify/test/sources/CallProtectionForLibrariesViaIR/artifact.json
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,4 @@ | ||
{ | ||
"abi": [], | ||
"bytecode": "0x60808060405234601a57608d90816100208239308160240152f35b600080fdfe6004361015600c57600080fd5b6000803560e01c63fe073d1114602157600080fd5b307f0000000000000000000000000000000000000000000000000000000000000000146054578060031936011260545780f35b80fdfea26469706673582212201104b959cf92e8eead2cb6513fe1d88ee97c7b264a0dea0bd7ccaffd488db72764736f6c63430008130033" | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/lib-sourcify/test/sources/CallProtectionForLibrariesViaIR/metadata.json
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,28 @@ | ||
{ | ||
"compiler": { "version": "0.8.19+commit.7dd6d404" }, | ||
"language": "Solidity", | ||
"output": { | ||
"abi": [], | ||
"devdoc": { "kind": "dev", "methods": {}, "version": 1 }, | ||
"userdoc": { "kind": "user", "methods": {}, "version": 1 } | ||
}, | ||
"settings": { | ||
"compilationTarget": { "Ballot.sol": "Ballot" }, | ||
"evmVersion": "paris", | ||
"libraries": {}, | ||
"metadata": { "bytecodeHash": "ipfs" }, | ||
"optimizer": { "enabled": true, "runs": 200 }, | ||
"remappings": [], | ||
"viaIR": true | ||
}, | ||
"sources": { | ||
"Ballot.sol": { | ||
"keccak256": "0x21d251aa06c7fcbb362bca4b1645ef4fbc3d0844f6774f4598588f9045fdfe97", | ||
"urls": [ | ||
"bzz-raw://7464b55b34107bd79040fa11eed489e2d20bde5e15b801e2ba144d7bd10bbeca", | ||
"dweb:/ipfs/Qmbrd7Up3r6Q5JA9NMvZZawsJ5EuuoFfRuMBEjAYk7oDod" | ||
] | ||
} | ||
}, | ||
"version": 1 | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/lib-sourcify/test/sources/CallProtectionForLibrariesViaIR/sources/Ballot.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,7 @@ | ||
pragma solidity 0.8.19; | ||
library Ballot { | ||
function giveRightToVote() public { | ||
uint8 tempnumber = 0; | ||
tempnumber += 1; | ||
} | ||
} |
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