Skip to content

Commit

Permalink
get rid of reference page
Browse files Browse the repository at this point in the history
  • Loading branch information
bshahid331 committed Dec 20, 2023
1 parent e221cb0 commit dca35bd
Show file tree
Hide file tree
Showing 187 changed files with 3,339 additions and 274 deletions.
2 changes: 1 addition & 1 deletion docs/build/advanced-concepts/metadata-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,6 @@ In the example above, the `NFTCollectionDisplay` not only offers fundamental met

Understanding `MetadataViews` and the core functions associated with it is crucial for developers aiming to deploy NFTs on Flow. With these views and functions, NFTs can maintain a consistent presentation across various platforms and marketplaces and foster interoperability between contracts and applications in the Flow ecosystem. To gain a deeper understanding of implementing the MetadataView standard, Check out our documentation on "How to Create an NFT Project on Flow". It provides an introduction to integrating these standards into your NFT contracts.

- See the [API reference for a complete list of Metadata functions](https://developers.flow.com/references/core-contracts/flow-nft/MetdataViews/MetadataViews)
- See the [API reference for a complete list of Metadata functions](https://developers.flow.com/build/core-contracts/flow-nft/MetdataViews/MetadataViews)
- Check out [an Example NFT project](https://github.com/onflow/flow-nft/blob/master/contracts/ExampleNFT.cdc) implementing `MetadataViews`
- Read [the NFT Guide](../guides/nft.md) for an introduction to implementation
2 changes: 1 addition & 1 deletion docs/build/basics/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Find [more about the command in the CLI docs](../../tools/flow-cli/accounts/get-

Accounts can be obtained from the access node APIs, currently, there are two gRPC and REST APIs. You can find more information about them here:

**gRPC API** [building-on-flow/nodes/access-api#accounts](../../architecture/node-ops/nodes/access-api.md#accounts)
**gRPC API** [building-on-flow/nodes/access-api#accounts](../../networks/node-ops/nodes/access-api.md#accounts)

**REST API** [http-api#tag/Accounts](/http-api#tag/Accounts)

Expand Down
2 changes: 1 addition & 1 deletion docs/build/basics/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Find [more about the command in the CLI docs](../../tools/flow-cli/get-flow-data

Blocks can be obtained from the access node APIs, currently, there are two gRPC and REST APIs. You can find more information about them here:

[**gRPC Block API**](../../architecture/node-ops/nodes/access-api.md#blocks)
[**gRPC Block API**](../../networks/node-ops/nodes/access-api.md#blocks)

[**REST Block API**](/http-api#tag/Blocks)

Expand Down
2 changes: 1 addition & 1 deletion docs/build/basics/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Find [more about the command in the CLI docs](../../tools/flow-cli/get-flow-data

Collections can be obtained from the access node APIs, currently, there are two gRPC and REST APIs. You can find more information about them here:

[**gRPC Collection API**](../../architecture/node-ops/nodes/access-api.md#collections)
[**gRPC Collection API**](../../networks/node-ops/nodes/access-api.md#collections)

[**REST Collection API**](/http-api#tag/Collections)

Expand Down
2 changes: 1 addition & 1 deletion docs/build/basics/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ There is an unlimited amount of events that can be defined on Flow, but you shou

### FLOW Token Events

The FLOW Token contract uses the [fungible token standard on Flow](../../references/core-contracts/03-flow-token.md) and is the contract that issues a core FLOW token. As with any contract, it can emit events when interacted with. When we transfer the FLOW token, events are emitted. You can find a lot of details on the events emitted in the [FLOW Token documentation](../../references/core-contracts/03-flow-token.md).
The FLOW Token contract uses the [fungible token standard on Flow](../../build/core-contracts/03-flow-token.md) and is the contract that issues a core FLOW token. As with any contract, it can emit events when interacted with. When we transfer the FLOW token, events are emitted. You can find a lot of details on the events emitted in the [FLOW Token documentation](../../build/core-contracts/03-flow-token.md).

The most common events are when tokens are transferred which is accomplished with two actions: withdrawing tokens from the payer and depositing tokens in the receiver. Each of those action has a corresponding event:

Expand Down
2 changes: 1 addition & 1 deletion docs/build/basics/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ There are several places to learn more about transaction fees:

**When will the fee update go into effect?**

The updates were rolled out with the [Spork on April 6, 2022](../../architecture/node-ops/nodes/node-operation/past-sporks.md#mainnet-17), and were enabled on [June 1st](https://forum.onflow.org/t/permissionless-contract-deployment-progress/2981) during the [weekly epoch transition](https://github.com/onflow/service-account/tree/main/transactions/set-execution-effort-weights/2022/jun-1).
The updates were rolled out with the [Spork on April 6, 2022](../../networks/node-ops/nodes/node-operation/past-sporks.md#mainnet-17), and were enabled on [June 1st](https://forum.onflow.org/t/permissionless-contract-deployment-progress/2981) during the [weekly epoch transition](https://github.com/onflow/service-account/tree/main/transactions/set-execution-effort-weights/2022/jun-1).

**Why are fees collected even when transactions fail?**

Expand Down
6 changes: 3 additions & 3 deletions docs/build/basics/flow-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interact with FLOW.

There are two ways to acquire FLOW tokens as yield:

1. [Earn FLOW as a Validator or Delegator](../../architecture/staking/06-technical-overview.md): Receive newly-minted FLOW as a reward for running a node.
1. [Earn FLOW as a Validator or Delegator](../../networks/staking/06-technical-overview.md): Receive newly-minted FLOW as a reward for running a node.
1. [Earn FLOW as a Community Contributor](https://github.com/onflow/developer-grants): Flow offers grants for selected proposals as well as RFPs for teams to submit proposals for funded development

## How to Use FLOW
Expand All @@ -44,12 +44,12 @@ and then sign with the wallet of your choice only once you decide to make a purc

### Staking FLOW

[You can use FLOW to operate a staked node.](../../architecture/staking/06-technical-overview.md) Node operators receive newly-minted FLOW
[You can use FLOW to operate a staked node.](../../networks/staking/06-technical-overview.md) Node operators receive newly-minted FLOW
as a reward for helping to secure the network.

### Delegating FLOW

[You can use FLOW for stake delegation.](../../architecture/staking/06-technical-overview.md) Delegators receive newly-minted FLOW
[You can use FLOW for stake delegation.](../../networks/staking/06-technical-overview.md) Delegators receive newly-minted FLOW
as a reward for helping to secure the network.

### Holding FLOW
Expand Down
2 changes: 1 addition & 1 deletion docs/build/basics/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Scripts can be run against previous blocks, allowing you to query historic data

Scripts are executed by being submitted to the Access Node APIs. Currently, there’s support for two APIs:

[**gRPC Script API**](../../architecture/node-ops/nodes/access-api.md#scripts)
[**gRPC Script API**](../../networks/node-ops/nodes/access-api.md#scripts)

[**REST Script API**](/http-api#tag/Scripts)

Expand Down
2 changes: 1 addition & 1 deletion docs/build/basics/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ A user can define their own transactions or it can use already defined transacti

Transactions can be submitted and obtained from the access node APIs, currently, there are two gRPC and REST APIs. You can find more information about them here:

[**gRPC Transaction API**](../../architecture/node-ops/nodes/access-api.md#transactions)
[**gRPC Transaction API**](../../networks/node-ops/nodes/access-api.md#transactions)

[**REST Transaction API**](/http-api#tag/Transactions)

Expand Down
6 changes: 3 additions & 3 deletions docs/build/building-vs-other-chains.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,16 @@ Access Nodes are the node type that are most useful for developers, as they prov
- gRPC
- Mainnet: `access.mainnet.nodes.onflow.org:9000`
- Testnet: `access.devnet.nodes.onflow.org:9000`
- [Specification](../architecture/node-ops/nodes/access-api.md)
- [Specification](../networks/node-ops/nodes/access-api.md)

### Running Your Own Node

If you’re getting started you don’t need to run your own node and you can use the above public nodes. The public access nodes are rate-limited, so as your product matures you might want to run your own node. There are multiple options available:

- Start with a [Light (Observer) Node](../architecture/node-ops/nodes/node-operation/observer-node.md).
- Start with a [Light (Observer) Node](../networks/node-ops/nodes/node-operation/observer-node.md).
- You can also use a third-party provider like [Quicknode](https://www.quicknode.com/docs/flow).

Check out [Running a Node](../architecture/node-ops/nodes/node-operation/observer-node.md) for more information.
Check out [Running a Node](../networks/node-ops/nodes/node-operation/observer-node.md) for more information.

## SDKs and Tools

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,5 @@ pub event BurnerCreated()
```

### Staking Events
To learn more about staking events, read [staking/events/](../../architecture/staking/07-staking-scripts-events.md)
To learn more about staking events, read [staking/events/](../../networks/staking/07-staking-scripts-events.md)

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ These scripts are read-only and get info about the current state of the staking
## Delegator Transactions

Documentation for delegating with tokens is described in the staking documentation
for [the staking collection](../../architecture/staking/14-staking-collection.md)
for [the staking collection](../../networks/staking/14-staking-collection.md)

# Events

The `FlowIDTableStaking` contract emits an event whenever an important action occurs.
See the [staking events Documentation](../../architecture/staking/07-staking-scripts-events.md) for more information about each event.
See the [staking events Documentation](../../networks/staking/07-staking-scripts-events.md) for more information about each event.

```cadence
pub event NewEpoch(totalStaked: UFix64, totalRewardPayout: UFix64)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ to perform staking actions for any of their nodes or delegators.
The staking collection also manages creating a node's machine accounts if they have any collector or consensus nodes.
It also allows them to deposit and withdraw tokens from any of their machine accounts through the staking collection.

See the [Staking Collection Docs](../../architecture/staking/14-staking-collection.md) for more information on the design of the staking collection contract.
See the [Staking Collection Docs](../../networks/staking/14-staking-collection.md) for more information on the design of the staking collection contract.

Source: [FlowStakingCollection.cdc](https://github.com/onflow/flow-core-contracts/blob/master/contracts/FlowStakingCollection.cdc)

Expand Down
160 changes: 160 additions & 0 deletions docs/build/core-contracts/flow-ft/ExampleToken/ExampleToken.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Contract `ExampleToken`

```cadence
contract ExampleToken {
totalSupply: UFix64
VaultStoragePath: StoragePath
ReceiverPublicPath: PublicPath
VaultPublicPath: PublicPath
AdminStoragePath: StoragePath
}
```


Implemented Interfaces:
- `FungibleToken`

## Structs & Resources

### resource `Vault`

```cadence
resource Vault {
balance: UFix64
}
```
Each user stores an instance of only the Vault in their storage
The functions in the Vault and governed by the pre and post conditions
in FungibleToken when they are called.
The checks happen at runtime whenever a function is called.

Resources can only be created in the context of the contract that they
are defined in, so there is no way for a malicious user to create Vaults
out of thin air. A special Minter resource needs to be defined to mint
new tokens.

[More...](ExampleToken_Vault.md)

---

### resource `Administrator`

```cadence
resource Administrator {
}
```

[More...](ExampleToken_Administrator.md)

---

### resource `Minter`

```cadence
resource Minter {
allowedAmount: UFix64
}
```
Resource object that token admin accounts can hold to mint new tokens.

[More...](ExampleToken_Minter.md)

---

### resource `Burner`

```cadence
resource Burner {
}
```
Resource object that token admin accounts can hold to burn tokens.

[More...](ExampleToken_Burner.md)

---
## Functions

### fun `createEmptyVault()`

```cadence
func createEmptyVault(): Vault
```
Function that creates a new Vault with a balance of zero
and returns it to the calling context. A user must call this function
and store the returned Vault in their storage in order to allow their
account to be able to receive deposits of this token type.

Returns: The new Vault resource

---
## Events

### event `TokensInitialized`

```cadence
event TokensInitialized(initialSupply UFix64)
```
The event that is emitted when the contract is created

---

### event `TokensWithdrawn`

```cadence
event TokensWithdrawn(amount UFix64, from Address?)
```
The event that is emitted when tokens are withdrawn from a Vault

---

### event `TokensDeposited`

```cadence
event TokensDeposited(amount UFix64, to Address?)
```
The event that is emitted when tokens are deposited to a Vault

---

### event `TokensMinted`

```cadence
event TokensMinted(amount UFix64)
```
The event that is emitted when new tokens are minted

---

### event `TokensBurned`

```cadence
event TokensBurned(amount UFix64)
```
The event that is emitted when tokens are destroyed

---

### event `MinterCreated`

```cadence
event MinterCreated(allowedAmount UFix64)
```
The event that is emitted when a new minter resource is created

---

### event `BurnerCreated`

```cadence
event BurnerCreated()
```
The event that is emitted when a new burner resource is created

---
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Resource `Administrator`

```cadence
resource Administrator {
}
```

## Functions

### fun `createNewMinter()`

```cadence
func createNewMinter(allowedAmount UFix64): Minter
```
Function that creates and returns a new minter resource

Parameters:
- allowedAmount : _The maximum quantity of tokens that the minter could create_

Returns: The Minter resource that would allow to mint tokens

---

### fun `createNewBurner()`

```cadence
func createNewBurner(): Burner
```
Function that creates and returns a new burner resource

Returns: The Burner resource

---
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Resource `Burner`

```cadence
resource Burner {
}
```

Resource object that token admin accounts can hold to burn tokens.
## Functions

### fun `burnTokens()`

```cadence
func burnTokens(from FungibleToken.Vault)
```
Function that destroys a Vault instance, effectively burning the tokens.

Note: the burned tokens are automatically subtracted from the
total supply in the Vault destructor.

Parameters:
- from : _The Vault resource containing the tokens to burn_

---
Loading

0 comments on commit dca35bd

Please sign in to comment.