mirror of
https://github.com/status-im/snt-gas-relay.git
synced 2025-02-06 11:33:28 +00:00
move nonce check as first step (gas relayer pays this gas)
This commit is contained in:
parent
789252ba97
commit
3bdba827c9
@ -38,11 +38,11 @@ contract IdentityGasRelay is Identity {
|
|||||||
)
|
)
|
||||||
external
|
external
|
||||||
{
|
{
|
||||||
|
require(_nonce == nonce);
|
||||||
uint startGas = gasleft();
|
uint startGas = gasleft();
|
||||||
require(startGas >= _gasMinimal);
|
require(startGas >= _gasMinimal);
|
||||||
uint256 requiredKey = _to == address(this) ? MANAGEMENT_KEY : ACTION_KEY;
|
uint256 requiredKey = _to == address(this) ? MANAGEMENT_KEY : ACTION_KEY;
|
||||||
require(minimumApprovalsByKeyPurpose[requiredKey] == 1);
|
require(minimumApprovalsByKeyPurpose[requiredKey] == 1);
|
||||||
require(_nonce == nonce);
|
|
||||||
nonce++;
|
nonce++;
|
||||||
|
|
||||||
bytes32 _signedHash = getSignHash(
|
bytes32 _signedHash = getSignHash(
|
||||||
@ -105,9 +105,9 @@ contract IdentityGasRelay is Identity {
|
|||||||
)
|
)
|
||||||
external
|
external
|
||||||
{
|
{
|
||||||
|
require(_nonce == nonce);
|
||||||
uint startGas = gasleft();
|
uint startGas = gasleft();
|
||||||
require(startGas >= _gasMinimal);
|
require(startGas >= _gasMinimal);
|
||||||
require(_nonce == nonce);
|
|
||||||
nonce++;
|
nonce++;
|
||||||
_callGasRelayedMultiSigned(_to, _value, _data, _nonce, _gasPrice, _gasMinimal, _gasToken, _messageSignatures);
|
_callGasRelayedMultiSigned(_to, _value, _data, _nonce, _gasPrice, _gasMinimal, _gasToken, _messageSignatures);
|
||||||
if (_gasPrice > 0) {
|
if (_gasPrice > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user