aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-06-12 22:59:51 +0800
committerGitHub <noreply@github.com>2018-06-12 22:59:51 +0800
commit2c8eca5dcfc5f961615eb1673f150d3088954a46 (patch)
tree1925dc5206efd1c3f77eb8105e4c3b4df0239bd6
parentcc62d7ce6a94a53684b60b846287782734324082 (diff)
parent99c585fd8a11ff6e10e7f59632dc060fd05065a1 (diff)
downloaddexon-solidity-2c8eca5dcfc5f961615eb1673f150d3088954a46.tar.gz
dexon-solidity-2c8eca5dcfc5f961615eb1673f150d3088954a46.tar.zst
dexon-solidity-2c8eca5dcfc5f961615eb1673f150d3088954a46.zip
Merge pull request #4265 from ethereum/remove-std
Remove obsolete 'std' directory
-rw-r--r--Changelog.md1
-rw-r--r--std/StandardToken.sol59
-rw-r--r--std/Token.sol13
-rw-r--r--std/mortal.sol10
-rw-r--r--std/owned.sol15
-rw-r--r--std/std.sol6
-rwxr-xr-xtest/cmdlineTests.sh12
7 files changed, 1 insertions, 115 deletions
diff --git a/Changelog.md b/Changelog.md
index d5b440b2..e552521e 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -13,6 +13,7 @@ Breaking Changes:
* Type Checker: Disallow arithmetic operations for Boolean variables.
* Disallow trailing dots that are not followed by a number.
* 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:
* General: Allow appending ``calldata`` keyword to types, to explicitly specify data location for arguments of external functions.
diff --git a/std/StandardToken.sol b/std/StandardToken.sol
deleted file mode 100644
index c2fc3a66..00000000
--- a/std/StandardToken.sol
+++ /dev/null
@@ -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];
- }
-}
diff --git a/std/Token.sol b/std/Token.sol
deleted file mode 100644
index 7348a8f5..00000000
--- a/std/Token.sol
+++ /dev/null
@@ -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);
-}
diff --git a/std/mortal.sol b/std/mortal.sol
deleted file mode 100644
index c43f1e4f..00000000
--- a/std/mortal.sol
+++ /dev/null
@@ -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);
- }
-}
diff --git a/std/owned.sol b/std/owned.sol
deleted file mode 100644
index 75007f3e..00000000
--- a/std/owned.sol
+++ /dev/null
@@ -1,15 +0,0 @@
-pragma solidity ^0.4.22;
-
-contract owned {
- address owner;
-
- modifier onlyowner() {
- if (msg.sender == owner) {
- _;
- }
- }
-
- constructor() public {
- owner = msg.sender;
- }
-}
diff --git a/std/std.sol b/std/std.sol
deleted file mode 100644
index 4d65bef2..00000000
--- a/std/std.sol
+++ /dev/null
@@ -1,6 +0,0 @@
-pragma solidity ^0.4.0;
-
-import "./owned.sol";
-import "./mortal.sol";
-import "./Token.sol";
-import "./StandardToken.sol";
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh
index 74b6a5a7..e8ff69de 100755
--- a/test/cmdlineTests.sh
+++ b/test/cmdlineTests.sh
@@ -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..."
"$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 printError() { echo "$(tput setaf 1)$1$(tput sgr0)"; }
@@ -113,14 +109,6 @@ do
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..."
TMPDIR=$(mktemp -d)
(