Skip to content

Your First Contract

andydhancock edited this page Nov 16, 2023 · 1 revision

Your First Contract

Welcome to the exciting world of LegaleseScript! This guide will walk you through creating your very first contract. By the end, you'll have a basic understanding of how to structure a LegaleseScript document and how to define the various elements of a contract.

Setting Up Your Workspace

Before we start, ensure that you have LegaleseScript installed on your system (see the Installation page). You'll also need a text editor to write your contract. Any editor will do, but one with LegaleseScript syntax highlighting is preferred.

Writing the Contract

Let's create a simple employment agreement. We'll define the parties involved, the terms of employment, and the obligations and rights of each party.

Step 1: Define the Contract and Parties

Start by defining the section for the contract and declaring the parties involved.

section EmploymentAgreement {
    Party employer = "Acme Corporation";
    Party employee = "John Doe";
}

Step 2: Add Terms of Employment

Next, we'll add the terms of employment, including the position, salary, and start date.

section EmploymentAgreement {
    // ... previous content ...

    Text position = "Software Developer";
    Currency annualSalary = Currency("GBP", 50000);
    Date startDate = Date("2023-01-01");
}

Step 3: Define Obligations and Rights

Now, define the obligations and rights. For this example, the employer's obligation is to pay the salary, and the employee's right is to receive the salary.

section EmploymentAgreement {
    // ... previous content ...

    obligation paySalary(Date onDate) {
        // Logic to pay the employee's salary on the specified date
    }

    right toReceiveSalary() {
        // Logic for the employee to receive the salary
    }
}

Step 4: Signatures

Lastly, add the signature clause to signify the agreement of the parties to the terms.

section EmploymentAgreement {
    // ... previous content ...

    signature signContract() {
        // Logic to confirm that both parties have signed the contract
    }
}

Testing Your Contract

Once you have written your contract, it's important to test it to ensure it behaves as expected. You can write test cases using LegaleseScript's testing framework (refer to the Testing Contracts page for more information).

Conclusion

Congratulations! You've just written your first contract in LegaleseScript. As you become more familiar with the language, you can start to explore more complex contracts and utilize the full range of features that LegaleseScript offers.

Remember to save your contract with a .legalese extension and use the LegaleseScript compiler to check for syntax correctness and compile it into a human-readable legal document.

Clone this wiki locally