Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit 7c0af26

Browse files
authored
Merge pull request #392 from maticnetwork/mrc-fix
fix: remove transferWithSig in MRC20
2 parents 461ee8b + 55e8118 commit 7c0af26

File tree

2 files changed

+74
-2
lines changed

2 files changed

+74
-2
lines changed

contracts/child/BaseERC20NoSig.sol

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
pragma solidity ^0.5.2;
2+
3+
import "./ChildToken.sol";
4+
5+
contract BaseERC20NoSig is ChildToken {
6+
event Deposit(
7+
address indexed token,
8+
address indexed from,
9+
uint256 amount,
10+
uint256 input1,
11+
uint256 output1
12+
);
13+
14+
event Withdraw(
15+
address indexed token,
16+
address indexed from,
17+
uint256 amount,
18+
uint256 input1,
19+
uint256 output1
20+
);
21+
22+
event LogTransfer(
23+
address indexed token,
24+
address indexed from,
25+
address indexed to,
26+
uint256 amount,
27+
uint256 input1,
28+
uint256 input2,
29+
uint256 output1,
30+
uint256 output2
31+
);
32+
33+
constructor() public {}
34+
35+
function transferWithSig(
36+
bytes calldata sig,
37+
uint256 amount,
38+
bytes32 data,
39+
uint256 expiration,
40+
address to
41+
) external returns (address from) {
42+
revert("Disabled feature");
43+
}
44+
45+
function balanceOf(address account) external view returns (uint256);
46+
function _transfer(address sender, address recipient, uint256 amount)
47+
internal;
48+
49+
/// @param from Address from where tokens are withdrawn.
50+
/// @param to Address to where tokens are sent.
51+
/// @param value Number of tokens to transfer.
52+
/// @return Returns success of function call.
53+
function _transferFrom(address from, address to, uint256 value)
54+
internal
55+
returns (bool)
56+
{
57+
uint256 input1 = this.balanceOf(from);
58+
uint256 input2 = this.balanceOf(to);
59+
_transfer(from, to, value);
60+
emit LogTransfer(
61+
token,
62+
from,
63+
to,
64+
value,
65+
input1,
66+
input2,
67+
this.balanceOf(from),
68+
this.balanceOf(to)
69+
);
70+
return true;
71+
}
72+
}

contracts/child/MRC20.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
pragma solidity ^0.5.11;
22

3-
import "./BaseERC20.sol";
3+
import "./BaseERC20NoSig.sol";
44

55
/**
66
* @title Matic token contract
77
* @notice This contract is an ECR20 like wrapper over native ether (matic token) transfers on the matic chain
88
* @dev ERC20 methods have been made payable while keeping their method signature same as other ChildERC20s on Matic
99
*/
10-
contract MRC20 is BaseERC20 {
10+
contract MRC20 is BaseERC20NoSig {
1111
event Transfer(address indexed from, address indexed to, uint256 value);
1212

1313
uint256 public currentSupply = 0;

0 commit comments

Comments
 (0)