> For the complete documentation index, see [llms.txt](https://docs.auctus.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.auctus.org/smart-contracts/writer.md).

# Writer

## Introduction

It is a contract to write ACO tokens. Through the data obtained on 0x protocol to market sell ACO tokens is possible to mint and market sell the tokens in only one step.

## Code

[`ACOWriter.sol`](https://github.com/AuctusProject/aco/blob/master/smart-contracts/contracts/periphery/ACOWriter.sol)

## Address

`ACOWriter.sol` is deployed at [`0xE7597F774fD0a15A617894dc39d45A28B97AFa4f`](https://etherscan.io/address/0xE7597F774fD0a15A617894dc39d45A28B97AFa4f) on the Ethereum mainnet.&#x20;

## Read-Only Functions

### weth

`function weth() external view returns(address);`

The WETH address 0x.

### erc20proxy

`function erc20proxy() external view returns(address);`

Address for 0x ERC20 proxy.

## State-Changing Functions

### write

`function write(address acoToken, uint256 collateralAmount, address exchangeAddress, bytes calldata exchangeData) external payable;`

Function to write ACO tokens. The tokens are minted then sold on the 0x exchange. The transaction sender receives the premium.

* `acoToken` Address of the ACO token.&#x20;
* `collateralAmount` Amount of collateral to be deposited.&#x20;
* `exchangeAddress` Address to sell the tokens returned by 0x API.&#x20;
* `exchangeData` Data to be sent to the 0x exchange.

{% hint style="info" %}
When the asset that should be collateralized is not Ether the allowance to the writer contract on the respective ERC20 asset is required.&#x20;
{% endhint %}

{% hint style="info" %}
The function only works when the ACO token is **NOT** expired yet.
{% endhint %}

## ABI

[JSON](http://api.etherscan.io/api?module=contract\&action=getabi\&address=0xE7597F774fD0a15A617894dc39d45A28B97AFa4f\&format=raw)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.auctus.org/smart-contracts/writer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
