-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
778 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!node_modules |
3 changes: 3 additions & 0 deletions
3
test/protocol/projects/truffle/my_contracts/codeAction/NoLicense.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,3 @@ | ||
pragma solidity 0.8.8; | ||
|
||
contract Foo {} |
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 @@ | ||
import ''; |
Empty file.
Empty file.
57 changes: 57 additions & 0 deletions
57
test/protocol/projects/truffle/my_contracts/definition/Test.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,57 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.8; | ||
|
||
interface ABV { | ||
function giveVote(address voter) external; | ||
function delegate(address to) external; | ||
} | ||
|
||
contract Test is ABV { | ||
struct Voter { | ||
bool voted; | ||
address delegate; | ||
} | ||
|
||
mapping(address => Voter) public voters; | ||
Proposal[] public proposals; | ||
|
||
constructor(bytes32[] memory proposalNames) { | ||
Proposal memory p; | ||
for (uint i = 0; i < proposalNames.length; i++) { | ||
( p, ) = newProposalAndVoter(proposalNames[i], false, msg.sender); | ||
proposals.push(p); | ||
} | ||
} | ||
|
||
function giveVote(address voter) public virtual override { | ||
voters[voter].voted = true; | ||
} | ||
|
||
function giveVoteAndDelegate(address voter, address to) public { | ||
giveVote(voter); | ||
delegate(to); | ||
} | ||
|
||
function delegate(address to) public virtual override { | ||
voters[msg.sender].delegate = to; | ||
} | ||
|
||
function newProposalAndVoter(bytes32 name, bool voted, address delegateTo) public pure returns (Proposal memory p, Voter memory v) { | ||
p = Proposal({ | ||
name: name | ||
}); | ||
|
||
v = Voter({ | ||
voted: voted, | ||
delegate: delegateTo | ||
}); | ||
} | ||
|
||
function getLastProposalName() public view returns (bytes32 name) { | ||
name = proposals[proposals.length - 1].name; | ||
} | ||
|
||
struct Proposal { | ||
bytes32 name; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
test/protocol/projects/truffle/my_contracts/diagnostics/ImportNonexistent.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 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity 0.8.8; | ||
|
||
import './NonExistent.sol'; | ||
|
||
contract Foo {} |
6 changes: 6 additions & 0 deletions
6
test/protocol/projects/truffle/my_contracts/diagnostics/MissingSemicolon.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,6 @@ | ||
// SPDX-License-Identifier: SEE LICENSE IN LICENSE | ||
pragma solidity 0.8.8; | ||
|
||
contract Foo { | ||
string public name = "Foo" | ||
} |
57 changes: 57 additions & 0 deletions
57
test/protocol/projects/truffle/my_contracts/implementation/Test.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,57 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.8; | ||
|
||
interface ABV { | ||
function giveVote(address voter) external; | ||
function delegate(address to) external; | ||
} | ||
|
||
contract Test is ABV { | ||
struct Voter { | ||
bool voted; | ||
address delegate; | ||
} | ||
|
||
mapping(address => Voter) public voters; | ||
Proposal[] public proposals; | ||
|
||
constructor(bytes32[] memory proposalNames) { | ||
Proposal memory p; | ||
for (uint i = 0; i < proposalNames.length; i++) { | ||
( p, ) = newProposalAndVoter(proposalNames[i], false, msg.sender); | ||
proposals.push(p); | ||
} | ||
} | ||
|
||
function giveVote(address voter) public virtual override { | ||
voters[voter].voted = true; | ||
} | ||
|
||
function giveVoteAndDelegate(address voter, address to) public { | ||
giveVote(voter); | ||
delegate(to); | ||
} | ||
|
||
function delegate(address to) public virtual override { | ||
voters[msg.sender].delegate = to; | ||
} | ||
|
||
function newProposalAndVoter(bytes32 name, bool voted, address delegateTo) public pure returns (Proposal memory p, Voter memory v) { | ||
p = Proposal({ | ||
name: name | ||
}); | ||
|
||
v = Voter({ | ||
voted: voted, | ||
delegate: delegateTo | ||
}); | ||
} | ||
|
||
function getLastProposalName() public view returns (bytes32 name) { | ||
name = proposals[proposals.length - 1].name; | ||
} | ||
|
||
struct Proposal { | ||
bytes32 name; | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
test/protocol/projects/truffle/my_contracts/references/Test.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,57 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.8; | ||
|
||
interface ABV { | ||
function giveVote(address voter) external; | ||
function delegate(address to) external; | ||
} | ||
|
||
contract Test is ABV { | ||
struct Voter { | ||
bool voted; | ||
address delegate; | ||
} | ||
|
||
mapping(address => Voter) public voters; | ||
Proposal[] public proposals; | ||
|
||
constructor(bytes32[] memory proposalNames) { | ||
Proposal memory p; | ||
for (uint i = 0; i < proposalNames.length; i++) { | ||
( p, ) = newProposalAndVoter(proposalNames[i], false, msg.sender); | ||
proposals.push(p); | ||
} | ||
} | ||
|
||
function giveVote(address voter) public virtual override { | ||
voters[voter].voted = true; | ||
} | ||
|
||
function giveVoteAndDelegate(address voter, address to) public { | ||
giveVote(voter); | ||
delegate(to); | ||
} | ||
|
||
function delegate(address to) public virtual override { | ||
voters[msg.sender].delegate = to; | ||
} | ||
|
||
function newProposalAndVoter(bytes32 name, bool voted, address delegateTo) public pure returns (Proposal memory p, Voter memory v) { | ||
p = Proposal({ | ||
name: name | ||
}); | ||
|
||
v = Voter({ | ||
voted: voted, | ||
delegate: delegateTo | ||
}); | ||
} | ||
|
||
function getLastProposalName() public view returns (bytes32 name) { | ||
name = proposals[proposals.length - 1].name; | ||
} | ||
|
||
struct Proposal { | ||
bytes32 name; | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
test/protocol/projects/truffle/my_contracts/rename/Test.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,57 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.8; | ||
|
||
interface ABV { | ||
function giveVote(address voter) external; | ||
function delegate(address to) external; | ||
} | ||
|
||
contract Test is ABV { | ||
struct Voter { | ||
bool voted; | ||
address delegate; | ||
} | ||
|
||
mapping(address => Voter) public voters; | ||
Proposal[] public proposals; | ||
|
||
constructor(bytes32[] memory proposalNames) { | ||
Proposal memory p; | ||
for (uint i = 0; i < proposalNames.length; i++) { | ||
( p, ) = newProposalAndVoter(proposalNames[i], false, msg.sender); | ||
proposals.push(p); | ||
} | ||
} | ||
|
||
function giveVote(address voter) public virtual override { | ||
voters[voter].voted = true; | ||
} | ||
|
||
function giveVoteAndDelegate(address voter, address to) public { | ||
giveVote(voter); | ||
delegate(to); | ||
} | ||
|
||
function delegate(address to) public virtual override { | ||
voters[msg.sender].delegate = to; | ||
} | ||
|
||
function newProposalAndVoter(bytes32 name, bool voted, address delegateTo) public pure returns (Proposal memory p, Voter memory v) { | ||
p = Proposal({ | ||
name: name | ||
}); | ||
|
||
v = Voter({ | ||
voted: voted, | ||
delegate: delegateTo | ||
}); | ||
} | ||
|
||
function getLastProposalName() public view returns (bytes32 name) { | ||
name = proposals[proposals.length - 1].name; | ||
} | ||
|
||
struct Proposal { | ||
bytes32 name; | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
test/protocol/projects/truffle/my_contracts/typedefinition/Test.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,57 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.8; | ||
|
||
interface ABV { | ||
function giveVote(address voter) external; | ||
function delegate(address to) external; | ||
} | ||
|
||
contract Test is ABV { | ||
struct Voter { | ||
bool voted; | ||
address delegate; | ||
} | ||
|
||
mapping(address => Voter) public voters; | ||
Proposal[] public proposals; | ||
|
||
constructor(bytes32[] memory proposalNames) { | ||
Proposal memory p; | ||
for (uint i = 0; i < proposalNames.length; i++) { | ||
( p, ) = newProposalAndVoter(proposalNames[i], false, msg.sender); | ||
proposals.push(p); | ||
} | ||
} | ||
|
||
function giveVote(address voter) public virtual override { | ||
voters[voter].voted = true; | ||
} | ||
|
||
function giveVoteAndDelegate(address voter, address to) public { | ||
giveVote(voter); | ||
delegate(to); | ||
} | ||
|
||
function delegate(address to) public virtual override { | ||
voters[msg.sender].delegate = to; | ||
} | ||
|
||
function newProposalAndVoter(bytes32 name, bool voted, address delegateTo) public pure returns (Proposal memory p, Voter memory v) { | ||
p = Proposal({ | ||
name: name | ||
}); | ||
|
||
v = Voter({ | ||
voted: voted, | ||
delegate: delegateTo | ||
}); | ||
} | ||
|
||
function getLastProposalName() public view returns (bytes32 name) { | ||
name = proposals[proposals.length - 1].name; | ||
} | ||
|
||
struct Proposal { | ||
bytes32 name; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
test/protocol/projects/truffle/node_modules/@openzeppelin/contracts/utils/Context.sol
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,11 @@ | ||
module.exports = { | ||
contracts_directory: 'my_contracts', | ||
compilers: { | ||
solc: { | ||
version: '0.8.8', // Fetch exact version from solc-bin | ||
// settings: { | ||
// remappings: ["oz=node_modules/@openzeppelin"], | ||
// }, | ||
}, | ||
}, | ||
} |
Oops, something went wrong.