Fix `ERC721._beforeTokenTransfer` docs (#2653)

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping (uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping (address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping (uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping (address => mapping (address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC721).interfaceId
            || interfaceId == type(IERC721Metadata).interfaceId
            || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0
            ? string(abi.encodePacked(baseURI, tokenId.toString()))
            : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. Empty by default, can be overriden
     * in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
        _mint(to, tokenId);
        require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        private returns (bool)
    {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    // solhint-disable-next-line no-inline-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping (uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping (address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping (uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping (address => mapping (address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC721).interfaceId
            || interfaceId == type(IERC721Metadata).interfaceId
            || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0
            ? string(abi.encodePacked(baseURI, tokenId.toString()))
            : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. Empty by default, can be overriden
     * in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
        _mint(to, tokenId);
        require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        private returns (bool)
    {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    // solhint-disable-next-line no-inline-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}


Clean Arrays e mapping de pokemons

Clean Arrays e mapping de pokemons

// Pokemon create template: 1,500,40,"at1",1,"at2",500
// owner "0xca35b7d915458ef540ade6068dfe2f44e8fa733c"

contract owned {
    address public owner;
    address public market;

    function owned() {
        owner = msg.sender;
    }

    modifier onlyOwner {
        if (msg.sender != owner) throw;
        _
    }

    modifier Market {
        if (msg.sender != market || msg.sender != owner) throw;
        _
    }

    function transferOwnership(address newOwner) onlyOwner {
        owner = newOwner;
    }

    function updateMarket(address newMarket) onlyOwner {
        market = newMarket;
    }
}

contract IssuePokemon is owned {

    uint256 public totalPokemonSupply;
    address public marketAddress;

    Pokemon[] public pokemons;
    PokemonMaster[] public pokeMasters;

    mapping (uint256 => address) public pokemonToMaster;
    mapping (address => uint256) public pokeOwnerIndex;
    mapping (uint => uint256) public pokemonIndex;
    mapping (address => uint256) public totalPokemonsFromMaster;
    mapping (address => uint256[]) public balanceOf;

    struct Pokemon {
        uint pokeNumber;
        string pokeName;
        string pokeType;
        uint pokeCP;
        uint pokeHP;
        //string pokeAttack;
        //uint pokeAttackPower;
        //string pokeSpecial;
        //uint pokeSpecialPower;
        bytes32 pokemonHash;
        address pokeOwner;
    }

    struct PokemonMaster {
        address pokeMaster;
        uint[] pokemons;
    }

    string[][] public pokemonNameTypes = [["Pokemon 0", "invalid"], ["Bulbassauro", "Grass/Poison"], ["Charmander", "Fire"], ["Squirtle","Water"], ["Pikachu","Eletric"]]; // nÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ£o aceita bytes

    /* This generates a public event on the blockchain that will notify clients */
    event Transfer(address from, address to, uint256 value);
    event CreatePokemon(uint id, string name, uint cp, uint hp );
    event UpdatePokemon(uint id, string name, uint cp, uint hp );
    event UpdateMasterPokemons(address owner, uint total);
    event Log1(uint number);
    event Log2(string message);

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function IssuePokemon() {
        owner = msg.sender;
        newPokemonMaster(owner);                            // Todos pokemons serao criados para este owner
        newPokemon(0,0,0);                                  // Pokemon Índice 0
        totalPokemonSupply-=1;                              // Ajusta o total de pokemons porque o primeiro é fake

        /* Criacao de pokemons iniciais */
        newPokemon(3,500,40);
        newPokemon(1,535,70);
        newPokemon(4,546,80);
        newPokemon(2,557,90);

    }

    //function newPokemon(uint pokemonNumber, uint cp, uint hp, string attack, uint attackPower, string special, uint specialPower ) returns (bool success) { // cp e hp fornecidos por https://api.random.org/json-rpc/1/basic
    function newPokemon(uint pokemonNumber, uint cp, uint hp )  returns (bool success) { // cp e hp fornecidos por https://api.random.org/json-rpc/1/basic
        address owner = msg.sender;
        uint pokemonID = pokemons.length++;
        Pokemon p = pokemons[pokemonID];
        p.pokeNumber = pokemonNumber;
        p.pokeName = pokemonNameTypes[pokemonNumber][0];
        p.pokeType = pokemonNameTypes[pokemonNumber][1];
        p.pokeCP = cp;
        p.pokeHP = hp;
        //p.pokeAttack = attack;
        //p.pokeAttackPower = attackPower;
        //p.pokeSpecial = special;
        //p.pokeSpecialPower = specialPower;

        //p.pokemonHash = sha3(p.pokeNumber,p.pokeName,p.pokeType,p.pokeCP,p.pokeHP, p.pokeAttack, p.pokeAttackPower, p.pokeSpecial, p.pokeSpecialPower);
        p.pokemonHash = sha3(p.pokeNumber,p.pokeName,p.pokeType,p.pokeCP,p.pokeHP);
        p.pokeOwner = owner;
        pokemonIndex[pokemonNumber] = pokemonID;
        pokemonToMaster[pokemonID] = owner;
        addPokemonToMaster(owner, pokemonID);

        totalPokemonSupply += 1;
        CreatePokemon(pokemonID, p.pokeName, p.pokeCP, p.pokeHP);
        return true;
    }

    function updatePokemon(uint _pokemonNumber, uint _cp, uint _hp )  returns (bool success) {
        uint pokemonID = pokemonIndex[_pokemonNumber];
        Pokemon p = pokemons[pokemonID];
        p.pokeCP = _cp;
        p.pokeHP = _hp;
        //p.pokeAttack = attack;
        //p.pokeAttackPower = attackPower;
        //p.pokeSpecial = special;
        //p.pokeSpecialPower = specialPower;

        //p.pokemonHash = sha3(p.pokeNumber,p.pokeName,p.pokeType,p.pokeCP,p.pokeHP, p.pokeAttack, p.pokeAttackPower, p.pokeSpecial, p.pokeSpecialPower);
        p.pokemonHash = sha3(p.pokeNumber,p.pokeName,p.pokeType,p.pokeCP,p.pokeHP);

        UpdatePokemon(pokemonID, p.pokeName, p.pokeCP, p.pokeHP);
        return true;

    }

    function newPokemonMaster(address pokemonMaster)  returns (bool success) {
        uint ownerID = pokeMasters.length++;
        PokemonMaster o = pokeMasters[ownerID];
        o.pokeMaster = pokemonMaster;
        pokeOwnerIndex[pokemonMaster] = ownerID;
        return true;
    }

    function transferPokemon(address _from, address _to, uint256 _pokemonID)   returns (uint pokemonID, address from, address to) {
        Pokemon p = pokemons[_pokemonID];
        if (p.pokeOwner != _from) throw;
        if (pokeOwnerIndex[_to] == 0 && _to != pokemonToMaster[0] ) newPokemonMaster(_to);
        // Construir controle de acesso somente para o owner
        p.pokeOwner = _to;
        pokemonToMaster[_pokemonID] = _to;
        delPokemonFromMaster(_from, _pokemonID);
        addPokemonToMaster(_to, _pokemonID);
        Transfer(_from, _to, _pokemonID);
        return (_pokemonID, _from, _to);
    }

    function addPokemonToMaster(address _pokemonOwner, uint256 _pokemonID) internal returns (address pokeOwner, uint[] pokemons, uint pokemonsTotal) {
        uint ownerID = pokeOwnerIndex[_pokemonOwner];
        PokemonMaster o = pokeMasters[ownerID];
        uint[] pokeList = o.pokemons;

        // o.pokemons.push(_pokemonID);
        // usando .push ele adiciona 0,_pokemonID

        // Ao invés de simplesmente adicionar um pokemon ao final da lista,
        // verifica se há slot zerado no array, senao adiciona ao final
        bool slot;
        for (uint i=0; i < pokeList.length; i++){
            if (pokeList[i] == 0){
                slot = true;
                break;
            }
        }
        if (slot == true){
            o.pokemons[i] = _pokemonID;
        } else {
            uint j = pokeList.length++;
            o.pokemons[j] = _pokemonID;
        }
        balanceOf[_pokemonOwner] = cleanArray(o.pokemons);

        qtdePokemons(_pokemonOwner);
        UpdateMasterPokemons(_pokemonOwner, o.pokemons.length);
        return (_pokemonOwner, o.pokemons, o.pokemons.length);
    }

    function delPokemonFromMaster(address _pokemonOwner, uint256 _pokemonID) internal  returns (address pokeOwner, uint[] pokemons, uint pokemonsTotal) {
        uint ownerID = pokeOwnerIndex[_pokemonOwner];
        PokemonMaster o = pokeMasters[ownerID];
        uint[] pokeList = o.pokemons;

        for (uint i=0; i < pokeList.length; i++){
            if (pokeList[i] == _pokemonID){
                delete pokeList[i];
            }
        }

        // http://ethereum.stackexchange.com/questions/3373/how-to-clear-large-arrays-without-blowing-the-gas-limit
        o.pokemons=cleanArray(pokeList); // Se usar delete, usa a propria pokeList

        balanceOf[_pokemonOwner] = cleanArray(o.pokemons);

        qtdePokemons(_pokemonOwner);
        UpdateMasterPokemons(_pokemonOwner, o.pokemons.length);
        return (_pokemonOwner, o.pokemons, o.pokemons.length);
    }

    function listPokemons( address _pokeOwner )  returns (address, uint[]){
        uint ownerID = pokeOwnerIndex[_pokeOwner];
        PokemonMaster o = pokeMasters[ownerID];

        /* Lista pokemons tanto do struct quanto do mapping. */
        //return ( _pokeOwner, o.pokemons );
        return ( _pokeOwner, balanceOf[_pokeOwner] );
    }

    /* Conta a qtde de pokemons em um array que possui zeros */
    function qtdePokemons( address _pokeOwner)  returns (uint qtde){
        uint ownerID = pokeOwnerIndex[_pokeOwner];
        PokemonMaster o = pokeMasters[ownerID];
        uint[] pokeList = o.pokemons;
        uint count = 0;
        for (uint i=0; i < pokeList.length; i++){
            if ( pokeList[i] > 0 ){
                count++;
            }
        }
        totalPokemonsFromMaster[_pokeOwner] = count;
        return count;
    }

    /* Conta a qtde de pokemons diretamente do mapping */
    function qtdePokemonsMapping( address _pokeOwner)  returns (uint qtde){
        uint[] tempList = balanceOf[_pokeOwner];
        totalPokemonsFromMaster[_pokeOwner] = tempList.length;
        return tempList.length;
    }

    /* Esta funcao elimina todos os itens com zero do array, ao custo de gas */
    function cleanArray(uint[] pokeList) internal returns (uint[]){
        uint[] memory tempArray = new uint[](pokeList.length);
        uint j = 0;
        for (uint i=0; i < pokeList.length; i++){
            if ( pokeList[i] > 0 ){
                tempArray[j] = pokeList[i];
                j++;
            }
        }
        uint[] memory tempArray2 = new uint[](j);
        for (i=0; i< j; i++) tempArray2[i] = tempArray[i];
        return tempArray2;
    }

    /* Se tentarem enviar ether para o end desse contrato, ele rejeita */
    function () {
        throw;
    }
}

// Pokemon create template: 1,500,40,"at1",1,"at2",500
// owner "0xca35b7d915458ef540ade6068dfe2f44e8fa733c"

contract owned {
    address public owner;
    address public market;

    function owned() {
        owner = msg.sender;
    }

    modifier onlyOwner {
        if (msg.sender != owner) throw;
        _
    }

    modifier Market {
        if (msg.sender != market || msg.sender != owner) throw;
        _
    }

    function transferOwnership(address newOwner) onlyOwner {
        owner = newOwner;
    }

    function updateMarket(address newMarket) onlyOwner {
        market = newMarket;
    }
}

contract IssuePokemon is owned {

    uint256 public totalPokemonSupply;
    address public marketAddress;

    Pokemon[] public pokemons;
    PokemonMaster[] public pokeMasters;

    mapping (uint256 => address) public pokemonToMaster;
    mapping (address => uint256) public pokeOwnerIndex;
    mapping (uint => uint256) public pokemonIndex;
    mapping (address => uint256) public totalPokemonsFromMaster;

    struct Pokemon {
        uint pokeNumber;
        string pokeName;
        string pokeType;
        uint pokeCP;
        uint pokeHP;
        //string pokeAttack;
        //uint pokeAttackPower;
        //string pokeSpecial;
        //uint pokeSpecialPower;
        bytes32 pokemonHash;
        address pokeOwner;
    }

    struct PokemonMaster {
        address pokeMaster;
        uint[] pokemons;
    }

    string[][] public pokemonNameTypes = [["Pokemon 0", "invalid"], ["Bulbassauro", "Grass/Poison"], ["Charmander", "Fire"], ["Squirtle","Water"], ["Pikachu","Eletric"]]; // nÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ£o aceita bytes

    /* This generates a public event on the blockchain that will notify clients */
    event Transfer(address from, address to, uint256 value);
    event CreatePokemon(uint id, string name, uint cp, uint hp );
    event UpdatePokemon(uint id, string name, uint cp, uint hp );
    event UpdateMasterPokemons(address owner, uint total);
    event Log1(uint number);
    event Log2(string message);

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function IssuePokemon() {
        owner = msg.sender;
        newPokemonMaster(owner);                            // Todos pokemons serao criados para este owner
        newPokemon(0,0,0);                                  // Pokemon Índice 0
        totalPokemonSupply-=1;                              // Ajusta o total de pokemons porque o primeiro é fake

        /* Criacao de pokemons iniciais */
        newPokemon(3,500,40);
        newPokemon(1,535,70);
        newPokemon(4,546,80);
        newPokemon(2,557,90);

    }

    //function newPokemon(uint pokemonNumber, uint cp, uint hp, string attack, uint attackPower, string special, uint specialPower ) returns (bool success) { // cp e hp fornecidos por https://api.random.org/json-rpc/1/basic
    function newPokemon(uint pokemonNumber, uint cp, uint hp )  returns (bool success) { // cp e hp fornecidos por https://api.random.org/json-rpc/1/basic
        address owner = msg.sender;
        uint pokemonID = pokemons.length++;
        Pokemon p = pokemons[pokemonID];
        p.pokeNumber = pokemonNumber;
        p.pokeName = pokemonNameTypes[pokemonNumber][0];
        p.pokeType = pokemonNameTypes[pokemonNumber][1];
        p.pokeCP = cp;
        p.pokeHP = hp;
        //p.pokeAttack = attack;
        //p.pokeAttackPower = attackPower;
        //p.pokeSpecial = special;
        //p.pokeSpecialPower = specialPower;

        //p.pokemonHash = sha3(p.pokeNumber,p.pokeName,p.pokeType,p.pokeCP,p.pokeHP, p.pokeAttack, p.pokeAttackPower, p.pokeSpecial, p.pokeSpecialPower);
        p.pokemonHash = sha3(p.pokeNumber,p.pokeName,p.pokeType,p.pokeCP,p.pokeHP);
        p.pokeOwner = owner;
        pokemonIndex[pokemonNumber] = pokemonID;
        pokemonToMaster[pokemonID] = owner;
        addPokemonToMaster(owner, pokemonID);

        totalPokemonSupply += 1;
        CreatePokemon(pokemonID, p.pokeName, p.pokeCP, p.pokeHP);
        return true;
    }

    function updatePokemon(uint _pokemonNumber, uint _cp, uint _hp )  returns (bool success) {
        uint pokemonID = pokemonIndex[_pokemonNumber];
        Pokemon p = pokemons[pokemonID];
        p.pokeCP = _cp;
        p.pokeHP = _hp;
        //p.pokeAttack = attack;
        //p.pokeAttackPower = attackPower;
        //p.pokeSpecial = special;
        //p.pokeSpecialPower = specialPower;

        //p.pokemonHash = sha3(p.pokeNumber,p.pokeName,p.pokeType,p.pokeCP,p.pokeHP, p.pokeAttack, p.pokeAttackPower, p.pokeSpecial, p.pokeSpecialPower);
        p.pokemonHash = sha3(p.pokeNumber,p.pokeName,p.pokeType,p.pokeCP,p.pokeHP);

        UpdatePokemon(pokemonID, p.pokeName, p.pokeCP, p.pokeHP);
        return true;

    }

    function newPokemonMaster(address pokemonMaster)  returns (bool success) {
        uint ownerID = pokeMasters.length++;
        PokemonMaster o = pokeMasters[ownerID];
        o.pokeMaster = pokemonMaster;
        pokeOwnerIndex[pokemonMaster] = ownerID;
        return true;
    }

    function transferPokemon(address _from, address _to, uint256 _pokemonID)   returns (uint pokemonID, address from, address to) {
        Pokemon p = pokemons[_pokemonID];
        if (p.pokeOwner != _from) throw;
        if (pokeOwnerIndex[_to] == 0 && _to != pokemonToMaster[0] ) newPokemonMaster(_to);
        // Construir controle de acesso somente para o owner
        p.pokeOwner = _to;
        pokemonToMaster[_pokemonID] = _to;
        delPokemonFromMaster(_from, _pokemonID);
        addPokemonToMaster(_to, _pokemonID);
        Transfer(_from, _to, _pokemonID);
        return (_pokemonID, _from, _to);
    }

    function addPokemonToMaster(address _pokemonOwner, uint256 _pokemonID)  returns (address pokeOwner, uint[] pokemons, uint pokemonsTotal) {
        uint ownerID = pokeOwnerIndex[_pokemonOwner];
        PokemonMaster o = pokeMasters[ownerID];
        uint[] pokeList = o.pokemons;

        // o.pokemons.push(_pokemonID);
        // usando .push ele adiciona 0,_pokemonID

        // Ao invés de simplesmente adicionar um pokemon ao final da lista,
        // verifica se há slot zerado no array, senao adiciona ao final
        bool slot;
        for (uint i=0; i < pokeList.length; i++){
            if (pokeList[i] == 0){
                slot = true;
                break;
            }
        }
        if (slot == true){
            o.pokemons[i] = _pokemonID;
        } else {
            uint j = pokeList.length++;
            o.pokemons[j] = _pokemonID;
        }

        qtdePokemons(_pokemonOwner);
        UpdateMasterPokemons(_pokemonOwner, o.pokemons.length);
        return (_pokemonOwner, o.pokemons, o.pokemons.length);
    }

    function delPokemonFromMaster(address _pokemonOwner, uint256 _pokemonID)  returns (address pokeOwner, uint[] pokemons, uint pokemonsTotal) {
        uint ownerID = pokeOwnerIndex[_pokemonOwner];
        PokemonMaster o = pokeMasters[ownerID];
        uint[] pokeList = o.pokemons;

        for (uint i=0; i < pokeList.length; i++){
            if (pokeList[i] == _pokemonID){
                delete pokeList[i];
            }
        }

        // http://ethereum.stackexchange.com/questions/3373/how-to-clear-large-arrays-without-blowing-the-gas-limit
        o.pokemons=pokeList; // Se usar delete, usa a propria pokeList

        qtdePokemons(_pokemonOwner);
        UpdateMasterPokemons(_pokemonOwner, o.pokemons.length);
        return (_pokemonOwner, o.pokemons, o.pokemons.length);
    }

    function listPokemons( address _pokeOwner )  returns (address, uint[]){
        uint ownerID = pokeOwnerIndex[_pokeOwner];
        PokemonMaster o = pokeMasters[ownerID];
        return ( _pokeOwner, o.pokemons );
    }

    function qtdePokemons( address _pokeOwner)  returns (uint qtde){
        uint ownerID = pokeOwnerIndex[_pokeOwner];
        PokemonMaster o = pokeMasters[ownerID];
        uint[] pokeList = o.pokemons;
        uint count = 0;
        for (uint i=0; i < pokeList.length; i++){
            if ( pokeList[i] > 0 ){
                count++;
            }
        }
        totalPokemonsFromMaster[_pokeOwner] = count;
        return count;
    }

    /* Se tentarem enviar ether para o end desse contrato, ele rejeita */
    function () {
        throw;
    }
}


Improve comments.

Improve comments.

pragma solidity ^0.4.23;

/**
 * @title ItemStoreShortId
 * @author Jonathan Brown <jbrown@mix-blockchain.org>
 * @dev Maintain bidirectional mapping between 32 byte itemIds and 4 byte shortIds.
 */
contract ItemStoreShortId {

    /**
     * @dev Mapping of itemId to shortId.
     */
    mapping (bytes32 => bytes4) itemIdShortId;

    /**
     * @dev Mapping of shortId to itemId.
     */
    mapping (bytes4 => bytes32) shortIdItemId;

    /**
     * @dev A new shortId has been created.
     * @param itemId itemId of the item.
     * @param shortId shortId of the item
     */
    event CreateShortId(bytes32 indexed itemId, bytes32 shortId);

    /**
     * @dev Revert if the itemId already has a shortId.
     * @param itemId itemId of the item.
     */
    modifier noShortId(bytes32 itemId) {
        require (itemIdShortId[itemId] == 0);
        _;
    }

    /**
     * @dev Create a 4 byte shortId for a 32 byte itemId.
     * @param itemId itemId of the item.
     * @return shortId New 4 byte shortId.
     */
    function createShortId(bytes32 itemId) external noShortId(itemId) returns (bytes4 shortId) {
        // Find a shortId that hasn't been used before.
        bytes32 hash = keccak256(itemId);
        shortId = bytes4(hash);
        while (shortIdItemId[shortId] != 0) {
            hash = keccak256(hash);
            shortId = bytes4(hash);
        }
        // Store the mappings.
        itemIdShortId[itemId] = shortId;
        shortIdItemId[shortId] = itemId;
        // Log the event.
        emit CreateShortId(itemId, shortId);
    }

    /**
     * @dev Get itemId for shortId.
     * @param shortId to get the itemId for.
     * @return The itemId.
     */
    function getItemId(bytes4 shortId) external view returns (bytes32) {
        return shortIdItemId[shortId];
    }

    /**
     * @dev Get shortId for itemId.
     * @param itemId to get the shortId for.
     * @return The shortId.
     */
    function getShortId(bytes32 itemId) external view returns (bytes4) {
        return itemIdShortId[itemId];
    }

}

pragma solidity ^0.4.23;

/**
 * @title ItemStoreShortId
 * @author Jonathan Brown <jbrown@mix-blockchain.org>
 * @dev Maintain bidirectional mapping between 32 byte itemIds and 4 byte shortIds.
 */
contract ItemStoreShortId {

    /**
     * @dev Mapping of itemId to shortId.
     */
    mapping (bytes32 => bytes4) itemIdShortId;

    /**
     * @dev Mapping of shortId to itemId.
     */
    mapping (bytes4 => bytes32) shortIdItemId;

    /**
     * @dev A new shortId has been created.
     * @param itemId itemId of the item.
     * @param shortId shortId of the item
     */
    event CreateShortId(bytes32 indexed itemId, bytes32 shortId);

    /**
     * @dev Revert if the itemId already has a shortId.
     * @param itemId itemId of the item.
     */
    modifier noShortId(bytes32 itemId) {
        require (itemIdShortId[itemId] == 0);
        _;
    }

    /**
     * @dev Create a 4 byte shortId for a 32 byte itemId.
     * @param itemId itemId of the item.
     * @return shortId New 4 byte shortId.
     */
    function createShortId(bytes32 itemId) external noShortId(itemId) returns (bytes4 shortId) {
        // Caluculate the shortId.
        bytes32 hash = keccak256(itemId);
        shortId = bytes4(hash);
        // Make sure it hasn't been used before.
        while(shortIdItemId[shortId] != 0) {
            hash = keccak256(hash);
            shortId = bytes4(hash);
        }
        // Store the mappings.
        itemIdShortId[itemId] = shortId;
        shortIdItemId[shortId] = itemId;
        // Log the event.
        emit CreateShortId(itemId, shortId);
    }

    /**
     * @dev Get itemId for shortId.
     * @param shortId to get the itemId for.
     * @return The itemId.
     */
    function getItemId(bytes4 shortId) external view returns (bytes32) {
        return shortIdItemId[shortId];
    }

    /**
     * @dev Get shortId for itemId.
     * @param itemId to get the shortId for.
     * @return The shortId.
     */
    function getShortId(bytes32 itemId) external view returns (bytes4) {
        return itemIdShortId[itemId];
    }

}


Add comments about that oneOperate will be deprecated. [skip ci]

pragma solidity ^0.4.24;

import "../lib/safe_math.sol";
import "../common/error.sol";
import "../common/admin.sol";
import "../common/check.sol";

/// @title The interface of node_manager
/// @author ["Cryptape Technologies <contact@cryptape.com>"]
interface NodeInterface {

    event ApproveNode(address indexed _node);
    event DeleteNode(address indexed _node);
    event SetStake(address indexed _node, uint _stake);

    /// @notice Approve to be consensus node. status will be start
    function approveNode(address _node) external returns (bool);

    /// @notice Delete the consensus node that has been approved. status will be close
    function deleteNode(address _node) external returns (bool);

    /// @notice List the consensus nodes that have been approved
    /// which means list the node whose status is start
    function listNode() external view returns (address[]);

    /// @notice Set node stake
    function setStake(address _node, uint64 stake) external;
    /*
     * @notice Get the status of the node:
     * @return 0: Close
     * @return 1: Start
     */
    function getStatus(address _node) external view returns (uint8);

    /// @notice Node stake list
    function listStake() external view returns (uint64[] _stakes);

    /// @notice Stake permillage
    function stakePermillage(address _node) external view returns (uint64);
}

/// @title Node manager contract
/// @author ["Cryptape Technologies <contact@cryptape.com>"]
/// @notice The address: 0xffffffffffffffffffffffffffffffffff020001
contract NodeManager is NodeInterface, Error, Check, EconomicalType {

    mapping(address => NodeStatus) public status;
    // Recode the operation of the block(deprecation)
    mapping(uint => bool) block_op;
    // Consensus node list
    address[] nodes;
    mapping(address => uint64) stakes;

    // Default: Close
    enum NodeStatus { Close, Start }

    Admin admin = Admin(adminAddr);
    Authorization auth = Authorization(authorizationAddr);
    SysConfig sysConfig = SysConfig(sysConfigAddr);

    // Should operate one time in a block(deprecation)
    modifier oneOperate {
        if (!block_op[block.number])
            _;
        else {
            emit ErrorLog(ErrorType.NotOneOperate, "should operate one time in a block");
            return;
        }
    }

    modifier onlyClose(address _node) {
        if (NodeStatus.Close == status[_node])
            _;
        else {
            emit ErrorLog(ErrorType.NotClose, "node does not close");
            return;
        }
    }

    modifier onlyStart(address _node) {
        if (NodeStatus.Start == status[_node])
            _;
        else {
            emit ErrorLog(ErrorType.NotStart, "node does not start");
            return;
        }
    }

    modifier onlyAdmin {
        if (admin.isAdmin(msg.sender))
            _;
        else return;
    }

    modifier OnlyChargeModel() {
        if(sysConfig.getEconomicalModel() == EconomicalModel.Charge)
            _;
        else {
            return;
        }
    }

    /// @notice Setup
    constructor(address[] _nodes, uint64[] _stakes)
        public
    {
        // Initialize the address to Start
        require(_nodes.length == _stakes.length, "nodes's length not equal to stakes's length.");
        for (uint i = 0; i < _nodes.length; i++) {
            status[_nodes[i]] = NodeStatus.Start;
            nodes.push(_nodes[i]);
            stakes[_nodes[i]] = _stakes[i];
        }
    }

    /// @notice Set node stake
    function setStake(address _node, uint64 stake)
        public
        onlyAdmin
        checkPermission(builtInPermissions[17])
        returns (bool)
    {
        require(AddressArray.exist(_node, nodes), "node not exist.");
        emit SetStake(_node, stake);
        stakes[_node] = stake;
        return true;
    }

    /// @notice Approve the new node
    ///         The modifier of oneOperate will be deprecated!
    /// @param _node The node to be approved
    /// @return true if successed, otherwise false
    function approveNode(address _node)
        public
        onlyAdmin
        oneOperate
        onlyClose(_node)
        checkPermission(builtInPermissions[15])
        returns (bool)
    {
        status[_node] = NodeStatus.Start;
        block_op[block.number] = true;
        nodes.push(_node);
        emit ApproveNode(_node);
        return true;
    }

    /// @notice Delete the node
    ///         The modifier of oneOperate will be deprecated!
    /// @param _node The node to be deleted
    /// @return true if successed, otherwise false
    function deleteNode(address _node)
        public
        onlyAdmin
        oneOperate
        onlyStart(_node)
        checkPermission(builtInPermissions[16])
        returns (bool)
    {
        require(AddressArray.remove(_node, nodes), "remove node failed.");
        block_op[block.number] = false;
        status[_node] = NodeStatus.Close;
        stakes[_node] = 0;
        emit DeleteNode(_node);
        return true;
    }

    /// @notice Query the consensus nodes
    /// @return All the consensus nodes
    function listNode()
        public
        view
        returns (address[])
    {
        return nodes;
    }

    /// @notice Query the status of node
    /// @param _node The node to be deleted
    /// @return The status of the node
    function getStatus(address _node)
        public
        view
        returns (uint8)
    {
        return uint8(status[_node]);
    }

    /// @notice Node stake list
    /// @return All the node stake list
    function listStake()
        public
        view
        returns (uint64[] _stakes)
    {
        _stakes = new uint64[](nodes.length);
        for (uint j = 0; j < nodes.length; j++) {
            _stakes[j] = stakes[nodes[j]];
        }
        return _stakes;
    }

    /// @notice Stake permillage
    /// This is the slot number which ignore the remainder, not exactly precise.
    /// https://en.wikipedia.org/wiki/Largest_remainder_method
    /// Hare quota
    function stakePermillage(address _node)
        public
        view
        OnlyChargeModel
        returns (uint64)
    {
        uint total;
        for (uint j = 0; j < nodes.length; j++) {
            total = SafeMath.add(uint(total), uint(stakes[nodes[j]]));
        }

        if(total == 0) {
            return;
        }
        return uint64(SafeMath.div(SafeMath.mul(stakes[_node], 1000), total));
    }
}

pragma solidity ^0.4.24;

import "../lib/safe_math.sol";
import "../common/error.sol";
import "../common/admin.sol";
import "../common/check.sol";

/// @title The interface of node_manager
/// @author ["Cryptape Technologies <contact@cryptape.com>"]
interface NodeInterface {

    event ApproveNode(address indexed _node);
    event DeleteNode(address indexed _node);
    event SetStake(address indexed _node, uint _stake);

    /// @notice Approve to be consensus node. status will be start
    function approveNode(address _node) external returns (bool);

    /// @notice Delete the consensus node that has been approved. status will be close
    function deleteNode(address _node) external returns (bool);

    /// @notice List the consensus nodes that have been approved
    /// which means list the node whose status is start
    function listNode() external view returns (address[]);

    /// @notice Set node stake
    function setStake(address _node, uint64 stake) external;
    /*
     * @notice Get the status of the node:
     * @return 0: Close
     * @return 1: Start
     */
    function getStatus(address _node) external view returns (uint8);

    /// @notice Node stake list
    function listStake() external view returns (uint64[] _stakes);

    /// @notice Stake permillage
    function stakePermillage(address _node) external view returns (uint64);
}

/// @title Node manager contract
/// @author ["Cryptape Technologies <contact@cryptape.com>"]
/// @notice The address: 0xffffffffffffffffffffffffffffffffff020001
contract NodeManager is NodeInterface, Error, Check, EconomicalType {

    mapping(address => NodeStatus) public status;
    // Recode the operation of the block
    mapping(uint => bool) block_op;
    // Consensus node list
    address[] nodes;
    mapping(address => uint64) stakes;

    // Default: Close
    enum NodeStatus { Close, Start }

    Admin admin = Admin(adminAddr);
    Authorization auth = Authorization(authorizationAddr);
    SysConfig sysConfig = SysConfig(sysConfigAddr);

    // Should operate one time in a block
    modifier oneOperate {
        if (!block_op[block.number])
            _;
        else {
            emit ErrorLog(ErrorType.NotOneOperate, "should operate one time in a block");
            return;
        }
    }

    modifier onlyClose(address _node) {
        if (NodeStatus.Close == status[_node])
            _;
        else {
            emit ErrorLog(ErrorType.NotClose, "node does not close");
            return;
        }
    }

    modifier onlyStart(address _node) {
        if (NodeStatus.Start == status[_node])
            _;
        else {
            emit ErrorLog(ErrorType.NotStart, "node does not start");
            return;
        }
    }

    modifier onlyAdmin {
        if (admin.isAdmin(msg.sender))
            _;
        else return;
    }

    modifier OnlyChargeModel() {
        if(sysConfig.getEconomicalModel() == EconomicalModel.Charge)
            _;
        else {
            return;
        }
    }

    /// @notice Setup
    constructor(address[] _nodes, uint64[] _stakes)
        public
    {
        // Initialize the address to Start
        require(_nodes.length == _stakes.length, "nodes's length not equal to stakes's length.");
        for (uint i = 0; i < _nodes.length; i++) {
            status[_nodes[i]] = NodeStatus.Start;
            nodes.push(_nodes[i]);
            stakes[_nodes[i]] = _stakes[i];
        }
    }

    /// @notice Set node stake
    function setStake(address _node, uint64 stake)
        public
        onlyAdmin
        checkPermission(builtInPermissions[17])
        returns (bool)
    {
        require(AddressArray.exist(_node, nodes), "node not exist.");
        emit SetStake(_node, stake);
        stakes[_node] = stake;
        return true;
    }

    /// @notice Approve the new node
    /// @param _node The node to be approved
    /// @return true if successed, otherwise false
    function approveNode(address _node)
        public
        onlyAdmin
        oneOperate
        onlyClose(_node)
        checkPermission(builtInPermissions[15])
        returns (bool)
    {
        status[_node] = NodeStatus.Start;
        block_op[block.number] = true;
        nodes.push(_node);
        emit ApproveNode(_node);
        return true;
    }

    /// @notice Delete the node
    /// @param _node The node to be deleted
    /// @return true if successed, otherwise false
    function deleteNode(address _node)
        public
        onlyAdmin
        oneOperate
        onlyStart(_node)
        checkPermission(builtInPermissions[16])
        returns (bool)
    {
        require(AddressArray.remove(_node, nodes), "remove node failed.");
        block_op[block.number] = false;
        status[_node] = NodeStatus.Close;
        stakes[_node] = 0;
        emit DeleteNode(_node);
        return true;
    }

    /// @notice Query the consensus nodes
    /// @return All the consensus nodes
    function listNode()
        public
        view
        returns (address[])
    {
        return nodes;
    }

    /// @notice Query the status of node
    /// @param _node The node to be deleted
    /// @return The status of the node
    function getStatus(address _node)
        public
        view
        returns (uint8)
    {
        return uint8(status[_node]);
    }

    /// @notice Node stake list
    /// @return All the node stake list
    function listStake()
        public
        view
        returns (uint64[] _stakes)
    {
        _stakes = new uint64[](nodes.length);
        for (uint j = 0; j < nodes.length; j++) {
            _stakes[j] = stakes[nodes[j]];
        }
        return _stakes;
    }

    /// @notice Stake permillage
    /// This is the slot number which ignore the remainder, not exactly precise.
    /// https://en.wikipedia.org/wiki/Largest_remainder_method
    /// Hare quota
    function stakePermillage(address _node)
        public
        view
        OnlyChargeModel
        returns (uint64)
    {
        uint total;
        for (uint j = 0; j < nodes.length; j++) {
            total = SafeMath.add(uint(total), uint(stakes[nodes[j]]));
        }

        if(total == 0) {
            return;
        }
        return uint64(SafeMath.div(SafeMath.mul(stakes[_node], 1000), total));
    }
}


change data get method

change data get method

pragma solidity ^0.4.0;
contract webServer {
  struct pageData{
    address owner;
    bytes data;
  }

  mapping(bytes32 => mapping(bytes32 => pageData)) public pages;
  //event RegisterEvent(address owner, string data);

  function set(bytes32 domain, bytes32 name) returns (bool result){
    if (pages[domain][name].owner != 0) {
        if (pages[domain][name].owner != msg.sender) {
            return false;
        }
    }
    pages[domain][name].owner = msg.sender;
    pages[domain][name].data=msg.data;
    return true;
    //RegisterEvent(msg.sender, data);
  }

  function get(bytes32 domain, bytes32 name) constant returns (bytes data){
    return pages[domain][name].data;
  }
}

pragma solidity ^0.4.0;
contract webServer {
  struct pageData{
    address owner;
    bytes data;
  }

  mapping(bytes32 => mapping(bytes32 => pageData)) public pages;
  //event RegisterEvent(address owner, string data);

  function set(bytes32 domain, bytes32 name, bytes data) returns (bool result){
    if (pages[domain][name].owner != 0) {
        if (pages[domain][name].owner != msg.sender) {
            return false;
        }
    }
    pages[domain][name].owner = msg.sender;
    pages[domain][name].data=data;
    return true;
    //RegisterEvent(msg.sender, data);
  }

  function get(bytes32 domain, bytes32 name) constant returns (bytes data){
    return pages[domain][name].data;
  }
}


Contract help

Contract help

pragma solidity ^0.4.4;
contract News {

    struct Content {
        address owner;
        uint price;
    }

    struct Order {
        address buyer;
    }

    mapping(uint => Content) contents;
    mapping(uint => Order) orders;
    //Order[] orders;

    address contractMaker;

    function News() {
        contractMaker = msg.sender;
    }

    function add(uint256 fingerprint, uint price) {
        Content content = contents[fingerprint];
        content.owner = msg.sender;
        content.price = price;
    }

    function getPrice(uint256 fingerprint) returns(uint _price){
        Content content = contents[fingerprint];
        return (content.price);
    }

    function buy(uint256 fingerprint) payable {
        Content content = contents[fingerprint];
        Order order = orders[fingerprint];
        if (msg.value < content.price) {
          revert();
        } else {
            order.buyer = msg.sender;
            content.owner.transfer(msg.value);
        }
    }

    function proveBuy(uint256 fingerprint) public constant returns (bool){
        Order order = orders[fingerprint];
        if(order.buyer == msg.sender){
            return true;
        }
    }

    function proveOwnership(uint256 fingerprint) public constant returns (bool){
        Content content = contents[fingerprint];
        if(content.owner == msg.sender){
            return true;
        }
    }
}

pragma solidity ^0.4.0;
contract News {

    struct Content {
        address owner;
        uint price;
        //uint256 fingerprint;
    }

    struct Order {
        address buyer;
        //uint256 fingerprint;
    }

    Content[] contents;
    Order[] orders;

    address contractMaker;

    function News() {
        contractMaker = msg.sender;
    }

    function add(uint256 fingerprint, uint price) {
        contents[fingerprint].owner = msg.sender;
        contents[fingerprint].price = price;
    }

    function buy(uint256 fingerprint) payable {
        if (msg.value < contents[fingerprint].price) {
          revert();
        } else {
            orders[fingerprint].buyer = msg.sender;
            //send money to owner ???
            contents[fingerprint].owner.transfer(msg.value);
        }
    }

    function proveBuy(uint256 fingerprint) public constant returns (bool){
        if(orders[fingerprint].buyer == msg.sender){
            return true;
        }
    }

    function proveSell(uint256 fingerprint) public constant returns (bool){
        if(orders[fingerprint].buyer == msg.sender){
            return true;
        }
    }
}


Contracts: correct description of Bonuses in comments [ch128]

pragma solidity ^0.4.17;

// ----------------------------------------------------------------------------
// Bonuses
//
// Copyright (c) 2017 OpenST Ltd.
// https://simpletoken.org/
//
// The MIT Licence.
// ----------------------------------------------------------------------------

import "./SimpleToken.sol";
import "./SafeMath.sol";
import "./Processables.sol";

/// @title Bonuses
/// @dev Aids transferring bonus tokens related to the token sale
contract Bonuses is Processables {
    using SafeMath for uint256;

	// named "processables" to aid JS interaction with this and other contracts that inherit from Processables
	mapping(address => Processable) public processables;

	// Amount of gas sufficient to conduct a single process loop iteration and post-loop operations
	uint256 public constant PROCESS_GAS_MINIMUM = 100000;

	// Total bonuses amount remaining to process after locking
	uint256 public remainingTotalBonuses = 0;

	struct Processable {
		uint256 amount;
		bool processed;
	}

	SimpleToken public simpleToken;

	event BonusAdded(address indexed _address, uint256 _amount);
	event BonusProcessed(address indexed _address, uint256 _amount, uint256 _index);

	// limits execution to SimpleToken.owner
	modifier onlySTOwner() {
        require(msg.sender == simpleToken.owner());
        _;
    }

	function Bonuses(SimpleToken _simpleToken)
			Processables()
			public
	{
		require(address(_simpleToken) != address(0));
		simpleToken = _simpleToken;
	}

	/// @dev Adds bonus information to processables
	/// @param _address address
	/// @param _amount amount
	/// @return true
	function add(address _address, uint256 _amount)
			public
			onlyOwner
			onlyIfUnlocked
			returns (bool result)
	{
		require(_address != address(0));
		require(_amount > 0);

		Processable storage processable = processables[_address];

		require(processable.amount == 0);
		require(add(_address));

		processable.amount = _amount;

		BonusAdded(_address, _amount);

		return true;
	}

	/// @dev Locks this contract
	function lock()
			public
			returns (bool result)
	{
		// onlyOwner
		result = super.lock();

		for (uint256 i = 0; i < addresses.length; i++)
			remainingTotalBonuses = remainingTotalBonuses.add(processables[addresses[i]].amount);
	}

	/// @dev Approves this contract
	function approve()
			external
			onlySTOwner
			returns (bool result)
	{
		return approveInternal();
	}

	/// @dev Disapproves this contract
	function disapprove()
			external
			onlySTOwner
			returns (bool result)
	{
		return disapproveInternal();
	}

	/// @dev Processes as many bonuses as possible from a certain index
	/// @param _from from
	/// @return true if processes last bonus, false if otherwise
	function process(uint256 _from)
			public
			onlyOwner
			onlyIfApproved
			returns (bool result)
	{
		// Confirm that this contract is approved to transfer a sufficient amount of ST
		address owner = simpleToken.owner();
		require(simpleToken.allowance(owner, address(this)) >= remainingTotalBonuses);

		uint256 startingGas = msg.gas;

		// Breaks if there is not enough gas for both a complete iteration and post-loop operations
		for (uint256 i = _from; i < addresses.length && (block.gaslimit - (startingGas - msg.gas) > PROCESS_GAS_MINIMUM); i++) {
			Processable storage processable = processables[addresses[i]];

			// Skip if previously processed
			if (processable.processed) continue;

			require(simpleToken.transferFrom(owner, addresses[i], processable.amount));

			processable.processed = true;
			remainingTotalBonuses = remainingTotalBonuses.sub(processable.amount);

			BonusProcessed(addresses[i], processable.amount, i);
		}

		if (i == addresses.length && remainingTotalBonuses == 0) {
			complete();

			return true;
		}

		return false;
	}
}

pragma solidity ^0.4.17;

// ----------------------------------------------------------------------------
// Processables
//
// Copyright (c) 2017 OpenST Ltd.
// https://simpletoken.org/
//
// The MIT Licence.
// ----------------------------------------------------------------------------

import "./SimpleToken.sol";
import "./SafeMath.sol";
import "./Processables.sol";

/// @title Bonuses
/// @dev Aids transferring bonus tokens related to the token sale
contract Bonuses is Processables {
    using SafeMath for uint256;

	// named "processables" to aid JS interaction with this and other contracts that inherit from Processables
	mapping(address => Processable) public processables;

	// Amount of gas sufficient to conduct a single process loop iteration and post-loop operations
	uint256 public constant PROCESS_GAS_MINIMUM = 100000;

	// Total bonuses amount remaining to process after locking
	uint256 public remainingTotalBonuses = 0;

	struct Processable {
		uint256 amount;
		bool processed;
	}

	SimpleToken public simpleToken;

	event BonusAdded(address indexed _address, uint256 _amount);
	event BonusProcessed(address indexed _address, uint256 _amount, uint256 _index);

	// limits execution to SimpleToken.owner
	modifier onlySTOwner() {
        require(msg.sender == simpleToken.owner());
        _;
    }

	function Bonuses(SimpleToken _simpleToken)
			Processables()
			public
	{
		require(address(_simpleToken) != address(0));
		simpleToken = _simpleToken;
	}

	/// @dev Adds bonus information to processables
	/// @param _address address
	/// @param _amount amount
	/// @return true
	function add(address _address, uint256 _amount)
			public
			onlyOwner
			onlyIfUnlocked
			returns (bool result)
	{
		require(_address != address(0));
		require(_amount > 0);

		Processable storage processable = processables[_address];

		require(processable.amount == 0);
		require(add(_address));

		processable.amount = _amount;

		BonusAdded(_address, _amount);

		return true;
	}

	/// @dev Locks this contract
	function lock()
			public
			returns (bool result)
	{
		// onlyOwner
		result = super.lock();

		for (uint256 i = 0; i < addresses.length; i++)
			remainingTotalBonuses = remainingTotalBonuses.add(processables[addresses[i]].amount);
	}

	/// @dev Approves this contract
	function approve()
			external
			onlySTOwner
			returns (bool result)
	{
		return approveInternal();
	}

	/// @dev Disapproves this contract
	function disapprove()
			external
			onlySTOwner
			returns (bool result)
	{
		return disapproveInternal();
	}

	/// @dev Processes as many bonuses as possible from a certain index
	/// @param _from from
	/// @return true if processes last bonus, false if otherwise
	function process(uint256 _from)
			public
			onlyOwner
			onlyIfApproved
			returns (bool result)
	{
		// Confirm that this contract is approved to transfer a sufficient amount of ST
		address owner = simpleToken.owner();
		require(simpleToken.allowance(owner, address(this)) >= remainingTotalBonuses);

		uint256 startingGas = msg.gas;

		// Breaks if there is not enough gas for both a complete iteration and post-loop operations
		for (uint256 i = _from; i < addresses.length && (block.gaslimit - (startingGas - msg.gas) > PROCESS_GAS_MINIMUM); i++) {
			Processable storage processable = processables[addresses[i]];

			// Skip if previously processed
			if (processable.processed) continue;

			require(simpleToken.transferFrom(owner, addresses[i], processable.amount));

			processable.processed = true;
			remainingTotalBonuses = remainingTotalBonuses.sub(processable.amount);

			BonusProcessed(addresses[i], processable.amount, i);
		}

		if (i == addresses.length && remainingTotalBonuses == 0) {
			complete();

			return true;
		}

		return false;
	}
}


Create Managefund.sol

Create Managefund.sol

pragma solidity ^0.4.11;

contract Managefund{

    struct Bid{
        bytes32 name;
        address oracle;
        address seller;
        address buyer;
        uint price;
        uint timeout;
        dealStatus status;
        uint fee;
        bool isLimited;
    }

    enum dealStatus{ unPaid, Pending, Closed, Rejected, Refund }

    mapping (address => Bid[]) public bids;
    mapping (address => uint) public pendingWithdrawals;

    event amountRecieved(
        address seller,
        uint bidId
    );

    event bidClosed(
        address seller,
        uint bidId
        );

    event bidCreated(
        address seller,
        bytes32 name,
        uint bidId
        );

    event refundDone(
        address seller,
        uint bidId
        );

    event withdrawDone(
        address person,
        uint amount
        );

    event bidRejected(
        address seller,
        uint bidId
        );

    function getBidIndex(address seller, bytes32 name) public constant returns (uint){
        for (uint8 i=0;i<bids[seller].length;i++){
            if (bids[seller][i].name == name){
                return i;
            }
        }
    }

    function getBidsNum (address seller) public constant returns (uint bidsNum) {
        return bids[seller].length;
    }

    function sendAmount (address seller, uint bidId) external payable{
        Bid storage a = bids[seller][bidId];
        require(msg.value == a.price && a.status == dealStatus.unPaid);
        if (a.isLimited == true){
            require(a.timeout > block.number);
        }
        a.status = dealStatus.Pending;
        amountRecieved(seller, bidId);
    }

    function createBid (bytes32 name, address seller, address oracle, address buyer, uint price, uint timeout, uint fee) external{
        require(name.length != 0 && price !=0);
        bool limited = true;
        if (timeout == 0){
            limited = false;
        }
        bids[seller].push(Bid({
            name: name,
            oracle: oracle,
            seller: seller,
            buyer: buyer,
            price: price,
            timeout: block.number+timeout,
            status: dealStatus.unPaid,
            fee: fee,
            isLimited: limited
        }));
        uint bidId = bids[seller].length-1;
        bidCreated(seller, name, bidId);
    }

    function closeBid(address seller, uint bidId) external returns (bool){
        Bid storage bid = bids[seller][bidId];
        if (bid.isLimited == true){
            require(bid.timeout > block.number);
        }
        require(msg.sender == bid.oracle && bid.status == dealStatus.Pending);
        bid.status = dealStatus.Closed;
        pendingWithdrawals[bid.seller]+=bid.price-bid.fee;
        pendingWithdrawals[bid.oracle]+=bid.fee;
        withdraw(bid.seller);
        withdraw(bid.oracle);
        bidClosed(seller, bidId);
        return true;
    }

    function refund(address seller, uint bidId) external returns (bool){
        require(bids[seller][bidId].buyer == msg.sender && bids[seller][bidId].isLimited == true && bids[seller][bidId].timeout < block.number && bids[seller][bidId].status == dealStatus.Pending);
        Bid storage a = bids[seller][bidId];
        a.status = dealStatus.Refund;
        pendingWithdrawals[a.buyer] = a.price;
        withdraw(a.buyer);
        refundDone(seller,bidId);
        return true;
    }
    function rejectBid(address seller, uint bidId) external returns (bool){
        if (bids[seller][bidId].isLimited == true){
            require(bids[seller][bidId].timeout > block.number);
        }
        require(msg.sender == bids[seller][bidId].oracle && bids[seller][bidId].status == dealStatus.Pending);
        Bid storage bid = bids[seller][bidId];
        bid.status = dealStatus.Rejected;
        pendingWithdrawals[bid.oracle] = bid.fee;
        pendingWithdrawals[bid.buyer] = bid.price-bid.fee;
        withdraw(bid.buyer);
        withdraw(bid.oracle);
        bidRejected(seller, bidId);
        return true;
    }

    function withdraw(address person) private{
        uint amount = pendingWithdrawals[person];
        pendingWithdrawals[person] = 0;
        person.transfer(amount);
        withdrawDone(person, amount);
    }

}

error: pathspec 'Managefund.sol' did not match any file(s) known to git