-
Notifications
You must be signed in to change notification settings - Fork 0
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.
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.
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.
Start by defining the section for the contract and declaring the parties involved.
section EmploymentAgreement {
Party employer = "Acme Corporation";
Party employee = "John Doe";
}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");
}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
}
}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
}
}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).
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.