-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
425 lines (347 loc) · 24.2 KB
/
main.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
\documentclass[tikz]{article}
% Packages
\usepackage[utf8]{inputenc} % Core latex bundle
\usepackage[a4paper, total={6in, 9in}]{geometry} % Customize document dimensions and formats
\usepackage{changepage} % Customize page layout in middle of document
\usepackage[table]{xcolor} % Add color to tables
\usepackage{standalone} % Add figures and tables from other files
\usepackage{import} % Import glossary
\usepackage{graphics} % General color and formats
\usepackage{url} % URL formatting
\usepackage{breakurl} % URL formatting
\usepackage{enumitem} % Format list spacing
\usepackage[hang]{footmisc} % Footnote margins
\usepackage{hyperref} % References
\usepackage{mathtools} % Useful tools for mathematical typesetting and replaces amsmath
\usepackage{amssymb,bm} % Math symbols
\usepackage{svg} % SVG
\usepackage{tikz} % Making charts
\usepackage{array,boldline,multirow,float,booktabs} % Added to make tables
\usepackage{stackengine} % Customize row heights
\usepackage{hhline} % Add double lines to table
\usepackage{multicol} % Two column lists
\usepackage{nicematrix} % Put table lines after color
\usepackage{wrapfig} % Wrap figures in text
\usepackage{tocloft,titletoc} % TOC package
\usepackage{titlesec} % Section spacing
\input{formatting/solidity-highlighting.tex} % https://github.com/s-tikhomirov/solidity-latex-highlighting
% Paper formatting
\newlength\LabelWidth
\setlength\parindent{0pt}
\setlength{\parskip}{1em}
% Section spacing
\titlespacing*{\section}
{0pt}{0.6\baselineskip}{0.6\baselineskip} % Modify section spacing - first \baselineskip is spacing before, second is spacing after the section
\titlespacing*{\subsection}
{0pt}{0.6\baselineskip}{0.6\baselineskip} % Modify subsection spacing
\titlespacing*{\subsubsection}
{0pt}{0.6\baselineskip}{0.6\baselineskip} % Modify subsubsection spacing
% String formats
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\term}[1]{\textsl{#1}}
% Paper margins
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist
% Table of contents
\renewcommand{\contentsname}{Table of Contents}
\renewcommand{\cfttoctitlefont}{\Large\bfseries} % TOC title size
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} % Add dots in TOC to sections
\renewcommand{\cftsecpagefont}{} % Remove \bfseries from section titles' page in TOC
% Section
\renewcommand*{\cftsecnumwidth}{2em} % Increase space section from numbers on left
% Subsection
\cftsetindents{subsection}{1em}{3em} % space between numbers and toc subsections
\setlength{\cftsubsecindent}{2.5em} % subsection number spacing from left
\setlength{\cftbeforesubsecskip}{3pt} % Messes with subsection TOC length was 3pt
% Subsubsection
\cftsetindents{subsubsection}{1em}{4em} % space between numbers and toc subsubsections
\setlength{\cftsubsubsecindent}{5.5em} % subsubsection number spacing from leftindent
\setlength{\cftbeforesubsubsecskip}{3pt} % Messes with subsubsection TOC length was 3pt
% paragraph section
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\cftsetindents{paragraph}{1em}{5em} % space between numbers and toc paragraph
\setlength{\cftparaindent}{9.5em} % paragraph number spacing from leftindent
\setlength{\cftbeforeparaskip}{3pt} % Messes with paragraph TOC length was 3pt
% indent after paragraph section
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
% Abstract
% Make abstract justified
\makeatletter
\newcommand{\justified}{
\rightskip\z@skip
\leftskip\z@skip}
\makeatother
% Format and size abstract
\makeatletter
\renewenvironment{abstract}{
\if@twocolumn
\section*{\abstractname}
\else
\begin{center}
{\bfseries \large\abstractname\vspace{\z@}} % Bolds abstract name
\end{center}
\quotation
\fi}
{\if@twocolumn\else\endquotation\fi}
\makeatother
% Delimiters
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor} % Define paired delimiter for floor function
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil} % Define paired delimiter for ceiling function
% Hyperlinks
\hypersetup{
colorlinks=true,
linkcolor=black,
filecolor=blue,
urlcolor=black,
}
\urlstyle{same}
% Footnotes
\newcommand{\fref}[1]{\footnote{\href{http://#1}{#1}}}
\setlength{\footnotemargin}{8mm} % Spacing between footnote number and body
% Include tables
\makeatletter
\newcommand{\includetable}[1]{%
\@ifundefined{tablepath}{%
\InputIfFileExists{#1}{}{}%
}{%
\InputIfFileExists{\tablepath/#1}{}{\InputIfFileExists{#1}{}{}}%
}
}
\makeatother
% Table formatting commands
\newcolumntype{Q}{ >{\centering\arraybackslash} m{2.4cm} } % (Figure 5 and 11 - col width)
\newcolumntype{S}{ >{\centering\arraybackslash} m{5.27cm} } % (Figure 12 - col width double)
\newcommand\xrowht[2][0]{\addstackgap[.5\dimexpr#2\relax]{\vphantom{#1}}} % Set row height for tables
\newcommand{\rowh}[1]{\xrowht{40pt}} % Command to set row height for cell with 3 rows
\newcommand{\rowm}[1]{\xrowht{26.667pt}} % Command to set row height for cell with 2 rows
\newcommand{\rows}[1]{\xrowht{13.333pt}} % Command to set row height for cell with 1 rows
% Symbols
\newcommand{\PipelineCover}{\includesvg[scale=3.0]{./logos/pipeline.svg}} % Logo on cover page
% List Key
\SetEnumitemKey{midsep}{topsep=0pt, itemsep=3pt} % Itemize key
% File paths
\newcommand{\tablepath}{figures} % Tables file path
\graphicspath{{figures/}} % Figures file path
%%%%%%% Begin Document %%%%%%%
\begin{document}
\pagenumbering{arabic} % Start page numbering style
\thispagestyle{empty} % Hide page numbering
\begin{titlepage}
\begin{center}
\vspace*{-0.1cm}
\begin{changemargin}{-0.25cm}{-0.25cm}
\centering % added to center title
\textbf{\Large{Pipeline \& Depot: Dance Through the EVM in 1 Transaction}}
\end{changemargin}
\begin{center}
\PipelineCover
\end{center}
\vspace{-0.1cm}
\begin{center}
\begin{tabular}{>{\centering\arraybackslash}p{5cm} >{\centering\arraybackslash}p{5cm}}
\large{Publius} & \large{Silo Chad} \\
\href{mailto:beanstalk.publius@protonmail.com}{\normalsize{beanstalk.publius@protonmail.com}} & \href{mailto:silochad@protonmail.com}{\normalsize{silochad@protonmail.com}}
\end{tabular}
\end{center}
\vspace{-0.25cm}
\normalsize{\href{https://evmpipeline.org/}{evmpipeline.org}}
\vspace{0.2cm}
\footnotesize{Published:} \normalsize{November 16, 2022}
\vspace{-0.25cm}
\footnotesize{Modified:} \normalsize{July 29, 2024}
\vspace{-0.25cm}
\footnotesize{Whitepaper Version:} {\normalsize{1.0.5}}
\vspace{-0.25cm}
\footnotesize{Code Version:} {\normalsize{1.0.1}}{\fref{github.com/BeanstalkFarms/Pipeline}}
\vspace{0.0cm}
\flushleft{\normalsize{\term{“Leave nothing for to-morrow which can be done to-day.”}}}
\normalsize{\hspace{2.5em}- The Collected Works of Abraham Lincoln edited by Roy P. Basler, Volume II, “Notes for a Law Lecture” (July 1, 1850?), p. 81}\fref{quod.lib.umich.edu/l/lincoln/lincoln2/1:134?rgn=div1;view=fulltext}
%% new link: https://quod.lib.umich.edu/l/lincoln/lincoln2/1:134?rgn=div1;view=fulltext
%% another potential link: https://www.abrahamlincolnonline.org/lincoln/speeches/lawlect.htm
\vspace{-0.2cm}
\begin{abstract}
\vspace{-0.2cm}
\justified{\normalsize{\noindent Using the Ethereum Virtual Machine\fref{ethereum.org/en/developers/docs/evm} (EVM) through an Externally-owned account\fref{ethereum.org/en/developers/docs/accounts} (EOA) is often a painful and time-intensive process. While the censorship resistant and permissionless applications that run on censorship resistant and permissionless computer networks have the potential to dramatically alter the fabric of society, they are less likely to do so if the user experiences they create are worse than centralized competitors. To date, using more than one protocol in the EVM from an EOA frequently requires multiple transactions. A generalized framework to permissionlessly use arbitrary protocols within the EVM, from an EOA, in a single transaction will improve user experiences with decentralized applications. We propose an Ethereum\fref{ethereum.org}-native pair of contracts that enable this framework for Ether, ERC-20\fref{ethereum.org/en/developers/docs/standards/tokens/erc-20}, ERC-721\fref{ethereum.org/en/developers/docs/standards/tokens/erc-721} and ERC-1155\fref{ethereum.org/en/developers/docs/standards/tokens/erc-1155} Standard tokens and Beanstalk\fref{github.com/BeanstalkFarms/Beanstalk} \term{Farm} balances and \term{Silo} \term{Deposits},\footnote{Any italicized terms not defined herein are defined by Beanstalk.} and can be easily further generalized to include other transferable asset types. A smart contract that can perform an arbitrary series of actions in the EVM in a single transaction creates a sandbox for execution that is loaded and called by a second contract with EIP-712\fref{eips.ethereum.org/EIPS/eip-712} \code{permit} support for asset approvals. A new function call architecture enables dynamic \code{callData}.}}
\end{abstract}
\end{center}
\end{titlepage}
\newpage
% TOC formatting
\thispagestyle{empty} % Hide TOC page numbering
\addtocontents{toc}{\protect\thispagestyle{empty}} % Allow hiding both TOC page numbers
\cleardoublepage
\pagenumbering{gobble}
{\large\tableofcontents} % Compile TOC with large font
\cleardoublepage
\pagenumbering{arabic}
\newpage
\setcounter{page}{3} % Begin page numbering
\section{Introduction}
The potential uses of the EVM are infinite. Its composable nature means that infinite functionality need not be implemented by a single protocol. Instead, EVM users can pick and choose the best protocol to use for each action. However, using more than one protocol in a single transaction currently requires a smart contract with a custom function that aggregates the desired protocols uses. Development of custom functions is often expensive and complex.
The need to perform multiple transactions to perform a single desired aggregate action within the EVM creates a horrible user experience. The execution of actions that require multiple transactions typically takes minutes of intermittent user attention and action. Before the execution of subsequent transactions, the reason for attempting to perform the larger action within the EVM could be invalidated by other changes in its state, rendering previous related transaction(s) wasted or worse. There is an additional gas cost associated with each additional transaction used to perform the same aggregate action. While the capabilities of the EVM are incredibly powerful, the likelihood that users take advantage of them in practice is significantly limited by the need to affect single actions in multiple transactions. The high development overhead associated with new functions to implement each combination of other protocols makes creating a good user experience in the EVM excessively difficult.
\term{Pipeline} is a standalone contract that creates a sandbox to execute an arbitrary composition of valid actions within the EVM in a single transaction using Ether. \term{Depot} is a wrapper for \term{Pipeline} that supports (1) loading Ether and non-Ether assets into \term{Pipeline}, (2) using them and (3) unloading them from \term{Pipeline}, in a single transaction. \term{Clipboard} defines an Advanced Function Call (AFC) architecture that allows subsequent function calls to use the \code{returnData} of previous ones in a configurable fashion. The combination of \term{Pipeline}, \term{Depot} and \term{Clipboard} allows EVM users to perform arbitrary valid actions, through arbitrarily many protocols, in a single transaction.
\section{Previous Work}
MakerDAO's \code{multicall}\fref{github.com/makerdao/multicall} function allows for arbitrarily many static calls to multiple protocols in a single call.
Uniswap's \code{multicall}\fref{github.com/Uniswap/v3-periphery/blob/main/contracts/base/Multicall.sol} function allows for arbitrarily many function calls to a single protocol in a single transaction.
Beanstalk's \code{farm}\fref{github.com/BeanstalkFarms/Beanstalk/blob/master/protocol/contracts/farm/facets/FarmFacet.sol} function allows for arbitrarily many function calls to multiple protocols in a single transaction, but requires an upgrade to support each new function call to another protocol.
EIP-712 standardizes a \code{permit} system to approve the transfer of an amount of an asset as a signed payload in the same transaction that transfers the asset.
\newpage
\section{Pipeline}
\term{Pipeline} creates a sandbox to execute any series of function calls on any series of protocols through \term{Pipe} functions. Any assets left in \term{Pipeline} between transactions can be transferred out by any account. Users \term{Pipe} a series of \term{PipeCalls} that each executes a function call to another protocol through \term{Pipeline}.
\subsection{Using Pipeline}
In order to safely use \term{Pipeline}, users must (1) load \term{Pipeline} with assets, (2) \term{Pipe} a series of \term{PipeCalls} to arbitrary protocols and (3) unload all assets from \term{Pipeline}, in a single transaction.
\begin{enumerate}
\item \textbf{Load Assets:} \term{Pipeline} is loaded through any asset transfer function. Users should not load \term{Pipeline} directly unless only loading Ether. Instead, when loading non-Ether assets, users should prepend an asset transfer function to a \term{Pipeline} call through \term{Depot}.
\item \textbf{\term{PipeCalls}:} \term{Pipeline} \term{Pipes} a series of \term{PipeCalls} to specified protocols executing each \term{PipeCall} in an isolated environment using the assets loaded in (1).
\item \textbf{Unload Assets:} \term{Pipeline} must be properly unloaded after each use to avoid loss of funds: any leftover assets can be unloaded from \term{Pipeline} by any account to a destination of their choosing. \term{Pipeline} can be properly unloaded by both (a) directing the outputs of \term{PipeCalls} straight to desired destinations and (b) \term{Piping} asset transfer function calls to transfer assets to desired destinations.
\end{enumerate}
(1) can only be safely performed in the same transaction as (2) and (3) directly through \term{Pipeline} if the only asset being loaded into it is Ether. In order to safely load non-Ether assets into \term{Pipeline} users can call \term{Pipeline} through \term{Depot}.
\begin{figure}[h!]
\centering
\includegraphics[scale=.65]{Figure1}
\vspace*{-5mm}
\caption{Using Pipeline}
\label{fig 1}
\end{figure}
\newpage
\subsection{PipeCalls}
\term{PipeCalls} specify a function call to be executed by \term{Pipeline}. \term{Pipeline} supports 2 types of \term{PipeCalls}: \term{PipeCall} and \term{AdvancedPipeCall}.
\begin{enumerate}
\item \textbf{\term{PipeCall}:} \term{PipeCall} makes a function call with a static target address and \code{callData}.
\begin{lstlisting}[language=Solidity]
struct PipeCall {
address target;
bytes data;
}
\end{lstlisting}
\item \textbf{\term{AdvancedPipeCall}:} \term{AdvancedPipeCall} makes a function call with a static target address and both static and dynamic \code{callData}.
\begin{lstlisting}[language=Solidity]
struct AdvancedPipeCall {
address target;
bytes data;
bytes clipboard; // See Section 5
}
\end{lstlisting}
\end{enumerate}
\subsection{Pipe Functions}
\term{Pipeline's} \term{Pipe} functions execute one or more \term{PipeCalls} or \term{AdvancedPipeCalls}. \term{Pipeline} has 3 \term{Pipe} functions: \code{pipe}, \code{multiPipe} and \code{advancedPipe}
\begin{enumerate}
\item \code{pipe}: \code{pipe} executes a single \term{PipeCall}.
\begin{lstlisting}[language=Solidity]
function pipe(PipeCall calldata p)
external
payable
returns (bytes memory result);
\end{lstlisting}
\item \code{multiPipe}: \code{multiPipe} executes a list of \term{PipeCalls}.
\begin{lstlisting}[language=Solidity]
function multiPipe(PipeCall[] calldata pipes)
external
payable
returns (bytes[] memory results);
\end{lstlisting}
\item \code{advancedPipe}: \code{advancedPipe} executes a list of \term{AdvancedPipeCalls}.
\begin{lstlisting}[language=Solidity]
function advancedPipe(AdvancedPipeCall[] calldata pipes)
external
payable
returns (bytes[] memory results);
\end{lstlisting}
\end{enumerate}
\newpage
\section{Depot}
\term{Depot} wraps \term{Pipeline's} \term{Pipe} functions to facilitate the loading of non-Ether assets in \term{Pipeline} in the same transaction that loads Ether, \term{Pipes} calls to other protocols, and unloads \term{Pipeline}.
\term{Depot} has four functions that wrap \term{Pipeline's} \term{Pipe} functions.
\begin{enumerate}
\item \code{pipe}: \code{pipe} wraps \term{Pipeline's} \code{pipe} function but does not support sending Ether.
\begin{lstlisting}[language=Solidity]
function pipe(PipeCall calldata p)
external
payable
returns (bytes memory result);
\end{lstlisting}
\item \code{etherPipe}: \code{etherPipe} wraps \term{Pipeline's} \code{pipe} function and supports sending Ether.
\begin{lstlisting}[language=Solidity]
function etherPipe(PipeCall calldata p, uint256 value)
external
payable
returns (bytes memory result);
\end{lstlisting}
\item \code{multiPipe}: \code{multiPipe} wraps \term{Pipeline's} \code{multiPipe} function but does not support sending Ether.
\begin{lstlisting}[language=Solidity]
function multiPipe(PipeCall[] calldata pipes)
external
payable
returns (bytes[] memory results);
\end{lstlisting}
\item \code{advancedPipe}: \code{advancedPipe} wraps \term{Pipeline's} \code{advancedPipe} function and supports sending Ether.
\begin{lstlisting}[language=Solidity]
function advancedPipe(AdvancedPipeCall[] calldata pipes, uint256 value)
external
payable
returns (bytes[] memory results);
\end{lstlisting}
\end{enumerate}
\section{Clipboard}
\term{Clipboard} allows users to \term{Copy} return values stored as \code{returnData} from any \term{AdvancedPipeCalls} that have already been executed and \term{Paste} them into the \code{callData} of the next \term{AdvancedPipeCall}, in a customizable manner.
Each \term{AdvancedPipeCall} includes \term{Clipboard} to encode (1) how many paste operations to perform, (2) which \code{returnData} from previous \term{AdvancedPipeCalls} to \term{Copy} (\term{i.e.}, \code{returnDataIndex}), (3) where to \term{Copy} from within (2) (\term{i.e.}, \code{copyIndex}), and (4) where to \term{Paste} it in the \code{callData} of the next \term{AdvancedPipeCall} (\term{i.e.}, \code{pasteIndex}). Bytes are \term{Pasted} 32 bytes at a time.
\term{Clipboard} defines a \code{Type}, whether to use Ether and how much, and corresponding \code{pasteParam(s)}, if necessary, for each \term{AdvancedPipeCall}.
\newpage
\subsection{Type}
The first byte of \term{Clipboard} defines its \code{Type}, which specifies the amount of \term{Pasting} operations in the \term{AdvancedPipeCall}. The \code{Type} is either \code{0x00}, \code{0x01} or \code{0x02}.
\begin{itemize}
\item \textbf{\code{0x00} - Basic function call:} no bytes are \term{Pasted} (\term{i.e.}, a static function call).
\item \textbf{\code{0x01} - 1 \code{bytes32} \term{Pasting} operation:} 1 \code{bytes32} is \term{Pasted} from a previous \term{AdvancedPipeCall's} \code{returnData}. 1 \code{pasteParams} are the first 32 bytes of the \term{Clipboard}.
\item \textbf{\code{0x02} - n \code{bytes32} \term{Pasting} operations:} n \code{bytes32} are \term{Pasted} from previous \term{AdvancedPipeCalls'} \code{returnData}. Bytes 2 through 31 are left empty, bytes 32 through 63 contain \code{pasteParams.location} and bytes 64 through 95 contain \code{pasteParams.length}. Bytes 96 through 96 + 32 * n are a \code{bytes32[]}, where each \code{bytes32} are the \code{pasteParams} for a given byte \term{Paste} operation.
\end{itemize}
\subsection{Ether Usage}
The second byte of \term{Clipboard} defines the \code{Use Ether Flag}, which specifies whether to include Ether in the \term{AdvancedPipeCall}. The \code{Use Ether Flag} is either \code{0x00} or \code{0x01}.
\begin{itemize}
\item \textbf{\code{0x00}} - Do not send Ether in the \term{AdvancedPipeCall}.
\item \textbf{\code{0x01}} - Send Ether in the \term{AdvancedPipeCall}. The amount of Ether to send is added as a \code{uint256} at the end of \term{Clipboard}.
\end{itemize}
\subsection{pasteParams}
\term{Clipboard} \code{Types} \code{0x01} and \code{0x02} accept one or more \code{pasteParams}, respectively, as inputs that encode where to \term{Copy} from, what to \term{Copy}, and where to \term{Paste} to, 32 bytes per \code{pasteParams}.
\begin{itemize}
\item \code{Empty} - bytes 0 - 1 are reserved for the Type and \code{Use Ether Flag}.
\item \code{returnDataIndex} - bytes 2 - 11 specify the index of the \code{returnData} to \term{Copy} in the list of \code{returnData} from previously executed \term{AdvancedPipeCalls} in the current \code{advancedPipe} function call, ordered by execution (\term{e.g.}, \code{0x0000000000} \term{Copies} the \code{returnData} of the 0th \term{AdvancedPipeCall}, \code{0x0000000001} \term{Copies} the \code{returnData} of the 1st, etc.).
\item \code{copyIndex} - bytes 12 - 21 specify the byte index in the corresponding \code{returnData[returnDataIndex]} to \term{Copy}. The first 32 bytes are the length of the return value (\term{e.g.}, \code{0x0000000020} \term{Copies} the 0th return value from \code{returnData[returnDataIndex]}, \code{0x0000000040} \term{Copies} the 1st return value, etc.).
\item \code{pasteIndex} - bytes 22 - 31 specify the byte index of where to \term{Paste} onto the \code{callData} of the next \term{AdvancedPipeCall} (\term{e.g.}, \code{0x0000000024} \term{Pastes} onto the 0th parameter of the next \term{AdvancedPipeCall's} \code{callData}, \code{0x0000000044} \term{Pastes} onto the 1st parameter, etc.).
\end{itemize}
\newpage
\begin{figure}[h!]
\centering
\hspace*{-8mm}
\includegraphics[scale=.29]{Figure2}
% \vspace*{-5mm}
\caption{Clipboard}
\label{fig 2}
\end{figure}
\newpage
\section{Risk}
There are numerous risks associated with \term{Pipeline} and \term{Depot}. This is not an exhaustive list.
The \term{Pipeline}, \term{Depot} and \term{Clipboard} code bases are novel. None have been tested in the “real world” prior to their initial deployment. The open source nature of \term{Pipeline} and \term{Depot} means that others can take advantage of any bugs, flaws or deficiencies in them.
The majority of known risks associated with \term{Pipeline} are from misuse:
\begin{itemize}
\item Failure to unload assets from \term{Pipeline} in the same transaction that loads it will highly likely result in a loss of those assets;
\item Approving \term{Pipeline} to use any assets will highly likely result in a loss of those assets; and
\item Improper encoding of \term{Clipboard} can result in a loss of funds or value. The complexity of properly encoding and decoding \term{Clipboard} makes verifying correctness difficult.
\end{itemize}
\section{Future Work}
\term{Pipeline}, \term{Depot} and \term{Clipboard} are a work in progress. While \term{Pipeline} and \term{Depot} are non-upgradable, they can be easily forked and improved. The following are potential improvements that can be incorporated into them:
\begin{itemize}
\item \term{Depot} easily can be further generalized to include other transferable asset types.
\item Currently \term{Clipboard} only supports \term{Copying} 32 bytes at a time. Additional \term{Clipboard} \code{Types} can be added to allow the entry of an additional \code{copyLength} parameter.
\item Tooling can be improved to make the encoding and decoding of \term{Clipboard} easier and more accessible.
\item The ability to execute \term{PipeCalls} on various “layers” of the Ethereum network in a single transaction can be implemented.
\end{itemize}
\newpage
\section{Appendix}
\input{appendix/Glossary} % Glossary
\newpage
\input{appendix/Version-History} % Whitepaper Version History
\end{document}