DIN-center / din-sc

1 stars 0 forks source link

Refactor the meta (generator code) #4

Closed cds-amal closed 8 months ago

cds-amal commented 8 months ago

Currently the generators were hacked together, with multiline fragments littered through out the logic. This should be split into a template / data paradigm that will be easier to reason about, manage and maintain.

Example template


template = f'''
/// {spdx_license}
pragma solidity {solidity_version}

{solidity_includes}

contract {contract_name} {contract_ancestors} {{
    {state_variables}
    {functions}
    {constructor}    
}}

# ... Use the template with computed data
'''