From 6cec01f8f0e669b08e16362c4c234a4ac7347cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kru=CC=88ger?= Date: Fri, 15 Dec 2017 11:25:53 +0100 Subject: [PATCH] bridge.sol: mark pure functions as pure to get to 0 solc compiliation warnings --- contracts/bridge.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/bridge.sol b/contracts/bridge.sol index cb94c51..8cfc08d 100644 --- a/contracts/bridge.sol +++ b/contracts/bridge.sol @@ -2,7 +2,7 @@ pragma solidity ^0.4.15; library Authorities { - function contains (address[] self, address value) internal returns (bool) { + function contains (address[] self, address value) internal pure returns (bool) { for (uint i = 0; i < self.length; i++) { if (self[i] == value) { return true; @@ -15,14 +15,14 @@ library Authorities { /// Library used only to test Signer library via rpc calls library SignerTest { - function signer (bytes signature, bytes message) public constant returns (address) { + function signer (bytes signature, bytes message) public pure returns (address) { return Signer.signer(signature, message); } } library Utils { - function toString (uint256 v) internal returns (string str) { + function toString (uint256 v) internal pure returns (string str) { // it is used only for small numbers bytes memory reversed = new bytes(8); uint i = 0; @@ -41,7 +41,7 @@ library Utils { library Signer { - function signer (bytes signature, bytes message) internal returns (address) { + function signer (bytes signature, bytes message) internal pure returns (address) { require(signature.length == 65); bytes32 r; bytes32 s; @@ -55,7 +55,7 @@ library Signer { return ecrecover(hash(message), uint8(v), r, s); } - function hash (bytes message) internal returns (bytes32) { + function hash (bytes message) internal pure returns (bytes32) { bytes memory prefix = "\x19Ethereum Signed Message:\n"; return keccak256(prefix, Utils.toString(message.length), message); }