def get_erc20_abi() -> Dict[str, Any]: zeth_dir = get_zeth_dir() openzeppelin_dir = join(zeth_dir, "zeth_contracts", "node_modules", "openzeppelin-solidity") ierc20_path = join(openzeppelin_dir, "contracts", "token", "ERC20", "IERC20.sol") compiled_sol = compile_files([ierc20_path]) erc20_interface = compiled_sol[ierc20_path + ":IERC20"] return erc20_interface["abi"]
def compile_token() -> Interface: """ Compile the testing ERC20 token contract """ zeth_dir = get_zeth_dir() allowed_path = join(zeth_dir, "zeth_contracts/contracts") path_to_token = join(zeth_dir, "zeth_contracts/contracts", "ERC20Mintable.sol") # Compilation set_solc_version(SOL_COMPILER_VERSION) compiled_sol = compile_files([path_to_token], allow_paths=allowed_path) token_interface = compiled_sol[path_to_token + ":ERC20Mintable"] return token_interface