示例#1
0
def manifest() -> NeoMetadata:
    meta = NeoMetadata()

    meta.author = "COZ in partnership with Simpli"
    meta.email = "*****@*****.**"
    meta.description = 'This is a contract example'
    return meta
示例#2
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.description = "This is an example smart contract for testing use cases of NEP-17 example"
    return meta
示例#3
0
def manifest_metadata() -> NeoMetadata:
    meta = NeoMetadata()
    meta.author = 'Tyler Adams'
    meta.email = '*****@*****.**'
    meta.description = 'This smart contract implements a pointer-based database on top of the key-value storage ' \
                       'layer to enable advanced storage features.'
    return meta
示例#4
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.has_storage = True
    meta.is_payable = True
    return meta
示例#5
0
def extras_manifest() -> NeoMetadata:
    meta = NeoMetadata()
    meta.extras = {
        'unittest1': 'string',
        'unittest2': 123,
        'unittest3': True,
        'unittest4': ['list', 3210]
    }
    return meta
示例#6
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.author = "Mirella Medeiros, Ricardo Prado and Lucas Uezu. COZ in partnership with Simpli"
    meta.description = "Another smart contract that will help during test"
    meta.email = "*****@*****.**"
    return meta
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.author = "Mirella Medeiros, Ricardo Prado and Lucas Uezu. COZ in partnership with Simpli"
    meta.description = "Wrapped NEO Example"
    meta.email = "*****@*****.**"
    return meta
示例#8
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information.
    """
    meta = NeoMetadata()

    meta.author = "Mirella Medeiros, Ricardo Prado and Lucas Uezu. COZ in partnership with Simpli"
    meta.description = "Update Contract Example. This contract represents the updated smart contract to be deployed " \
                       "on the blockchain, with the method now working properly"
    meta.email = "*****@*****.**"
    return meta
示例#9
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information.
    """
    meta = NeoMetadata()

    meta.author = "Mirella Medeiros, Ricardo Prado and Lucas Uezu. COZ in partnership with Simpli"
    meta.description = "Update Contract Example. This contract represents the first smart contract deployed on the" \
                       "blockchain, with a buggy method."
    meta.email = "*****@*****.**"
    return meta
示例#10
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.author = "Mathias Enzensberger, Vincent Geneste"
    meta.description = "GhostMarket NFT"
    meta.email = "*****@*****.**"
    # meta.supportedstandards = "NEP-11" # TODO: NOT SUPPORTED YET
    # meta.permissions = [{"contract": "*","methods": "*"}] # TODO: NOT SUPPORTED YET
    return meta
def trusts_manifest() -> NeoMetadata:
    meta = NeoMetadata()

    meta.add_trusted_source(0x0123456789012345678901234567890123456789)
    meta.add_trusted_source(b'0123456789012345678901234567890123456789')
    meta.add_trusted_source(True)
    return meta
示例#12
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.supported_standards = ['NEP-17']
    meta.add_permission(methods=['onNEP17Payment'])
    # this contract needs to call NEO methods
    meta.add_permission(contract='0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5')

    meta.author = "Mirella Medeiros, Ricardo Prado and Lucas Uezu. COZ in partnership with Simpli"
    meta.description = "Wrapped NEO Example"
    meta.email = "*****@*****.**"
    return meta
示例#13
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.supported_standards = ['NEP-17']
    meta.add_permission(methods=['onNEP17Payment'])
    # this contract needs to call GAS methods
    meta.add_permission(contract='0xd2a4cff31913016155e38e474a2c06d08be276cf')

    meta.author = "Mirella Medeiros, Ricardo Prado and Lucas Uezu. COZ in partnership with Simpli"
    meta.description = "Wrapped GAS Example"
    meta.email = "*****@*****.**"
    return meta
示例#14
0
    def __init__(self,
                 ast_tree: ast.AST,
                 path: str = None,
                 project_root: str = None,
                 log: bool = False):
        self.symbol_table: Dict[str, ISymbol] = {}

        self.ast_tree: ast.AST = ast_tree
        self.metadata: NeoMetadata = NeoMetadata()
        self.is_analysed: bool = False
        self._log: bool = log

        self.__include_builtins_symbols()
        self._errors = []
        self._warnings = []
        self._imported_files: Dict[str, Analyser] = {}
        self._included_imported_files: bool = False

        import os
        self.path: str = path
        self.filename: str = path if path is None else os.path.realpath(path)

        if project_root is not None:
            if not os.path.exists(project_root):
                project_root = os.path.abspath(
                    f'{os.path.curdir}{os.path.sep}{project_root}')

            if os.path.isfile(project_root):
                project_root = os.path.dirname(os.path.abspath(project_root))

        self.root: str = (os.path.realpath(project_root)
                          if project_root is not None
                          and os.path.isdir(project_root) else path)
示例#15
0
    def __init__(self,
                 analyser,
                 symbol_table: Dict[str, ISymbol],
                 filename: str = None,
                 log: bool = False):
        super().__init__(analyser.ast_tree, filename, log)
        self.modules: Dict[str, Module] = {}
        self.symbols: Dict[str, ISymbol] = symbol_table

        self._builtin_functions_to_visit: Dict[str, IBuiltinMethod] = {}
        self._current_module: Module = None
        self._current_method: Method = None
        self._current_event: Event = None

        self._annotated_variables: List[str] = []
        self._global_assigned_variables: List[str] = []
        self._scope_stack: List[SymbolScope] = []

        self._metadata: NeoMetadata = None
        self._metadata_node: ast.AST = ast.parse('')
        self.imported_nodes: List[ast.AST] = []
        self.visit(self._tree)

        analyser.metadata = self._metadata if self._metadata is not None else NeoMetadata(
        )
示例#16
0
def trusts_manifest() -> NeoMetadata:
    meta = NeoMetadata()

    # the * wildcard will remove all but itself from trusts
    meta.add_trusted_source("0x1234567890123456789012345678901234567890")
    meta.add_trusted_source("*")
    meta.add_trusted_source("0x1234567890123456789012345678901234567890")

    return meta
示例#17
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.supported_standards = ['NEP-17']
    meta.add_permission(methods=['onNEP17Payment'])

    meta.author = "Mirella Medeiros, Ricardo Prado and Lucas Uezu. COZ in partnership with Simpli"
    meta.description = "ICO Example"
    meta.email = "*****@*****.**"
    return meta
示例#18
0
def manifest_metadata() -> NeoMetadata:
    meta = NeoMetadata()
    meta.author = 'The Four Blessings of the Apocalypse (COZ)'
    meta.email = '*****@*****.**'
    meta.description = ''
    meta.version = "v0.0.1"
    return meta
示例#19
0
def manifest() -> NeoMetadata:
    meta = NeoMetadata()
    meta.author = 'Neo'
    meta.email = '*****@*****.**'
    meta.description = 'This is a contract example'
    meta.has_storage = True
    return meta
示例#20
0
def manifest_metadata() -> NeoMetadata:
    meta = NeoMetadata()
    meta.author = "hal0x2328"
    meta.name = "Crypsydra"
    meta.description = "Streaming payments"
    meta.email = ""
    return meta
示例#21
0
def manifest_metadata() -> NeoMetadata:
    meta = NeoMetadata()
    meta.author = 'The Four Blessings of the Apocalypse (COZ)'
    meta.email = '*****@*****.**'
    meta.description = 'This smart contract represents one of the core resources for the game, stone.'
    meta.version = "v0.0.1"
    return meta
示例#22
0
    def __init__(self, ast_tree: ast.AST, path: str = None, log: bool = False):
        self.symbol_table: Dict[str, ISymbol] = {}

        self.ast_tree: ast.AST = ast_tree
        self.metadata: NeoMetadata = NeoMetadata()
        self.is_analysed: bool = False
        self._log: bool = log

        self.__include_builtins_symbols()

        import os
        self.path: str = path
        self.filename: str = path if path is None else os.path.realpath(path)
示例#23
0
def permissions_manifest() -> NeoMetadata:
    meta = NeoMetadata()

    # the contract needs permission to call this method from any contract
    meta.add_permission(methods=['onNEP17Payment'])

    # the contract needs permission to call this method from a specific contract
    meta.add_permission(contract='0x3846a4aa420d9831044396dd3a56011514cd10e3',
                        methods=['get_object'])

    # the contract needs permission to call any methods from any contract in this group
    meta.add_permission(
        contract=
        '0333b24ee50a488caa5deec7e021ff515f57b7993b93b45d7df901e23ee3004916')

    return meta
def extras_manifest() -> NeoMetadata:
    meta = NeoMetadata()

    meta.unit_test1 = 'string'
    meta.unit_test2 = 123
    meta.unit_test3 = True
    meta.unit_test4 = ['list', 3210]

    return meta
示例#25
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    meta.supported_standards = ['NEP-5']

    meta.author = "Mirella Medeiros and Ricardo Prado. COZ in partnership with Simpli"
    meta.description = "NEP-5 Example"
    meta.email = "*****@*****.**"
    return meta
示例#26
0
def manifest_metadata() -> NeoMetadata:
    """
    Defines this smart contract's metadata information
    """
    meta = NeoMetadata()
    return meta
示例#27
0
def trusts_manifest() -> NeoMetadata:
    meta = NeoMetadata()

    # values added to manifest
    meta.add_trusted_source("0x1234567890123456789012345678901234567890")
    meta.add_trusted_source("0x1234567890123456789012345678901234abcdef")
    meta.add_trusted_source(
        "030000123456789012345678901234567890123456789012345678901234abcdef")
    meta.add_trusted_source(
        "020000123456789012345678901234567890123456789012345678901234abcdef")

    # values not added to manifest
    meta.add_trusted_source("0x123456789012345678901234567890123abcdefg"
                            )  # only hex values are valid
    meta.add_trusted_source(
        "0x1234567890123456789012345678901234567890")  # can't repeat values
    meta.add_trusted_source(
        "030000123456789012345678901234567890123456789012345678901234abcdef"
    )  # can't repeat values
    meta.add_trusted_source(
        "03000012345678901234567890123456789012345678901234567890123abcdefg"
    )  # only hex values are valid
    meta.add_trusted_source(
        "000000123456789012345678901234567890123456789012345678901234567890"
    )  # public keys must begin with 03 or 02

    return meta
示例#28
0
def email_manifest() -> NeoMetadata:
    meta = NeoMetadata()
    meta.email = '*****@*****.**'
    return meta
示例#29
0
def payable_manifest() -> NeoMetadata:
    meta = NeoMetadata()
    meta.is_payable = True
    return meta
def manifest() -> NeoMetadata:
    meta = NeoMetadata()
    meta.has_storage = True
    return meta