Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
俞永鹏
openzeppelin-contracts-upgradeable
Commits
54d2aec2
Commit
54d2aec2
authored
Jan 15, 2020
by
Peter
Committed by
Nicolás Venturo
Jan 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue#1980 (#2038)
* issue#1980 * fix public to external
parent
d006a750
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
IRelayHub.sol
contracts/GSN/IRelayHub.sol
+18
-18
IRelayRecipient.sol
contracts/GSN/IRelayRecipient.sol
+2
-2
No files found.
contracts/GSN/IRelayHub.sol
View file @
54d2aec2
...
@@ -7,7 +7,7 @@ pragma solidity ^0.5.0;
...
@@ -7,7 +7,7 @@ pragma solidity ^0.5.0;
* See the https://github.com/OpenZeppelin/openzeppelin-gsn-helpers[OpenZeppelin GSN helpers] for more information on
* See the https://github.com/OpenZeppelin/openzeppelin-gsn-helpers[OpenZeppelin GSN helpers] for more information on
* how to deploy an instance of `RelayHub` on your local test network.
* how to deploy an instance of `RelayHub` on your local test network.
*/
*/
contract
IRelayHub {
interface
IRelayHub {
// Relay management
// Relay management
/**
/**
...
@@ -36,7 +36,7 @@ contract IRelayHub {
...
@@ -36,7 +36,7 @@ contract IRelayHub {
*
*
* Emits a {RelayAdded} event.
* Emits a {RelayAdded} event.
*/
*/
function registerRelay(uint256 transactionFee, string
memory url) public
;
function registerRelay(uint256 transactionFee, string
calldata url) external
;
/**
/**
* @dev Emitted when a relay is registered or re-registerd. Looking at these events (and filtering out
* @dev Emitted when a relay is registered or re-registerd. Looking at these events (and filtering out
...
@@ -52,7 +52,7 @@ contract IRelayHub {
...
@@ -52,7 +52,7 @@ contract IRelayHub {
*
*
* Emits a {RelayRemoved} event.
* Emits a {RelayRemoved} event.
*/
*/
function removeRelayByOwner(address relay)
public
;
function removeRelayByOwner(address relay)
external
;
/**
/**
* @dev Emitted when a relay is removed (deregistered). `unstakeTime` is the time when unstake will be callable.
* @dev Emitted when a relay is removed (deregistered). `unstakeTime` is the time when unstake will be callable.
...
@@ -65,7 +65,7 @@ contract IRelayHub {
...
@@ -65,7 +65,7 @@ contract IRelayHub {
*
*
* Emits an {Unstaked} event.
* Emits an {Unstaked} event.
*/
*/
function unstake(address relay)
public
;
function unstake(address relay)
external
;
/**
/**
* @dev Emitted when a relay is unstaked for, including the returned stake.
* @dev Emitted when a relay is unstaked for, including the returned stake.
...
@@ -95,7 +95,7 @@ contract IRelayHub {
...
@@ -95,7 +95,7 @@ contract IRelayHub {
*
*
* Emits a {Deposited} event.
* Emits a {Deposited} event.
*/
*/
function depositFor(address target)
public
payable;
function depositFor(address target)
external
payable;
/**
/**
* @dev Emitted when {depositFor} is called, including the amount and account that was funded.
* @dev Emitted when {depositFor} is called, including the amount and account that was funded.
...
@@ -113,7 +113,7 @@ contract IRelayHub {
...
@@ -113,7 +113,7 @@ contract IRelayHub {
*
*
* Emits a {Withdrawn} event.
* Emits a {Withdrawn} event.
*/
*/
function withdraw(uint256 amount, address payable dest)
public
;
function withdraw(uint256 amount, address payable dest)
external
;
/**
/**
* @dev Emitted when an account withdraws funds from `RelayHub`.
* @dev Emitted when an account withdraws funds from `RelayHub`.
...
@@ -136,14 +136,14 @@ contract IRelayHub {
...
@@ -136,14 +136,14 @@ contract IRelayHub {
address relay,
address relay,
address from,
address from,
address to,
address to,
bytes
memory
encodedFunction,
bytes
calldata
encodedFunction,
uint256 transactionFee,
uint256 transactionFee,
uint256 gasPrice,
uint256 gasPrice,
uint256 gasLimit,
uint256 gasLimit,
uint256 nonce,
uint256 nonce,
bytes
memory
signature,
bytes
calldata
signature,
bytes
memory
approvalData
bytes
calldata
approvalData
)
public
view returns (uint256 status, bytes memory recipientContext);
)
external
view returns (uint256 status, bytes memory recipientContext);
// Preconditions for relaying, checked by canRelay and returned as the corresponding numeric values.
// Preconditions for relaying, checked by canRelay and returned as the corresponding numeric values.
enum PreconditionCheck {
enum PreconditionCheck {
...
@@ -186,14 +186,14 @@ contract IRelayHub {
...
@@ -186,14 +186,14 @@ contract IRelayHub {
function relayCall(
function relayCall(
address from,
address from,
address to,
address to,
bytes
memory
encodedFunction,
bytes
calldata
encodedFunction,
uint256 transactionFee,
uint256 transactionFee,
uint256 gasPrice,
uint256 gasPrice,
uint256 gasLimit,
uint256 gasLimit,
uint256 nonce,
uint256 nonce,
bytes
memory
signature,
bytes
calldata
signature,
bytes
memory
approvalData
bytes
calldata
approvalData
)
public
;
)
external
;
/**
/**
* @dev Emitted when an attempt to relay a call failed.
* @dev Emitted when an attempt to relay a call failed.
...
@@ -229,12 +229,12 @@ contract IRelayHub {
...
@@ -229,12 +229,12 @@ contract IRelayHub {
* @dev Returns how much gas should be forwarded to a call to {relayCall}, in order to relay a transaction that will
* @dev Returns how much gas should be forwarded to a call to {relayCall}, in order to relay a transaction that will
* spend up to `relayedCallStipend` gas.
* spend up to `relayedCallStipend` gas.
*/
*/
function requiredGas(uint256 relayedCallStipend)
public
view returns (uint256);
function requiredGas(uint256 relayedCallStipend)
external
view returns (uint256);
/**
/**
* @dev Returns the maximum recipient charge, given the amount of gas forwarded, gas price and relay fee.
* @dev Returns the maximum recipient charge, given the amount of gas forwarded, gas price and relay fee.
*/
*/
function maxPossibleCharge(uint256 relayedCallStipend, uint256 gasPrice, uint256 transactionFee)
public
view returns (uint256);
function maxPossibleCharge(uint256 relayedCallStipend, uint256 gasPrice, uint256 transactionFee)
external
view returns (uint256);
// Relay penalization.
// Relay penalization.
// Any account can penalize relays, removing them from the system immediately, and rewarding the
// Any account can penalize relays, removing them from the system immediately, and rewarding the
...
@@ -247,12 +247,12 @@ contract IRelayHub {
...
@@ -247,12 +247,12 @@ contract IRelayHub {
*
*
* The (unsigned) transaction data and signature for both transactions must be provided.
* The (unsigned) transaction data and signature for both transactions must be provided.
*/
*/
function penalizeRepeatedNonce(bytes
memory unsignedTx1, bytes memory signature1, bytes memory unsignedTx2, bytes memory signature2) public
;
function penalizeRepeatedNonce(bytes
calldata unsignedTx1, bytes calldata signature1, bytes calldata unsignedTx2, bytes calldata signature2) external
;
/**
/**
* @dev Penalize a relay that sent a transaction that didn't target `RelayHub`'s {registerRelay} or {relayCall}.
* @dev Penalize a relay that sent a transaction that didn't target `RelayHub`'s {registerRelay} or {relayCall}.
*/
*/
function penalizeIllegalTransaction(bytes
memory unsignedTx, bytes memory signature) public
;
function penalizeIllegalTransaction(bytes
calldata unsignedTx, bytes calldata signature) external
;
/**
/**
* @dev Emitted when a relay is penalized.
* @dev Emitted when a relay is penalized.
...
...
contracts/GSN/IRelayRecipient.sol
View file @
54d2aec2
...
@@ -5,11 +5,11 @@ pragma solidity ^0.5.0;
...
@@ -5,11 +5,11 @@ pragma solidity ^0.5.0;
*
*
* TIP: You don't need to write an implementation yourself! Inherit from {GSNRecipient} instead.
* TIP: You don't need to write an implementation yourself! Inherit from {GSNRecipient} instead.
*/
*/
contract
IRelayRecipient {
interface
IRelayRecipient {
/**
/**
* @dev Returns the address of the {IRelayHub} instance this recipient interacts with.
* @dev Returns the address of the {IRelayHub} instance this recipient interacts with.
*/
*/
function getHubAddr()
public
view returns (address);
function getHubAddr()
external
view returns (address);
/**
/**
* @dev Called by {IRelayHub} to validate if this recipient accepts being charged for a relayed call. Note that the
* @dev Called by {IRelayHub} to validate if this recipient accepts being charged for a relayed call. Note that the
...
...
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