Skip to content

Commit

Permalink
Merge pull request #17 from mysteriumnetwork/improvement/bump-zepelli…
Browse files Browse the repository at this point in the history
…n-version

Improvement/bump zepellin version
  • Loading branch information
tadovas authored Dec 20, 2018
2 parents a7aaab0 + 48f9603 commit b92116b
Show file tree
Hide file tree
Showing 185 changed files with 6,927 additions and 6,059 deletions.
653 changes: 533 additions & 120 deletions balances/abigen_balances.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/IdentityBalances.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract IdentityBalances is ERC20Aware {

function internalTransfer(address from, address to, uint256 amount) internal returns(uint256) {
require(amount > 0);
uint256 minAvailable = Math.min256(balances[from],amount);
uint256 minAvailable = Math.min(balances[from],amount);
balances[from] = balances[from] - minAvailable;
balances[to] = balances[to] + minAvailable;
return minAvailable;
Expand Down
4 changes: 2 additions & 2 deletions contracts/MystToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ pragma solidity ^0.4.23;
//The purpose of this contract is to have sample ERC20 a la "MYST" compatible mintable token
//for testing purposes of ERC20 interactions, actually we can use MintableToken directly,
//but for the sake of demonstrating that any compatible token will do
import "./deps/OpenZeppelin/contracts/token/ERC20/MintableToken.sol";
import "./deps/OpenZeppelin/contracts/token/ERC20/ERC20Mintable.sol";


contract MystToken is MintableToken {
contract MystToken is ERC20Mintable {

}
2 changes: 1 addition & 1 deletion contracts/abigen/gen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package abigen

//go:generate abigen --sol ../IdentityPromises.sol --pkg abigen --out payments.go -exc ../Utils.sol:Utils,../deps/OpenZeppelin/contracts/ownership/Ownable.sol:Ownable,../deps/OpenZeppelin/contracts/math/Math.sol:Math,../deps/OpenZeppelin/contracts/token/ERC20/ERC20Basic.sol:ERC20Basic,../ERC20Aware.sol:ERC20Aware,../deps/OpenZeppelin/contracts/token/ERC20/ERC20.sol:ERC20,../IdentityRegistry.sol:IdentityRegistry,../IdentityBalances.sol:IdentityBalances
//go:generate abigen --sol ../IdentityPromises.sol --pkg abigen --out payments.go -exc ../Utils.sol:Utils,../deps/OpenZeppelin/contracts/ownership/Ownable.sol:Ownable,../deps/OpenZeppelin/contracts/math/SafeMath.sol:SafeMath,../deps/OpenZeppelin/contracts/math/Math.sol:Math,../deps/OpenZeppelin/contracts/token/ERC20/ERC20Basic.sol:ERC20Basic,../ERC20Aware.sol:ERC20Aware,../deps/OpenZeppelin/contracts/token/ERC20/IERC20.sol:IERC20,../deps/OpenZeppelin/contracts/token/ERC20/ERC20.sol:ERC20,../IdentityRegistry.sol:IdentityRegistry,../IdentityBalances.sol:IdentityBalances
51 changes: 49 additions & 2 deletions contracts/abigen/payments.go

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions contracts/deps/OpenZeppelin/README

This file was deleted.

27 changes: 27 additions & 0 deletions contracts/deps/OpenZeppelin/contracts/ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Architecture

The following provides visibility into how OpenZeppelin's contracts are organized:

- **access** - Smart contracts that enable functionality that can be used for selective restrictions and basic authorization control functions.
- **crowdsale** - A collection of smart contracts used to manage token crowdsales that allow investors to purchase tokens with ETH. Includes a base contract which implements fundamental crowdsale functionality in its simplest form. The base contract can be extended in order to satisfy your crowdsale’s specific requirements.
- **distribution** - Includes extensions of the base crowdsale contract which can be used to customize the completion of a crowdsale.
- **emission** - Includes extensions of the base crowdsale contract which can be used to mint and manage how tokens are issued to purchasers.
- **price** - Includes extensions of the crowdsale contract that can be used to manage changes in token prices.
- **validation** - Includes extensions of the crowdsale contract that can be used to enforce restraints and limit access to token purchases.
- **examples** - A collection of simple smart contracts that demonstrate how to add new features to base contracts through multiple inheritance.
- **introspection** - An interface that can be used to make a contract comply with the ERC-165 standard as well as a contract that implements ERC-165 using a lookup table.
- **lifecycle** - A collection of base contracts used to manage the existence and behavior of your contracts and their funds.
- **math** - Libraries with safety checks on operations that throw on errors.
- **mocks** - A collection of abstract contracts that are primarily used for unit testing. They also serve as good usage examples and demonstrate how to combine contracts with inheritance when developing your own custom applications.
- **ownership** - A collection of smart contracts that can be used to manage contract and token ownership
- **payment** - A collection of smart contracts that can be used to manage payments through escrow arrangements, withdrawals, and claims. Includes support for both single payees and multiple payees.
- **proposals** - A collection of smart contracts that reflect community Ethereum Improvement Proposals (EIPs). These contracts are under development and standardization. They are not recommended for production, but they are useful for experimentation with pending EIP standards. Go [here](https://github.com/OpenZeppelin/openzeppelin-solidity/wiki/ERC-Process) for more information.

- **token** - A collection of approved ERC standard tokens -- their interfaces and implementations.
- **ERC20** - A standard interface for fungible tokens:
- *Interfaces* - Includes the ERC-20 token standard basic interface. I.e., what the contract’s ABI can represent.
- *Implementations* - Includes ERC-20 token implementations that include all required and some optional ERC-20 functionality.
- **ERC721** - A standard interface for non-fungible tokens
- *Interfaces* - Includes the ERC-721 token standard basic interface. I.e., what the contract’s ABI can represent.
- *Implementations* - Includes ERC-721 token implementations that include all required and some optional ERC-721 functionality.

72 changes: 0 additions & 72 deletions contracts/deps/OpenZeppelin/contracts/Bounty.sol

This file was deleted.

75 changes: 0 additions & 75 deletions contracts/deps/OpenZeppelin/contracts/DayLimit.sol

This file was deleted.

31 changes: 0 additions & 31 deletions contracts/deps/OpenZeppelin/contracts/LimitBalance.sol

This file was deleted.

35 changes: 0 additions & 35 deletions contracts/deps/OpenZeppelin/contracts/MerkleProof.sol

This file was deleted.

32 changes: 0 additions & 32 deletions contracts/deps/OpenZeppelin/contracts/ReentrancyGuard.sol

This file was deleted.

44 changes: 44 additions & 0 deletions contracts/deps/OpenZeppelin/contracts/access/Roles.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
pragma solidity ^0.4.24;

/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}

/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));

role.bearer[account] = true;
}

/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));

role.bearer[account] = false;
}

/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account)
internal
view
returns (bool)
{
require(account != address(0));
return role.bearer[account];
}
}
Loading

0 comments on commit b92116b

Please sign in to comment.