# Contracts

## Same in all Networks

| Contract name    | Address                                    |
| ---------------- | ------------------------------------------ |
| **SPLX Token**   | 0xA26710B65D505b6f85ECB418b073A4A67586DEdD |
| **veSPLX NFT**   | 0x71DCdf11c1aD7a25c942F9E6c22B495b1F456F84 |
| **Split Router** | 0xb0C1921fA527d8E6c5a6CF743c4323C8ABbcC773 |

## Contract methods

{% tabs %}
{% tab title="SPLX" %}

### ERC20 Token Functions

<table><thead><tr><th width="271">Function</th><th width="106">Type</th><th width="91">Return</th><th>Description</th></tr></thead><tbody><tr><td><code>name()</code> </td><td>read</td><td>string</td><td>This function return the name of the token.</td></tr><tr><td><code>decimals()</code></td><td>read</td><td>uint8</td><td>This function return the decimal of the token.</td></tr><tr><td><code>symbol()</code> </td><td>read</td><td>string</td><td>This function return the symbol  of the token.</td></tr><tr><td><code>totalSupply()</code></td><td>read</td><td>uint256</td><td>This function returns the total supply of tokens.</td></tr><tr><td><code>balanceOf(address account)</code></td><td>read</td><td>uint256</td><td>This function returns the token balance of a specified account.</td></tr><tr><td><code>allowance(address owner, address spender)</code></td><td>read</td><td>uint256</td><td>This function returns the allowance granted by a token owner to a spender.</td></tr><tr><td><code>transfer(address recipient, uint256 amount)</code></td><td>write</td><td>bool</td><td>This function transfers tokens from the sender's account to the recipient's account.</td></tr><tr><td><code>transferFrom(address sender, address recipient, uint256 amount)</code></td><td>write</td><td>bool</td><td>This function allows a spender to transfer tokens on behalf of the token owner.</td></tr><tr><td><code>approve(address spender, uint256 amount)</code></td><td>write</td><td>bool</td><td>This function allows a spender to spend tokens from the sender's account.</td></tr><tr><td><code>increaseAllowance(address spender, uint256 addedValue)</code></td><td>write</td><td>bool</td><td>This function increases the allowance of a spender.</td></tr><tr><td><code>decreaseAllowance(address spender, uint256 subtractedValue)</code></td><td>write</td><td>bool</td><td>This function decreases the allowance of a spender.</td></tr><tr><td><code>burn(uint256 amount)</code></td><td>write</td><td>bool</td><td>This function burns (destroys) tokens from the sender's account.</td></tr></tbody></table>

### **Bridge Transfer Functions**

<table><thead><tr><th width="272">Function</th><th width="104">Type</th><th width="90">Return</th><th>Description</th></tr></thead><tbody><tr><td><code>bridgeTransfer(address recipient, uint256 amount, uint256 destChainID)</code></td><td>write (payable)</td><td>bool</td><td>This function allows the sender to burn tokens and send them to another chain for bridging. It emits the BridgeTransferSent event and uses the ICallProxy contract to initiate the bridging process.</td></tr><tr><td><code>bridgeTransferFrom(address sender, address recipient, uint256 amount, uint256 destChainID)</code></td><td>write (payable)</td><td>bool</td><td>This function is similar to bridgeTransfer, but it allows the router contract to initiate the transfer on behalf of a sender. It also checks and updates the allowance of the spender.</td></tr></tbody></table>
{% endtab %}

{% tab title="veSPLX NFT" %}

### veSPLX Functions

<table><thead><tr><th width="238">Function</th><th width="92">Type</th><th width="107">Return</th><th>Description</th></tr></thead><tbody><tr><td><code>deposit(uint256 amount, uint256 lockTimestampID, address token)</code></td><td>write</td><td>void</td><td>The <code>deposit</code> function allows a user to deposit tokens into the contract for staking. It requires the token to be allowed for staking, a non-zero amount, and a valid lockTimestampID. The function calculates the veShare based on the lockTimestampID and token amount and mints a new ERC721 token representing the allocation.</td></tr><tr><td><code>withdraw(uint256 tokenId)</code></td><td>write</td><td>void</td><td>The <code>withdraw</code> function allows a user to withdraw their tokens from the contract after the lock period has expired. It requires the caller to be the owner of the token and the allocation to be expired. The function burns the ERC721 token and transfers the tokens back to the user.</td></tr><tr><td><code>claimerOf(uint256 tokenId)</code></td><td>read </td><td>address</td><td>It returns the claimer (recipient) of a specific token allocation.</td></tr><tr><td><code>viewAllocation(uint256 tokenId)</code></td><td>read</td><td>(uint256, uint256, uint256, address)</td><td>It returns the details of a specific token allocation (amount, veShare, unlockTimestamp, token).</td></tr><tr><td><code>viewAllocations(address user, uint256 startID, uint256 len)</code></td><td>read</td><td>uint256[]</td><td>It returns an array of token IDs owned by a user, starting from a given startID and up to the specified length.</td></tr><tr><td><code>isAllocationExpired(uint256 tokenId)</code></td><td>read</td><td>bool</td><td>It checks if a specific token allocation has expired.</td></tr></tbody></table>

### ERC721 Token Functions&#x20;

<table><thead><tr><th>Function</th><th width="88">Type</th><th width="96">Return</th><th>Description</th></tr></thead><tbody><tr><td><code>balanceOf(address owner)</code></td><td>read</td><td>uint256 </td><td>Returns the number of tokens owned by the owner.</td></tr><tr><td><code>ownerOf(uint256 tokenId)</code></td><td>read</td><td>address </td><td>Returns the owner of the tokenId token.</td></tr><tr><td><code>safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data)</code></td><td>write</td><td>void</td><td>Safely transfers the tokenId token from from to to with additional data.</td></tr><tr><td><code>safeTransferFrom(address from, address to, uint256 tokenId)</code></td><td>write</td><td>void</td><td>Safely transfers the tokenId token from from to to.</td></tr><tr><td><code>transferFrom(address from, address to, uint256 tokenId)</code></td><td>write</td><td>void</td><td>Transfers the tokenId token from from to to.</td></tr><tr><td><code>approve(address to, uint256 tokenId)</code></td><td>write</td><td>void</td><td>Grants permission to to to transfer the tokenId token.</td></tr><tr><td><code>setApprovalForAll(address operator, bool _approved)</code></td><td>write</td><td>void</td><td>Approves or removes operator as an operator for the caller. Operators can call transferFrom or safeTransferFrom for any token owned by the caller.</td></tr><tr><td><code>getApproved(uint256 tokenId)</code></td><td>read</td><td>address</td><td>Returns the account approved for the tokenId token.</td></tr><tr><td><code>isApprovedForAll(address owner, address operator)</code></td><td>read</td><td>bool</td><td>Returns if the operator is allowed to manage all of the assets of owner.</td></tr></tbody></table>

### Structs

The contract defines a struct called Allocation, which represents a token `Allocation` made by a user. It includes the amount, veShare (voting escrow share), unlock timestamp, and token address

```
struct Allocation {
    uint256 amount;
    uint256 veShare;
    uint256 unlockTimestamp;
    address token;
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://split-docs.gitbook.io/docs/for-developers/contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
