Commit aac58896 authored by Annie Ke's avatar Annie Ke Committed by Kelvin Fichter

Comply with new restrictions on explicit type conversions

parent b8e18edf
...@@ -10,6 +10,7 @@ library Lib_PredeployAddresses { ...@@ -10,6 +10,7 @@ library Lib_PredeployAddresses {
address internal constant L1_MESSAGE_SENDER = 0x4200000000000000000000000000000000000001; address internal constant L1_MESSAGE_SENDER = 0x4200000000000000000000000000000000000001;
address internal constant DEPLOYER_WHITELIST = 0x4200000000000000000000000000000000000002; address internal constant DEPLOYER_WHITELIST = 0x4200000000000000000000000000000000000002;
address payable internal constant OVM_ETH = 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000; address payable internal constant OVM_ETH = 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000;
// solhint-disable-next-line max-line-length
address internal constant L2_CROSS_DOMAIN_MESSENGER = 0x4200000000000000000000000000000000000007; address internal constant L2_CROSS_DOMAIN_MESSENGER = 0x4200000000000000000000000000000000000007;
address internal constant LIB_ADDRESS_MANAGER = 0x4200000000000000000000000000000000000008; address internal constant LIB_ADDRESS_MANAGER = 0x4200000000000000000000000000000000000008;
address internal constant PROXY_EOA = 0x4200000000000000000000000000000000000009; address internal constant PROXY_EOA = 0x4200000000000000000000000000000000000009;
......
...@@ -403,7 +403,7 @@ library Lib_RLPReader { ...@@ -403,7 +403,7 @@ library Lib_RLPReader {
"Invalid RLP address value." "Invalid RLP address value."
); );
return address(readUint256(_in)); return address(uint160(readUint256(_in)));
} }
/** /**
......
...@@ -75,6 +75,6 @@ library Lib_Bytes32Utils { ...@@ -75,6 +75,6 @@ library Lib_Bytes32Utils {
bytes32 bytes32
) )
{ {
return bytes32(uint256(_in)); return bytes32(uint256(uint160(_in)));
} }
} }
...@@ -45,7 +45,7 @@ contract TestERC20 { ...@@ -45,7 +45,7 @@ contract TestERC20 {
} }
function transferFrom(address from, address to, uint256 value) external returns (bool) { function transferFrom(address from, address to, uint256 value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) { if (allowance[from][msg.sender] != type(uint).max) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
} }
_transfer(from, to, value); _transfer(from, to, value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment