Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
50db0484
Commit
50db0484
authored
Mar 10, 2022
by
m4rio.eth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced transfer with call for sending ETH so it can support also non-EOA
parent
a22c36eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Challenge.sol
contracts/Challenge.sol
+5
-3
No files found.
contracts/Challenge.sol
View file @
50db0484
...
@@ -49,8 +49,9 @@ contract Challenge {
...
@@ -49,8 +49,9 @@ contract Challenge {
fallback() external payable {}
fallback() external payable {}
receive() external payable {}
receive() external payable {}
function withdraw() external {
function withdraw() external {
require(msg.sender == owner);
require(msg.sender == owner, "not owner");
owner.transfer(address(this).balance);
(bool sent, ) = owner.call{value: address(this).balance}("");
require(sent, "Failed to send Ether");
}
}
// create challenge
// create challenge
...
@@ -214,7 +215,8 @@ contract Challenge {
...
@@ -214,7 +215,8 @@ contract Challenge {
require(stepState == c.assertedState[c.R], "wrong asserted state for challenger");
require(stepState == c.assertedState[c.R], "wrong asserted state for challenger");
// pay out bounty!!
// pay out bounty!!
c.challenger.transfer(address(this).balance);
(bool sent, ) = c.challenger.call{value: address(this).balance}("");
require(sent, "Failed to send Ether");
emit ChallengerWins(challengeId);
emit ChallengerWins(challengeId);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment