sway-core 0.35.3

Sway core language.
Documentation
use crate::transform;

use super::{FunctionDeclaration, Supertrait, TraitFn};

use sway_types::{ident::Ident, span::Span};

/// An `abi` declaration, which declares an interface for a contract
/// to implement or for a caller to use to call a contract.
#[derive(Debug, Clone)]
pub struct AbiDeclaration {
    /// The name of the abi trait (also known as a "contract trait")
    pub name: Ident,
    /// The methods a contract is required to implement in order opt in to this interface
    pub interface_surface: Vec<TraitFn>,
    pub supertraits: Vec<Supertrait>,
    /// The methods provided to a contract "for free" upon opting in to this interface
    pub methods: Vec<FunctionDeclaration>,
    pub(crate) span: Span,
    pub attributes: transform::AttributesMap,
}