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

dev: chg: node upgrade #454

Open
wants to merge 8 commits into
base: jc/v0.3.1-backport
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@ name: CI

on:
push:
branches:
- develop
- master
- release-0.3-3
branches:
- main
pull_request:

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
NODE_VERSION: "16"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v2-beta
uses: actions/setup-node@v4
with:
node-version: '10.x'
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Cache npm dependencies
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ test-blockchain/data
coverage/

coverage.json

.idea
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.1.0
16.20.2
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 16.20.2
72 changes: 72 additions & 0 deletions contracts/child/BaseERC20NoSig.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
pragma solidity ^0.5.2;

import "./ChildToken.sol";

contract BaseERC20NoSig is ChildToken {
event Deposit(
address indexed token,
address indexed from,
uint256 amount,
uint256 input1,
uint256 output1
);

event Withdraw(
address indexed token,
address indexed from,
uint256 amount,
uint256 input1,
uint256 output1
);

event LogTransfer(
address indexed token,
address indexed from,
address indexed to,
uint256 amount,
uint256 input1,
uint256 input2,
uint256 output1,
uint256 output2
);

constructor() public {}

function transferWithSig(
bytes calldata sig,
uint256 amount,
bytes32 data,
uint256 expiration,
address to
) external returns (address from) {
revert("Disabled feature");
}

function balanceOf(address account) external view returns (uint256);
function _transfer(address sender, address recipient, uint256 amount)
internal;

/// @param from Address from where tokens are withdrawn.
/// @param to Address to where tokens are sent.
/// @param value Number of tokens to transfer.
/// @return Returns success of function call.
function _transferFrom(address from, address to, uint256 value)
internal
returns (bool)
{
uint256 input1 = this.balanceOf(from);
uint256 input2 = this.balanceOf(to);
_transfer(from, to, value);
emit LogTransfer(
token,
from,
to,
value,
input1,
input2,
this.balanceOf(from),
this.balanceOf(to)
);
return true;
}
}
4 changes: 1 addition & 3 deletions contracts/child/ChildERC721.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pragma solidity ^0.5.2;

import {
ERC721Full
} from "openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol";
import {ERC721Full} from "openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol";

import "./ChildToken.sol";
import "./misc/IParentToken.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/child/MRC20.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pragma solidity ^0.5.11;

import "./BaseERC20.sol";
import "./BaseERC20NoSig.sol";

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

uint256 public currentSupply = 0;
Expand Down
69 changes: 4 additions & 65 deletions contracts/common/gnosis/GnosisSafe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

pragma solidity >=0.5.0 <0.7.0;


import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol";


/// @title SelfAuthorized - authorizes current contract to perform actions
/// @author Richard Meissner - <[email protected]>
contract SelfAuthorized {
Expand Down Expand Up @@ -607,71 +611,6 @@ contract ISignatureValidator is ISignatureValidatorConstants {
}


/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
* TODO: remove once open zeppelin update to solc 0.5.0
*/
library SafeMath {

/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}

uint256 c = a * b;
require(c / a == b);

return c;
}

/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold

return c;
}

/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;

return c;
}

/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);

return c;
}

/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}

/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.
/// @author Stefan George - <[email protected]>
/// @author Richard Meissner - <[email protected]>
Expand Down
Loading
Loading