mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove obsolete 'std' directory
This commit is contained in:
parent
81c5a6e466
commit
99c585fd8a
@ -11,6 +11,7 @@ Breaking Changes:
|
|||||||
* Type Checker: Disallow arithmetic operations for Boolean variables.
|
* Type Checker: Disallow arithmetic operations for Boolean variables.
|
||||||
* Disallow trailing dots that are not followed by a number.
|
* Disallow trailing dots that are not followed by a number.
|
||||||
* Remove assembly instructions ``sha3`` and ``suicide``
|
* Remove assembly instructions ``sha3`` and ``suicide``
|
||||||
|
* Remove obsolete ``std`` directory from the Solidity repository. This means accessing ``https://github.com/ethereum/soldity/blob/develop/std/*.sol`` (or ``https://github.com/ethereum/solidity/std/*.sol`` in Remix) will not be possible.
|
||||||
|
|
||||||
Language Features:
|
Language Features:
|
||||||
* General: Allow appending ``calldata`` keyword to types, to explicitly specify data location for arguments of external functions.
|
* General: Allow appending ``calldata`` keyword to types, to explicitly specify data location for arguments of external functions.
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
pragma solidity ^0.4.22;
|
|
||||||
|
|
||||||
import "./Token.sol";
|
|
||||||
|
|
||||||
contract StandardToken is Token {
|
|
||||||
uint256 supply;
|
|
||||||
mapping (address => uint256) balance;
|
|
||||||
mapping (address =>
|
|
||||||
mapping (address => uint256)) m_allowance;
|
|
||||||
|
|
||||||
constructor(address _initialOwner, uint256 _supply) public {
|
|
||||||
supply = _supply;
|
|
||||||
balance[_initialOwner] = _supply;
|
|
||||||
}
|
|
||||||
|
|
||||||
function balanceOf(address _account) view public returns (uint) {
|
|
||||||
return balance[_account];
|
|
||||||
}
|
|
||||||
|
|
||||||
function totalSupply() view public returns (uint) {
|
|
||||||
return supply;
|
|
||||||
}
|
|
||||||
|
|
||||||
function transfer(address _to, uint256 _value) public returns (bool success) {
|
|
||||||
return doTransfer(msg.sender, _to, _value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
|
|
||||||
if (m_allowance[_from][msg.sender] >= _value) {
|
|
||||||
if (doTransfer(_from, _to, _value)) {
|
|
||||||
m_allowance[_from][msg.sender] -= _value;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function doTransfer(address _from, address _to, uint _value) internal returns (bool success) {
|
|
||||||
if (balance[_from] >= _value && balance[_to] + _value >= balance[_to]) {
|
|
||||||
balance[_from] -= _value;
|
|
||||||
balance[_to] += _value;
|
|
||||||
emit Transfer(_from, _to, _value);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function approve(address _spender, uint256 _value) public returns (bool success) {
|
|
||||||
m_allowance[msg.sender][_spender] = _value;
|
|
||||||
emit Approval(msg.sender, _spender, _value);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function allowance(address _owner, address _spender) view public returns (uint256) {
|
|
||||||
return m_allowance[_owner][_spender];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
pragma solidity ^0.4.0;
|
|
||||||
|
|
||||||
contract Token {
|
|
||||||
event Transfer(address indexed _from, address indexed _to, uint256 _value);
|
|
||||||
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
|
|
||||||
|
|
||||||
function totalSupply() view public returns (uint256 supply);
|
|
||||||
function balanceOf(address _owner) view public returns (uint256 balance);
|
|
||||||
function transfer(address _to, uint256 _value) public returns (bool success);
|
|
||||||
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
|
|
||||||
function approve(address _spender, uint256 _value) public returns (bool success);
|
|
||||||
function allowance(address _owner, address _spender) view public returns (uint256 remaining);
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
pragma solidity ^0.4.0;
|
|
||||||
|
|
||||||
import "./owned.sol";
|
|
||||||
|
|
||||||
contract mortal is owned {
|
|
||||||
function kill() public {
|
|
||||||
if (msg.sender == owner)
|
|
||||||
selfdestruct(owner);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
pragma solidity ^0.4.22;
|
|
||||||
|
|
||||||
contract owned {
|
|
||||||
address owner;
|
|
||||||
|
|
||||||
modifier onlyowner() {
|
|
||||||
if (msg.sender == owner) {
|
|
||||||
_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() public {
|
|
||||||
owner = msg.sender;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
pragma solidity ^0.4.0;
|
|
||||||
|
|
||||||
import "./owned.sol";
|
|
||||||
import "./mortal.sol";
|
|
||||||
import "./Token.sol";
|
|
||||||
import "./StandardToken.sol";
|
|
@ -37,10 +37,6 @@ FULLARGS="--optimize --ignore-missing --combined-json abi,asm,ast,bin,bin-runtim
|
|||||||
echo "Checking that the bug list is up to date..."
|
echo "Checking that the bug list is up to date..."
|
||||||
"$REPO_ROOT"/scripts/update_bugs_by_version.py
|
"$REPO_ROOT"/scripts/update_bugs_by_version.py
|
||||||
|
|
||||||
echo "Checking that StandardToken.sol, owned.sol and mortal.sol produce bytecode..."
|
|
||||||
output=$("$REPO_ROOT"/build/solc/solc --bin "$REPO_ROOT"/std/*.sol 2>/dev/null | grep "ffff" | wc -l)
|
|
||||||
test "${output//[[:blank:]]/}" = "3"
|
|
||||||
|
|
||||||
function printTask() { echo "$(tput bold)$(tput setaf 2)$1$(tput sgr0)"; }
|
function printTask() { echo "$(tput bold)$(tput setaf 2)$1$(tput sgr0)"; }
|
||||||
|
|
||||||
function printError() { echo "$(tput setaf 1)$1$(tput sgr0)"; }
|
function printError() { echo "$(tput setaf 1)$1$(tput sgr0)"; }
|
||||||
@ -113,14 +109,6 @@ do
|
|||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
||||||
printTask "Compiling all files in std and examples..."
|
|
||||||
|
|
||||||
for f in "$REPO_ROOT"/std/*.sol
|
|
||||||
do
|
|
||||||
echo "$f"
|
|
||||||
compileWithoutWarning "$f"
|
|
||||||
done
|
|
||||||
|
|
||||||
printTask "Compiling all examples from the documentation..."
|
printTask "Compiling all examples from the documentation..."
|
||||||
TMPDIR=$(mktemp -d)
|
TMPDIR=$(mktemp -d)
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user