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
fab8c869
Commit
fab8c869
authored
Dec 16, 2020
by
Alina
Committed by
GitHub
Dec 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uint -> uint256 (#112)
* uint -> uint256 * indent fix
parent
ef9d1e75
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
54 deletions
+54
-54
OVM_CanonicalTransactionChain.sol
...stic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol
+1
-1
OVM_FraudContributor.sol
...mistic-ethereum/OVM/verification/OVM_FraudContributor.sol
+2
-2
iOVM_ExecutionManager.sol
...imistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol
+6
-6
iOVM_L2ToL1MessagePasser.sol
...ic-ethereum/iOVM/precompiles/iOVM_L2ToL1MessagePasser.sol
+4
-4
Lib_OVMCodec.sol
...acts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol
+5
-5
Lib_RLPWriter.sol
...racts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol
+18
-18
Helper_GasMeasurer.sol
...s/contracts/contracts/test-helpers/Helper_GasMeasurer.sol
+5
-5
TestERC20.sol
packages/contracts/contracts/test-helpers/TestERC20.sol
+12
-12
TestLib_RLPWriter.sol
...tracts/contracts/test-libraries/rlp/TestLib_RLPWriter.sol
+1
-1
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol
View file @
fab8c869
...
...
@@ -16,7 +16,7 @@ import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
library Math {
function min(uint
x, uint y) internal pure returns (uint
z) {
function min(uint
256 x, uint256 y) internal pure returns (uint256
z) {
if (x < y) {
return x;
}
...
...
packages/contracts/contracts/optimistic-ethereum/OVM/verification/OVM_FraudContributor.sol
View file @
fab8c869
...
...
@@ -10,9 +10,9 @@ abstract contract OVM_FraudContributor is Lib_AddressResolver {
/// Decorate your functions with this modifier to store how much total gas was
/// consumed by the sender, to reward users fairly
modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
uint startGas = gasleft();
uint
256
startGas = gasleft();
_;
uint gasSpent = startGas - gasleft();
uint
256
gasSpent = startGas - gasleft();
iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
}
}
packages/contracts/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol
View file @
fab8c869
...
...
@@ -29,7 +29,7 @@ interface iOVM_ExecutionManager {
PREV_EPOCH_SEQUENCER_QUEUE_GAS,
PREV_EPOCH_L1TOL2_QUEUE_GAS
}
/***********
* Structs *
***********/
...
...
@@ -91,7 +91,7 @@ interface iOVM_ExecutionManager {
function ovmGASLIMIT() external view returns (uint256 _gasLimit);
function ovmCHAINID() external view returns (uint256 _chainId);
/**********************
* L2 Context Opcodes *
**********************/
...
...
@@ -99,11 +99,11 @@ interface iOVM_ExecutionManager {
function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
/*******************
* Halting Opcodes *
*******************/
function ovmREVERT(bytes memory _data) external;
...
...
@@ -118,7 +118,7 @@ interface iOVM_ExecutionManager {
/*******************************
* Account Abstraction Opcodes *
******************************/
function ovmGETNONCE() external returns (uint256 _nonce);
function ovmSETNONCE(uint256 _nonce) external;
function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
...
...
@@ -153,7 +153,7 @@ interface iOVM_ExecutionManager {
/**************************************
* Public Functions: Execution Safety *
**************************************/
function safeCREATE(address _address, bytes memory _bytecode) external;
/***************************************
...
...
packages/contracts/contracts/optimistic-ethereum/iOVM/precompiles/iOVM_L2ToL1MessagePasser.sol
View file @
fab8c869
...
...
@@ -12,15 +12,15 @@ interface iOVM_L2ToL1MessagePasser {
**********/
event L2ToL1Message(
uint
_nonce,
address _sender,
bytes _data
uint256
_nonce,
address _sender,
bytes _data
);
/********************
* Public Functions *
********************/
function passMessageToL1(bytes calldata _message) external;
}
packages/contracts/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol
View file @
fab8c869
...
...
@@ -131,15 +131,15 @@ library Lib_OVMCodec {
{
if (_isEthSignedMessage) {
(
uint _nonce,
uint _gasLimit,
uint _gasPrice,
uint _chainId,
uint
256
_nonce,
uint
256
_gasLimit,
uint
256
_gasPrice,
uint
256
_chainId,
address _to,
bytes memory _data
) = abi.decode(
_transaction,
(uint
, uint, uint, uint
, address ,bytes)
(uint
256, uint256, uint256, uint256
, address ,bytes)
);
return EIP155Transaction({
nonce: _nonce,
...
...
packages/contracts/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol
View file @
fab8c869
...
...
@@ -94,11 +94,11 @@ library Lib_RLPWriter {
/**
* RLP encodes a uint.
* @param _in The uint to encode.
* @return _out The RLP encoded uint in bytes.
* @param _in The uint
256
to encode.
* @return _out The RLP encoded uint
256
in bytes.
*/
function writeUint(
uint _in
uint
256
_in
)
internal
pure
...
...
@@ -140,8 +140,8 @@ library Lib_RLPWriter {
* @return _encoded RLP encoded bytes.
*/
function _writeLength(
uint _len,
uint _offset
uint
256
_len,
uint
256
_offset
)
private
pure
...
...
@@ -155,8 +155,8 @@ library Lib_RLPWriter {
encoded = new bytes(1);
encoded[0] = byte(uint8(_len) + uint8(_offset));
} else {
uint lenLen;
uint i = 1;
uint
256
lenLen;
uint
256
i = 1;
while (_len / i != 0) {
lenLen++;
i *= 256;
...
...
@@ -212,16 +212,16 @@ library Lib_RLPWriter {
* @param _len Length of memory to copy.
*/
function _memcpy(
uint _dest,
uint _src,
uint _len
uint
256
_dest,
uint
256
_src,
uint
256
_len
)
private
pure
{
uint dest = _dest;
uint src = _src;
uint len = _len;
uint
256
dest = _dest;
uint
256
src = _src;
uint
256
len = _len;
for(; len >= 32; len -= 32) {
assembly {
...
...
@@ -231,7 +231,7 @@ library Lib_RLPWriter {
src += 32;
}
uint mask = 256 ** (32 - len) - 1;
uint
256
mask = 256 ** (32 - len) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
...
...
@@ -258,20 +258,20 @@ library Lib_RLPWriter {
return new bytes(0);
}
uint len;
uint i = 0;
uint
256
len;
uint
256
i = 0;
for (; i < _list.length; i++) {
len += _list[i].length;
}
bytes memory flattened = new bytes(len);
uint flattenedPtr;
uint
256
flattenedPtr;
assembly { flattenedPtr := add(flattened, 0x20) }
for(i = 0; i < _list.length; i++) {
bytes memory item = _list[i];
uint listPtr;
uint
256
listPtr;
assembly { listPtr := add(item, 0x20)}
_memcpy(flattenedPtr, listPtr, item.length);
...
...
packages/contracts/contracts/test-helpers/Helper_GasMeasurer.sol
View file @
fab8c869
...
...
@@ -7,13 +7,13 @@ contract Helper_GasMeasurer {
bytes memory _data
)
public
returns ( uint )
returns ( uint
256
)
{
uint gasBefore;
uint gasAfter;
uint
256
gasBefore;
uint
256
gasAfter;
uint calldataStart;
uint calldataLength;
uint
256
calldataStart;
uint
256
calldataLength;
assembly {
calldataStart := add(_data,0x20)
calldataLength := mload(_data)
...
...
packages/contracts/contracts/test-helpers/TestERC20.sol
View file @
fab8c869
...
...
@@ -8,43 +8,43 @@ contract TestERC20 {
string public constant name = 'Test';
string public constant symbol = 'TST';
uint8 public constant decimals = 18;
uint public totalSupply;
uint
256
public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint
256
value);
event Transfer(address indexed from, address indexed to, uint
256
value);
constructor() public {}
function mint(address to, uint value) public {
function mint(address to, uint
256
value) public {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _approve(address owner, address spender, uint value) private {
function _approve(address owner, address spender, uint
256
value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
function _transfer(address from, address to, uint
256
value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
function approve(address spender, uint
256
value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
function transfer(address to, uint
256
value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
function transferFrom(address from, address to, uint
256
value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
...
...
@@ -54,15 +54,15 @@ contract TestERC20 {
}
library SafeMath {
function add(uint
x, uint y) internal pure returns (uint
z) {
function add(uint
256 x, uint256 y) internal pure returns (uint256
z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint
x, uint y) internal pure returns (uint
z) {
function sub(uint
256 x, uint256 y) internal pure returns (uint256
z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint
x, uint y) internal pure returns (uint
z) {
function mul(uint
256 x, uint256 y) internal pure returns (uint256
z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
packages/contracts/contracts/test-libraries/rlp/TestLib_RLPWriter.sol
View file @
fab8c869
...
...
@@ -60,7 +60,7 @@ contract TestLib_RLPWriter {
}
function writeUint(
uint _in
uint
256
_in
)
public
pure
...
...
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